-
1. Re: Creating editable rich:dataTable with rich:datascroller
stefanotravelli Sep 9, 2008 4:46 PM (in response to aogier.netangel+seamframework.gmail.com)In order to achieve an editable rich:datatable you need a JSF DataModel in the 'value' attribute, not a simple List.
With Seam you can easily outject a conversational JSF DataModel through the @DataModel annotation.
I can't understand the role of the Command entity and why do you call persist(), however form values are updated during the JSF UPDATE MODEL phase, so before the INVOKE APPLICATION for the exact purpose of allowing the backing bean to deal with the updated values when it get invoked.
hope this helps
stefano -
2. Re: Creating editable rich:dataTable with rich:datascroller
aogier.netangel+seamframework.gmail.com Sep 18, 2008 3:00 PM (in response to aogier.netangel+seamframework.gmail.com)Actually I've managed to solve my problem.
It's not a problem of @DataModel, I just had to add a <a:support event="onpagechange"/> on my datascroller, and it worked ! (I've also put a reRender attribute, and didn't test without)
<rich:dataTable id="dataTableId" value="#{commandHome.productList}" var="product" rows="10"> <rich:column> <h:selectBooleanCheckbox value="#{product.selected}" /> </rich:column> <rich:column> <h:outputText value="#{product.label}" /> </rich:column> <rich:column> <h:inputText value="#{product.comment}" /> </rich:column> <f:facet name="footer"> <rich:datascroller reRender="dataTableId" limitToList="true"> <a:support event="onpagechange"/> </rich:datascroller> </f:facet> </rich:dataTable>
-
3. Re: Creating editable rich:dataTable with rich:datascroller
aogier.netangel+seamframework.gmail.com Sep 18, 2008 3:05 PM (in response to aogier.netangel+seamframework.gmail.com)(Oh, by the way, I've made a translation mistake for all that talk about
Command
on my examples, actually I meantOrder
. So I should have talked aboutOrderHome
. That's why I persist() my OrderHome ;) ) -
4. Re: Creating editable rich:dataTable with rich:datascroller
raghu_dev2005 May 15, 2009 10:34 AM (in response to aogier.netangel+seamframework.gmail.com)How to reRender the dataTable when there is only one page.
I tried to reRender the datatable using <a:support event="onsubmit"/>. But it is not working.
Can u suggest me the solution. -
5. Re: Creating editable rich:dataTable with rich:datascroller
aogier.netangel+seamframework.gmail.com May 15, 2009 10:53 AM (in response to aogier.netangel+seamframework.gmail.com)I don't really understand your question... It's AJAX so there is always the same page displayed and updated with user actions...
-
6. Re: Creating editable rich:dataTable with rich:datascroller
aogier.netangel+seamframework.gmail.com May 15, 2009 10:59 AM (in response to aogier.netangel+seamframework.gmail.com)Be carefull with that solution.
I've encountered a problem when I created rich:toolTip with mode='ajax' on an image in one of my columns : the content was computed which, in my case, was stressing the database, and slowing all the page.
The solution I've found is to delete the famous <a:support event="onpagechange"/> on the rich:datascroller and pass all the h:inputText in AJAX submition on change :
<h:inputText value="product.comment"> <a:support event="onchange"/> </h:inputText>
-
7. Re: Creating editable rich:dataTable with rich:datascroller
raghu_dev2005 May 15, 2009 12:40 PM (in response to aogier.netangel+seamframework.gmail.com)Inside the datatable, rich:comboBox and a h:inputText are there.The user can edit and should be able save the changes.I used the code u posted above for reRender the DataList.
<rich:dataTable value="#{effortPlanHandler.effortPlanModel.searchResult}" var="result" id="searchList" rows="15">
.........
<rich:column>
<rich:comboBox value="#{result.previousStatus}" defaultLabel="--Select--" >
<f:selectItem itemValue="Approved" itemLabel="Approved"/>
<f:selectItem itemValue="InProgress" itemLabel="InProgress"/>
<f:selectItem itemValue="Assigned" itemLabel="Assigned"/>
<f:selectItem itemLabel="Completed" itemValue="Completed"/>
</rich:comboBox>
</rich:column>
<rich:column>
<h:inputText value="#{result.previousEffort}" ></h:inputText>
</rich:column>
.............
<f:facet name="footer">
<rich:datascroller reRender="searchList" limitToList="true">
<a4j:support event="onpagechange" /> </rich:datascroller>
</f:facet>
</rich:datatable>
This code works fine when the number of pages is more than one and the user switches to other pages. The problem i m facing is when the number of pages is 1. I tried with <a4j:support event="onsubmit"/> inside the datascroller to reRender the dataList when the user submits the form. But it doesn't work...Can u please give me the solution...
-
8. Re: Creating editable rich:dataTable with rich:datascroller
aogier.netangel+seamframework.gmail.com May 15, 2009 12:49 PM (in response to aogier.netangel+seamframework.gmail.com)I found that it's finally better to use my second solution than my first one, I mean, the <a:support event="onchange" ajaxSingle="true"/> inside each inputs of the list, than the <a:support event="onpagechange"/> inside the rich:datascroller.
So for you, I would remove the <a:support event="onpagechange"/> from the rich:datascroller and add <a:support event="onchange" ajaxSingle="true"/> inside your h:inputText and rich:comboBox.
Example :
<h:inputText value="#{result.previousEffort}"> <a:support event="onchange" ajaxSingle="true"/> </h:inputText>
-
9. Re: Creating editable rich:dataTable with rich:datascroller
raghu_dev2005 May 15, 2009 1:42 PM (in response to aogier.netangel+seamframework.gmail.com)I tried the one u suggested above.But it is not working. We have given in the code that when a change happens we need support "<a:support event="onchange" ajaxSingle="true"/>", at the same time we need to update the List according to the change. How to do that? -
10. Re: Creating editable rich:dataTable with rich:datascroller
aogier.netangel+seamframework.gmail.com May 15, 2009 2:12 PM (in response to aogier.netangel+seamframework.gmail.com)Just add a reRender="id_of_the_list" in the a:support...
-
11. Re: Creating editable rich:dataTable with rich:datascroller
raghu_dev2005 May 15, 2009 3:34 PM (in response to aogier.netangel+seamframework.gmail.com)Thanks for u r spontaneous reply. But this time also it didn't work :-)
<rich:column>
<rich:comboBox value="#{result.previousStatus}" defaultLabel="--Select--" >
<f:selectItem itemValue="Approved" itemLabel="Approved"/>
<f:selectItem itemValue="InProgress" itemLabel="InProgress"/>
<f:selectItem itemValue="Assigned" itemLabel="Assigned"/>
<f:selectItem itemLabel="Completed" itemValue="Completed"/>
<a4j:support event="onchange" ajaxSingle="true" reRender="searchList"></a4j:support>
</rich:comboBox>
</rich:column>
<rich:column>
<h:inputText value="#{result.previousEffort}" ><a4j:support event="onchange" ajaxSingle="true"></a4j:support></h:inputText>
</rich:column>
<rich:column> -
12. Re: Creating editable rich:dataTable with rich:datascroller
raghu_dev2005 May 19, 2009 8:48 AM (in response to aogier.netangel+seamframework.gmail.com)Finally i got the solution for my problem....reRender works when the event is specified as 'onselect' for rich:comboBox.
<rich:comboBox value="#{result.previousStatus}" defaultLabel="--Select--" >
<f:selectItem itemValue="Approved" itemLabel="Approved"/>
<f:selectItem itemValue="InProgress" itemLabel="InProgress"/>
<f:selectItem itemValue="Assigned" itemLabel="Assigned"/>
<f:selectItem itemLabel="Completed" itemValue="Completed"/>
<a4j:support event="onselect" ajaxSingle="true" reRender="searchList"></a4j:support>
</rich:comboBox>
Thanks for your continuous replies. -
13. Re: Creating editable rich:dataTable with rich:datascroller
sburgula1 Feb 4, 2010 9:38 PM (in response to aogier.netangel+seamframework.gmail.com)Thank you. This helped me a lot. I followed the a4j:support tag syntax mentioned here and it works. the paging and the selection of table rows.