-
1. Re: Multiple Comboboxes reRendered by AJAX? valueChangeListe
rschoeler Feb 24, 2009 5:26 PM (in response to alan79)Hi Alan, I'm sure that you have looked at the demo for rich:comboBox...8-}
This is an example, which works for me, by AJAX and onselect:<rich:comboBox id="idList" value="#{mappingHandler.selectedIdentifier}" suggestionValues="#{mappingHandler.allIdentifiers}" directInputSuggestions="true" defaultLabel="#{msgs.mapping_combo_default}"> <a4j:support event="onselect" reRender="YOUR IDs" ajaxSingle="true" /> </rich:comboBox>
My observations:
ValueChangeListener needs submit
PropertyActionListener works also with AJAX - I use this often inside a4j:commandlink
One remark:
If you have elements, which are not AJAX-able, or doesn't render correctly - just try a4j:outputPanel around<a4j:outputPanel id="YOUR ID" layout="none">
With the example above I've dynamically reloaded a rich:datatable - therefore I'm sure that this could also be done with a second rich:comboBox
regards
rschoeler -
2. Re: Multiple Comboboxes reRendered by AJAX? valueChangeListe
alan79 Feb 26, 2009 11:34 AM (in response to alan79)Hi!
Thank you for the reply. My problem was that I try to implement all the business logic in the backing bean and not in the POJO (data model).
When reRendering a partial part of the page all getters of the fields in this partial part are executed. I only had getters of the POJO available, not of the bean (e.g. bean.record.name). I got it now to work. I just added a dummy-label to the form. This label is referencing to a entity of the backing bean. In the getter of this dummy-label I implemented the logic to reload the lists and resetting field if necessary. It works pretty charming even if I have the feeling that it could be done better.
Regards
Alan -
3. Re: Multiple Comboboxes reRendered by AJAX? valueChangeListe
alan79 Mar 5, 2009 9:51 AM (in response to alan79)I used the combobox completly the wrong way round. the rich:comboBox is not meant to be used for selections..
the suggestionBox is the right component to achieve this functionality..