-
1. Re: aj4:region and immediate
ilya_shaikovsky Jan 25, 2010 3:00 AM (in response to flowerlin)sorry, but seems case not fully clear. Your current code looks fine and both selects should be processed just as you need with it.. Whats wrong with it that you want to use immediate? -
2. Re: aj4:region and immediate
flowerlin Jan 25, 2010 3:13 AM (in response to ilya_shaikovsky)this is my implementation of the action listener
public void newActionListener(ActionEvent event) {
HtmlSelectOneMenu parent = (HtmlSelectOneMenu) event.getComponent().getParent();
this.value = (String) parent.getSubmittedValue();
if (null == value || false == value.equals(NEW_ENTITY_ITEM_VALUE)) {
throw new AbortProcessingException();
}
}the problem is that there is no value in the HtmlSelectOneMenu component. If I put immediate="true" on the a4j:status then I get the value in the HtmlSelectOneMenu component.
I need to have the value in the action listener, because it is related to my architecture. I'm trying to make a "New Entity" option in the combo box which opens a modal dialog to create new option on demand. It works fine but now I need the value of another component to create the new option in the select.
-
3. Re: aj4:region and immediate
ilya_shaikovsky Jan 25, 2010 5:23 AM (in response to flowerlin)B.t.w. How about to move this logic to select valueChangeListener? It will looks more accurate + you will just get values from event.
-
4. Re: aj4:region and immediate
nbelaevski Jan 25, 2010 5:19 AM (in response to flowerlin)There's a problem in your code. "submittedValue" attribute is erased after successful conversion, refer to UIInput documentation and code. -
5. Re: aj4:region and immediate
flowerlin Jan 25, 2010 6:15 AM (in response to ilya_shaikovsky)Works fine with the value change listener. It is invoked before the action of the a4j:support tag, which is what I need.
Thanks.
The reason why I don't get the submited value in my action listener without specifying immediate="true" is that the immediate attribute causes the value to be populated in the component model before the action listener is invoked.