-
1. Re: Sending form fields when paging
sergeysmirnov Apr 11, 2007 3:39 PM (in response to juanignaciosl)page code snippet will be helpful here for any further discussions
-
2. Re: Sending form fields when paging
juanignaciosl Apr 12, 2007 3:51 AM (in response to juanignaciosl)"SergeySmirnov" wrote:
page code snippet will be helpful here for any further discussions
Here's my current JSF code:<a4j:form id="paginadorConvocatoriasForm" ajaxSubmit="true"> <a4j:support event="oncomplete" reRender="convocatoriasRiFa" /> <a4j:region id="paginadorConvocatoriasRegion" > <h:inputText value="#{convocatoriaPaginadorBean.modelo.titulo}" id="titulo" required="true"> <a4j:support event="onchange" reRender="convocatoriasRiFa"/> </h:inputText> (...) <rich:dataTable id="convocatoriasRiFa" var="convocatoria" binding="#{convocatoriaPaginadorBean.datos}" value="#{convocatoriaPaginadorBean.modelo.value}" rows="#{convocatoriaPaginadorBean.modelo.rows}" rowClasses="oddRow, evenRow" headerClass="tableHeader"> (...) </rich:dataTable> <rich:datascroller id="convocatoriasRiFaScroller" for="convocatoriasRiFa" fastStep="#{convocatoriaPaginadorBean.elementosAvanceRapido}" styleClass="scroller" > </rich:datascroller> <a4j:status startText="a Performing Request" stopText="a Request Done" for="paginadorConvocatoriasRegion"> </a4j:status> </a4j:region> </a4j:form>
This way I can send an AJAX request when I change "titulo" ("title"), but I don't know how to tell the datatable to update. In the server side I'm using the PageableListDataModel from tomahawk examples. -
3. Re: Sending form fields when paging
juanignaciosl Apr 12, 2007 4:23 AM (in response to juanignaciosl)One more thing: as "titulo" is not sent when I press a page button, it gets lost if it doesn't saved in session scope
-
4. Re: Sending form fields when paging
ilya_shaikovsky Apr 12, 2007 6:40 AM (in response to juanignaciosl)Try onkeyup instead of onchange. input must loose focus to fire onchange event.
-
5. Re: Sending form fields when paging
juanignaciosl Apr 12, 2007 6:46 AM (in response to juanignaciosl)"ilya_shaikovsky" wrote:
Try onkeyup instead of onchange. input must loose focus to fire onchange event.
Thanks, but I already know that. There's no problem with the inputText, since aj4:support does the trick. My only problem by now is sending the inputText value when you press a button at the scroller, in order to not being forced to store it in session.
This is the code so far:(...) <a4j:form id="paginadorConvocatoriasForm" ajaxSubmit="true"> <a4j:region id="paginadorConvocatoriasRegion"> (...) <h:inputText value="#{convocatoriaPaginadorBean.modelo.titulo}" id="titulo" required="true"> <a4j:support event="onkeypress" reRender="convocatoriasRiFaScroller,convocatoriasRiFa" requestDelay="500" /> </h:inputText> (...) <rich:dataTable id="convocatoriasRiFa" var="convocatoria" binding="#{convocatoriaPaginadorBean.datos}" value="#{convocatoriaPaginadorBean.modelo.value}" rows="#{convocatoriaPaginadorBean.modelo.rows}" rowClasses="oddRow, evenRow" headerClass="tableHeader"> (...) </rich:dataTable> <rich:datascroller id="convocatoriasRiFaScroller" for="convocatoriasRiFa" fastStep="#{convocatoriaPaginadorBean.elementosAvanceRapido}" styleClass="scroller"></rich:datascroller> <a4j:status startText="a Performing Request" stopText="a Request Done" for="paginadorConvocatoriasRegion"> </a4j:status> </a4j:region> </a4j:form>
-
6. Re: Sending form fields when paging
sergeysmirnov Apr 12, 2007 1:29 PM (in response to juanignaciosl)The form field will be submitted if you set ajaxSingle to false. I.e:
<rich:datascroller ajaxSingle="false" .... />
Be careful there. If validation is failed, the scrolling will be not perform. -
7. Re: Sending form fields when paging
juanignaciosl Apr 13, 2007 6:59 AM (in response to juanignaciosl)Ok, thank you, that worked.
Now I have another problem: how can I tell the page to "reload"? I'm trying with a "changed" flag, but my datamodel (an extension from PageableListDataModel from tomahawk cars example) goes into an infinite loop. Is there any example of the server side code I should use?
Thanks in advance -
8. Re: Sending form fields when paging
sergeysmirnov Apr 13, 2007 2:03 PM (in response to juanignaciosl)What does it mean " page to "reload"" in your case?
-
9. Re: Sending form fields when paging
juanignaciosl Apr 13, 2007 2:54 PM (in response to juanignaciosl)I'm sorry, I didn't realize that was such a confusing sentence composition :D
It means "paged table to update". Used datamodel (PageableListDataModel) doesn't have something like update(), and when I try to add the flag, it falls into an endless loop. Is there any other implementation of a paged table model? RichFaces documentation is really great at tag level, but JSF also involves beans, its configuration, and data models, and for inexperienced people like me it's not that easy.
Thank you for your help and patience -
10. Re: Sending form fields when paging
sergeysmirnov Apr 13, 2007 2:57 PM (in response to juanignaciosl)why did you use a4j:form ajaxSubmit="true" . I hardly understand what might be the motivation.
-
11. Re: Sending form fields when paging
juanignaciosl Apr 16, 2007 3:00 AM (in response to juanignaciosl)I thought it might be neccesary. Removing...