Query about SelectOneMenus in t:datalist
Hi,I have two drop-downs in a datalist, i.e., there are several rows, each having two dropdowns and a textbox. On change of the first dropdown, I need to change the select items in the second dropdown and manipulate the textbox (change it to a calendar or dropdown). Now the problem is, since the components are being built dynamically, I have no way of knowing the ID of the first dropdown. Therefore I cannot use something like this in the sandbox: ajaxSelectItemsMethod="#{ajaxChildComboBoxBean.getCitiesOfSelectedCountry}"> I was trying to do this manually, change the components in the valuechangelistener but for this I need more information than just the new value. Any way I could pass more than one values in a value change listener? Or use updateactionlistener with selectonemenu to update several backing bean attributes? Please ask if any more information is required to be able to help.Please help, this is a show stopper in my application. :(Thanks in advance,Regards,Aneesha
Re: Query about SelectOneMenus in t:datalist
Hi all,I am trying to solve this problem by using datatable instead of datalist and retrieving the current row using getRow. However, the valuechangelistener of the selectonemenu is not being called inside the datatable. I am using the following code: HtmlSimpleColumn column = new HtmlSimpleColumn(); HtmlSelectOneMenu columnsDropdown = new HtmlSelectOneMenu(); vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{ record.columnDropDown.selectedValue}");columnsDropdown.setValueBinding ("value", vb);MethodBinding mb = FacesContext.getCurrentInstance ().getApplication().createMethodBinding("#{filter.columnChangeListener}", new Class[]{ValueChangeEvent.class}); columnsDropdown.setValueChangeListener(mb); UISelectItems columnSelectItems = new UISelectItems(); vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{record.columnDropDown.selectItems}"); columnSelectItems.setValueBinding("value", vb); columnsDropdown.getChildren().add(columnSelectItems); column.getChildren().add(columnsDropdown); datatableChild.getChildren().add(column);The signature of the valuechangelistener is as follows: public void columnChangeListener(ValueChangeEvent event) {// code here }Anyone got any idea why this is not working? What am I doing wrong?Please help.Thanks,Aneesha On 11/13/06, Aneesha Govil <[EMAIL PROTECTED]> wrote: Hi,I have two drop-downs in a datalist, i.e., there are several rows, each having two dropdowns and a textbox. On change of the first dropdown, I need to change the select items in the second dropdown and manipulate the textbox (change it to a calendar or dropdown). Now the problem is, since the components are being built dynamically, I have no way of knowing the ID of the first dropdown. Therefore I cannot use something like this in the sandbox: ajaxSelectItemsMethod="#{ajaxChildComboBoxBean.getCitiesOfSelectedCountry}"> I was trying to do this manually, change the components in the valuechangelistener but for this I need more information than just the new value. Any way I could pass more than one values in a value change listener? Or use updateactionlistener with selectonemenu to update several backing bean attributes? Please ask if any more information is required to be able to help.Please help, this is a show stopper in my application. :(Thanks in advance,Regards,Aneesha
Re: Query about SelectOneMenus in t:datalist
Got this to work. I forgot to add " to the selectone menu.Regards,AneeshaOn 11/13/06, Aneesha Govil < [EMAIL PROTECTED]> wrote: Hi all,I am trying to solve this problem by using datatable instead of datalist and retrieving the current row using getRow. However, the valuechangelistener of the selectonemenu is not being called inside the datatable. I am using the following code: HtmlSimpleColumn column = new HtmlSimpleColumn(); HtmlSelectOneMenu columnsDropdown = new HtmlSelectOneMenu(); vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{ record.columnDropDown.selectedValue}");columnsDropdown.setValueBinding ("value", vb);MethodBinding mb = FacesContext.getCurrentInstance ().getApplication().createMethodBinding("#{filter.columnChangeListener}", new Class[]{ValueChangeEvent.class}); columnsDropdown.setValueChangeListener(mb); UISelectItems columnSelectItems = new UISelectItems(); vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{record.columnDropDown.selectItems}"); columnSelectItems.setValueBinding("value", vb); columnsDropdown.getChildren().add(columnSelectItems); column.getChildren().add(columnsDropdown); datatableChild.getChildren().add(column);The signature of the valuechangelistener is as follows: public void columnChangeListener(ValueChangeEvent event) {// code here }Anyone got any idea why this is not working? What am I doing wrong?Please help.Thanks,Aneesha On 11/13/06, Aneesha Govil < [EMAIL PROTECTED]> wrote: Hi,I have two drop-downs in a datalist, i.e., there are several rows, each having two dropdowns and a textbox. On change of the first dropdown, I need to change the select items in the second dropdown and manipulate the textbox (change it to a calendar or dropdown). Now the problem is, since the components are being built dynamically, I have no way of knowing the ID of the first dropdown. Therefore I cannot use something like this in the sandbox: ajaxSelectItemsMethod="#{ajaxChildComboBoxBean.getCitiesOfSelectedCountry}"> I was trying to do this manually, change the components in the valuechangelistener but for this I need more information than just the new value. Any way I could pass more than one values in a value change listener? Or use updateactionlistener with selectonemenu to update several backing bean attributes? Please ask if any more information is required to be able to help.Please help, this is a show stopper in my application. :(Thanks in advance,Regards,Aneesha