Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Validating components even with autosubmit and immediate

996326Apr 4 2013 — edited Apr 5 2013
Greetings:

I am working in a application using ADF 11g. In my page, I have a <af:selectOneRadio> with two options (selectItem). These selectItem's have both immediate and autoSubmit attributes equal to true. Next, there is a <af:panelGroupLayout> which partialTriggers attribute points to prior selectOneRadio. Inside panelGroupLayout, there are some <af:inputText>'s. All of them are required. Depending of selectOneRadio value, some inputs will have their label changed, while others will be (or not) renderized. After this panelGroupLayout, I have a <af:commandButton>, where there will be the real submission.
What I was expecting was, when I changed the select value, a partial submission would be done, without validation, and changed the labels or rederization of components inside panelGroupLayout. However, the components are being validated. The error messages are shown and the components chagings are not happening.
Googling for some solution (https://www.google.com.br/search?q=adf+not+validate+at+partial+submit) , I found some suggestions that either did not work or thought too complicated (e.g. Use a subform and configure the page definition XML (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/40-ppr-subform-169182.pdf)). I think that there is a simpler solution, but I could not found it.
Below my JSF code:
   <af:form id="formCadastroUsuarioLicitacoes" usesUpload="true">
	  <af:panelGroupLayout halign="end" id="pnGL1">
		  <af:selectOneRadio id="radioType" value="#{viewScope.myManagedBean.type}" immediate="true" required="true"
							 styleClass="radioType" autoSubmit="true">
			<f:selectItem itemLabel="Type A" itemValue="a" id="itemA"/>
			<f:selectItem itemLabel="Type B" itemValue="b" id="itemB"/>
		  </af:selectOneRadio>
		   
			<af:panelGroupLayout id="panelGroupForm" partialTriggers="radioType" styleClass="AFStretchWidth">
			  <af:inputText id="txfDoc" value="#{viewScope.myManagedBean.document}"
							label="#{(viewScope.myManagedBean.type == 'b')? 'Doc B': 'Doc A'}" required="true" 
							/>
			  <af:inputText id="txfcompany" value="#{viewScope.myManagedBean.company}" label="company"
							rendered="#{(viewScope.myManagedBean.type == 'b')}" required="true" />
			  <af:inputText id="txfName" value="#{viewScope.myManagedBean.name}"
							label="#{(viewScope.myManagedBean.type == 'b')? 'Your Name': 'Name'}" required="true" />
			  <af:inputText id="txfEmail" value="#{viewScope.myManagedBean.email}" label="Email" required="true" />
			  <af:inputText id="txfEmailConfirm" value="#{viewScope.myManagedBean.emailConfirm}" label="Confirm your Email"
							required="true" />
			  <af:inputText id="txfphine" value="#{viewScope.myManagedBean.phine}" label="phine"
							rendered="#{(viewScope.myManagedBean.type == 'b')}" required="true" />
			  <af:inputText id="txfFax" value="#{viewScope.myManagedBean.fax}" label="Fax"
							rendered="#{(viewScope.myManagedBean.type == 'b')}" required="true" />
			</af:panelGroupLayout>
		   
		  <af:commandButton text="Submit" id="btnsubmit" action="#{viewScope.myManagedBean.save}"/>
	  </af:panelGroupLayout>
  </af:form>
Thanks,

Rafael Afonso

Edited by: 993323 on 04/04/2013 13:50
This post has been answered by 962262 on Apr 4 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 3 2013
Added on Apr 4 2013
2 comments
384 views