-
1. Re: submit only some fields
sergeysmirnov May 29, 2008 2:01 PM (in response to lcurros)DO NOT cross-post.
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154412#4154412 -
2. Re: submit only some fields
lcurros May 29, 2008 4:58 PM (in response to lcurros)Thanks for your help, Sergey
I have just read about ajaxSingle=true. I read that using it only current component will be submited. So if I put in commandLink the value of specificField wont be submited, is this true?
Can I use actionparam to send this value to server in this way?:<a4j:commandLink id="ajaxLink" ajaxSingle="true" action="#{myBean.addItem}" reRender="dynamicList"> <a4j:actionparam name="n" value="#{myBean.specificField}" /> <s:conversationId /> </a4j:commandLink>
I was thinking in use a nested form with only this field inside. Is this possible?
P.S. Sorry for the cross post. I mixed up putting in this forum, I thought the right one was Richfaces. My apoligies. -
3. Re: submit only some fields
sergeysmirnov May 29, 2008 6:43 PM (in response to lcurros)Hmm? Where did you read that?
ajaxSingle - boolean attribute which provides possibility to limit JSF tree processing(decoding, conversion/validation, value applying) to the component which send the request only.
1) the whole form is submitted
2) only component marked with ajaxSingle="true" is processed.
The result - the validation rules on other components are invoked, because their are not processed, but not because of their are not submitted.
Sure, you can use a4j:actionParam as well as f:param to pass some data together with commandLink. However, you also can point to some of the form components if you want to add them to the processing.
Like that:<%-- will be excluded --%> <h:inputText id="blahblah" required="true" ...... /> <%-- will be included --%> <h:inputText id="foo" ...... /> ... <%-- will be included --%> <h:inputText id="bar" ...... /> <a4j:commandLink id="ajaxLink" ajaxSingle="true" process="foo, bar" ........ </a4j:commandLink>
-
4. Re: submit only some fields
lcurros May 30, 2008 3:32 AM (in response to lcurros)Thanks Sergey, I confused myself with ajaxSingle=true ;)
now I understand a bit more of AJAX
Your solution works perfect for me.
I am using process to update values that I need.
Another alternative that worked for me is to nest other a4j:form and surround this last with a4j:region. In this form I put only the fields I need in my ajax request.<a4j:form id="mainForm"> ..... <%-- will be excluded --%> <h:inputText id="blahblah" required="true" ...... /> ..... <4j:region id="myRegion"> <4j:form id="ajaxForm"> <%-- will be included --%> <h:inputText id="foo" ...... /> ... <%-- will be included --%> <h:inputText id="bar" ...... /> <a4j:commandLink id="ajaxLink" ajaxSingle="true" process="foo, bar" ........ </a4j:commandLink> </a4j:form> </a4j:region> .... </a4j:form>
Could be any problem with this? -
5. Re: submit only some fields
daniel.soneira May 30, 2008 4:15 AM (in response to lcurros)Nesting forms is a BAD idea indeed :) Never do that.
You can have multiple forms on one page - but DON'T nest them.