-
1. Re: required=true: If and only if "Save" button is clicked
diegocoronel Mar 5, 2009 9:35 PM (in response to luxspes)Hi Francisco,
if i understood what you want i think your solution is ajax:region, something like:
<a4j:region> <h:input required=true xxxxx> <a4j:support .... some ajax here/> // instead of a4j:region you can use ajaxSingle=true here </h:input> </a4j:region> <h:input required=true yyyyyy </h:input> <h:button value=save.../>
-
2. Re: required=true: If and only if "Save" button is clicked
joblini Mar 6, 2009 2:38 AM (in response to luxspes)Are you using ajaxSingle="true"?
-
3. Re: required=true: If and only if "Save" button is clicked
luxspes Mar 6, 2009 10:30 PM (in response to luxspes)Yes but a4j:region does not work, because I am using rich:tab in switchType mode
ajax
. For example (in pseudo code for brevity):<rich:tabPanel switchType="ajax"> <rich:tab label="First"> <h:selectOneMenu required="true"> <s:selectItems noSelectionLabel="Select one..."/> </h:selectOneMenu> </rich:tab> <rich:tab label="Other"> Other Stuff </rich:tab> <rich:tabPanel>
So I can not switch from tab
First
to tabSecond
unless I select something in the h:selectOneMenu with the required="true" and if I add regions (one inside each tab, and when that didn't work one around all the tabPanel):<rich:tabPanel switchType="ajax"> <a:region> <rich:tab label="First"> <a:region> <h:selectOneMenu required="true"> <s:selectItems noSelectionLabel="Select one..."/> </h:selectOneMenu> <a:region> </rich:tab> <rich:tab label="Other"> <a:region> Other Stuff <a:region> </rich:tab> <rich:tabPanel> <a:region>
I does not help at all, seems like regions are useless for this... Any other suggestions?
-
4. Re: required=true: If and only if "Save" button is clicked
joblini Mar 7, 2009 12:24 AM (in response to luxspes)Do you have a single form, around all the tabs, or do you have a form inside each tab?
-
5. Re: required=true: If and only if "Save" button is clicked
luxspes Mar 10, 2009 10:53 PM (in response to luxspes)Single form... why?
-
6. Re: required=true: If and only if "Save" button is clicked
swd847 Mar 11, 2009 10:06 AM (in response to luxspes)I have been bitten by this many times in the past. required=true and ajax does not play well together. I have been considering trying to create a page tag that allows for conditional requiredness, something like:
<h:inputText value="#{a}" > <s:required value="button1,button2" /> </h:inputText>
That would have the effect of only making the control required if the form was submited by components button1 or button2. All the existing workarounds such as ajaxSingle have serious limitations.