-
1. Re: Handling ajax4jsf onchange event in different panel
nbelaevski Oct 20, 2008 11:23 AM (in response to valatharv)Hi,
Looks like the code got messed? Can you please repost it? -
2. Re: Handling ajax4jsf onchange event in different panel
valatharv Oct 20, 2008 2:40 PM (in response to valatharv)Thanks for looking into it, here is the first issue, please ignore my last post
a:support event="onchange" validates other form fields...
I have some form fields in a xhtml page, some text fileds are (required="true").
If user selects the master dropdown down list, without filling mandatory fields page is validated and I see the error in console as
--------------------------------------------------------------------------
WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=study:j_id166:0:j_id187:color[severity=(ERROR 2), summary=(value is required), detail=(value is required)]
--------------------------------------------------------------------------
In the above case I tried selecting the dropdown without filling "pname" text field which was at the bottom of the page...
I tried immediate=true but no success
<rich:panel>
<s:decorate id="entryPointDecoration" template="layout/edit.xhtml">
<ui:define name="label">Entry Point</ui:define>
<h:inputText id="entryPoint" required="true" value="#{quantExperimentHome.instance.entryPoint}"/>
</s:decorate>
<a:outputPanel id="myPanel1">
<s:decorate id="masterItems" template="layout/edit.xhtml">
<ui:define name="label">Master List : </ui:define>
<h:selectOneMenu value="#{itemList.masterValue}" required="true" immediate="true">
<s:selectItems var="v_item" value="#{itemList.masterItems}" label="#{v_item}" noSelectionLabel="select quantitation ..."/>
<a:support event="onchange" reRender="panel2"></a:support>
</h:selectOneMenu>
</s:decorate>
</a:outputPanel>
</rich:panel>
ISSUE:
But when I place <a:outputPanel id="panel2".." in another rich panel as below, nothing happens when I change 1st. dropdown
===============================================
<rich:panel>
<h:outputText value="Color" />
<h:outputText value="PName" />
<a:outputPanel id="panel2" rendered="#{!empty itemList.masterValue}">
<h:selectOneMenu value="#{itemList.detailValue}" immediate="true">
<s:selectItems var="v_item" value="#{itemList.detailItems}" label="#{v_item}" noSelectionLabel="select color ..."/>
</h:selectOneMenu>
</a:outputPanel>
<s:decorate template="layout/edit.xhtml">
<h:inputText id="pname" required="true" value="#{info.pname}"/>
</s:decorate>
<tbody...
</rich:panel> -
3. Re: Handling ajax4jsf onchange event in different panel
nbelaevski Oct 21, 2008 10:04 AM (in response to valatharv)Can you please try to remove
rendered="#{!empty itemList.masterValue}"
and see if it will work?