If possible, I'd replace "onchange=document.forms[0].submit();return
false;"with the submitOnEvent sandbox component.
My guess is that you need to use the javascript documented here:
http://myfaces.apache.org/sandbox/subForm.html
I've had no issues with a subForm, a selectOneMenu, a submitOnEvent, and a
commandButton triggering an action when an option is chosen from the menu.
The other possiblity to investigate is if validation is failing for some
other component on your page -- make sure you've got a t:messages component
for debugging.
On 3/14/07, Madhav Bhargava <[EMAIL PROTECTED]> wrote:
Hi All,
*Following is the JSP code:*
<s:subForm id="subFormId">
*x----- Cut ----x*
<t:panelGrid columns="1" width="450px">
<t:selectOneMenu id="decline_value"
styleClass="selectOneMenu" onchange="document.forms[0].submit();return
false;"
value="#{
physicianEConsultation.uiBean.declineValue}"
valueChangeListener="#{
physicianEConsultation.detailsChanged}" required="true">
<f:selectItem itemLabel="--Select--"
itemValue=""/>
<f:selectItems value="#{
physicianEConsultation.declineReasonList}"/>
</t:selectOneMenu>
<t:message for="decline_value"
styleClass="error"></t:message>
</t:panelGrid>
*x----- Cut ----x*
</s:subForm>
In the above code we have a select one menu component. If the user changes
the selection then an onchange event is fired which will then submit the
form. Once the form is submitted then in process validations phase the
ValueChangeListener should be called.
*Weird behavior:*
With the above piece of code the value change listener does not get called
even when the user changes a selection in the drop down component.
However if you add – immediate = "true" then the ValueChangeListener is
called.
I added <t:messages> to the JSP to check if there were any validation
errors which would cause the JSF to skip directly to the render response
phase. But there are no validation errors.
* *
*There is another observation that I made:*
If I remove <t:subForm> component, then with the above code the
ValueChangeListener is called as expected.
Is this a problem with <t:subForm> component?
Regards,
Madhav
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
solely for the use of the addressee(s). If you are not the intended
recipient, please notify the sender by e-mail and delete the original
message. Further, you are not to copy, disclose, or distribute this e-mail
or its contents to any other person and any such actions are unlawful. This
e-mail may contain viruses. Infosys has taken every reasonable precaution to
minimize this risk, but is not liable for any damage you may sustain as a
result of any virus in this e-mail. You should carry out your own virus
checks before opening the e-mail or attachment. Infosys reserves the right
to monitor and review the content of all messages sent to or from this
e-mail address. Messages sent to or from this e-mail address may be stored
on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***