DataScroller with dataTable

Hi
I have a dataScroller to display rows with a select component. The problem I am facing is the datascroller is not binding the selection. My backing bean has no binding for the select component as there could be hundreds of them. Could someone please suggest a way to resolve this?
Thanks
Murthy
Backing bean
package com.xxx.application.login.utils.helpers;
import java.util.*;
import javax.faces.context.FacesContext;
import com.xxx.application.login.utils.helpers.GroupPermissionsHelper;
public class GroupPermissionsBean {
     int noOfPermissions=0;
public GroupPermissionsBean() {
     System.out.println("In group permissions bean constructor");
public List getGroupsList() {
          System.out.println("in group permissions bean get options");
          List options=new ArrayList();
          Map m=  FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
          String pickOpts=(String)m.get("picklist");
          System.out.println(" picklist=" + pickOpts);
          if (pickOpts != null) {
               String [] opts_arr = pickOpts.split(",");
               for(int i=0; i < opts_arr.length; i++) {
                    opts_arr=opts_arr[i].trim();
                    if (opts_arr[i].equals("")) continue;
                    String pid="";
                    if (opts_arr[i].indexOf("(") > -1) {
                         pid=opts_arr[i].substring(0, opts_arr[i].indexOf("("));
                    GroupPermissionsHelper gph=new GroupPermissionsHelper(opts_arr[i], pid);
                    options.add(gph);
                    System.out.println("added option=" + opts_arr[i]);
          noOfPermissions=options.size();
          System.out.println("*********nof permissons=" + noOfPermissions);
          return options;
public int getNoOfPermissions() {
          return noOfPermissions;
public List getSomeList() {
     List options=new ArrayList();
     options.add("a");
     options.add("b");
     options.add("c");
     noOfPermissions=options.size();
     return options;
}//class
Data table component
<h:dataTable value="#{groupPermissionsBean.groupsList}" var="group" bgcolor="#D8EFE0" width="100%"   id="permissionsTable"
headerClass="dataTableHeader" rowClasses="dataTableRowWhite, dataTableRowAdbeda"
columnClasses="captionColumn, valueColumn" rows="2" >
        <h:column>
     <f:facet name="header">
     <h:outputText value="Groups"/>
     </f:facet>
                 <h:outputText value="#{group.partID} " style="font-family: Ariel, Helvetica, sans-serif;font-size: 9pt;"  />
       </h:column>
         <h:column>
     <f:facet name="header">
     <h:outputText value="Permissions"/>
     </f:facet>
                 <h:selectOneMenu id="permselect" title="Select any one in this menu"  >
     <f:selectItem itemLabel="SELECT" itemValue="" />
        <f:selectItem itemLabel="ADMIN" itemValue="ALL:#{group.fullID}" />
     <f:selectItem  itemLabel="VIEW" itemValue="VIEW:#{group.fullID}"  />
     <f:selectItem itemLabel="NONE" itemValue="NONE:#{group.fullID}" />
        </h:selectOneMenu>
          </h:column>
  </h:dataTable>
Scroller code
<t:dataScroller id="dataScroller"
                    for="permissionsTable"
                    pageCountVar="pageCount"
                    pageIndexVar="pageIndex"
                    styleClass="tblHeaders"
                    paginator="true"
                    paginatorMaxPages="10"
                    paginatorTableClass="tblContent"
                    paginatorActiveColumnStyle="font-weight:bold;"
                 rendered = "#{groupPermissionsBean.noOfPermissions > 2}"
               >
                      <f:facet name="previous">
                 <h:graphicImage url="#{bundle.PaginatorPrevImg}" rendered="#{pageIndex != 1}" style="border-color: transparent; border: 0;"   />
                 </f:facet>
                  <f:facet name="next">
                  <h:graphicImage url="#{bundle.PaginatorNextImg}" rendered="#{pageIndex < pageCount}" style="border-color: transparent; border: 0;"   />
                  </f:facet>
</t:dataScroller>

To add some info: The dataTable component generates rows with some text and a select component. I have a submit button that
calls an action method.
What's happening now is...the rows appear alright. But each set of rows takes a round trip to the Jboss server. As a result,
when the submit button is clicked, only the rows in the view are submitted.
Without the scroller, I'd have all the rows in one page and the validation is done with Javascript.
With the scroller in place, the rows are displayed correctly, the selection of the selection component is done right, but
only the rows in the current page are validated.
I'd appreciate your help
Thanks
Murthy

Similar Messages

  • Populating a javascript array with datatable data

    I want to populate a javascript array with datatable data.
    How do I do this?
    I want the javascript array to be populated as the datatable is displayed.
    Doing this way doesn't work.
    <h:dataTable value="#{pmManager.profiles}" var="pmProfile" binding="#{pmManagerUiBean.uiTable}" ">
    <script>
    allProfilenames[index]='#{pmProfile.profileName}';
              alert("index ="+index);
              alert("...1"+allProfilenames[0]);
              alert("...2"+allProfileRes[0]);
              index++;
    </script>
    <h:dataTable>

    In Javascript do something like this:
    document.getElementById('form1:dec_param');
    where form1:dec_param is the id of the component on the page source (html)

  • Matrix with DataTable - GetLineData and SetLineData B1 8.8 Bug

    Hi experts,
    I have a matrix bounded to a DataTable and I succefully load the matrix with:
    DataTable dt = form.DataSources.DataTables.Item("matDT");
    dt.ExecuteQuery(sql);
    Matrix mat = form.Items.Item("mat").Specific as Matrix;
    mat.LoadFromDataSource();
    mat.AutoResizeColumns();
    Now in Event et_VALIDATE(after), i would like to change some not editable column of the matrix
    [B1Listener(BoEventTypes.et_VALIDATE, false)]
    public virtual void OnAfterValidate(ItemEvent pVal) {
              if(pVal.ItemUID!="mat")
                    return;
              Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
              Matrix mat = form.Items.Item("mat").Specific as Matrix;
              DataTable dt = form.DataSources.DataTables.Item("matDT");
              //Pont 1)
              mat.GetLineData(pVal.Row)     
              //Point 2
              //Change Values
              int minutes = dt.GetValue("U_Minutes", pVal.Row-1);
              dt.SetValue("U_Hours",pVal.Row-1, (double) minutes / 60);
              //Point 3
              mat.SetLineData(pVal.Row);
    Now I will expain the problem:
    For simplicity assume the matrix has 2 rows after load. After the user edit a column, validate event fires and:
    -) After the call of GetLineData  in Point 1) I verified that all DataTable Rows are identical (derived from the first row in the matrix)
    -) If I substitute GetLineData   in point 1) with FlushToDataSource, DataTable became corret but after the call of SetLineData in point 3) all the matrix rows are identical (derived from the first DataTable row).
    -) If I also substitute SetLineData   in point 3) with LoadFromDataSource, all works fine but i loose focus and performances
    Is it a B1 8.8 Bug?

    Yes, but sap said that my  customer is not officially approved.
    the following is the original text.
    Please note that SAP Business One Release 8.8 has only been released for
    Ramp-Up. Because of this, only approved projects for productive usage a
    re fully supported by SAP Business One Support. However feedback on prod
    uct quality or bugs reporting from all partners - even from partners who
    are not part of the Ramp-Up - is welcome and highly appreciated.
    According to the information we have, your customer is not officially ap
    proved for Ramp-Up yet. Due to the difficulty to estimate the number of
    messages that will be submitted, SAP cannot commit itself to solving all
    issues reported about projects not officially approved for Ramp-Up, nor
    guarantee any response times.
    Kind regards,
    SAP Business One Support

  • Problems with datatable and scroller

    I wonder, if this behavior is a mistake of mine or a bug in the myfaces implementation.
    sitution
    I have datatable and datascroller component. The table gets the data from bean which is in request scope. The table is dynamic. Each time we hit the page, we can expect a different resultset/rowcount for the table.
    problem
    When I change the page of datascroller and come back a second time with a rowcount, that is to small to reach that page, I get a empty table. Expected result, would be a page, that shows at least last elements of the resultset.
    You can see the mistake, by refreshing the page datascroller.jsp a couple of times, change the page in the scroller and refresh again a couple of times.
    You will get results like this:
    15 hits, hits 81 - 15. page 9 / 2
    23 hits, hits 41 - 23. page 5 / 3
    5 hits, hits 21 - 5. page 3 / 1
    Testcase
    datascroller.jsp
    This is almost like the openDatatable example.
    <%@include file="/inc/importPageParams.inc" %>
    <%@include file="/inc/importTaglibs.inc" %>
    <html>
    <%@include file="/inc/head.inc" %>
    <body>
    <f:view>
        <f:loadBundle basename="com.ebsecure.archiv.web.resource.messages.messages" var="messages"/>
    <x:panelLayout id="page" layout="#{globalOptions.pageLayout}"
                styleClass="pageLayout"
                headerClass="pageHeader"
                navigationClass="pageNavigation"
                bodyClass="pageBody"
                footerClass="pageFooter" >
              <f:facet name="body">     
        <h:panelGroup id="body">
              <h:form name="hitlistProcessionForm" styleClass="standardTable">
                             <x:dataTable       id="data"                                              
                                             styleClass="scrollerTable"
                                             headerClass="standardTable_Header"
                                             footerClass="standardTable_Header"
                                             rowClasses="standardTable_Row1,standardTable_Row2"
                                             columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
                                        var="car"
                                        value="#{scrollerList.data}"                                     
                                        preserveDataModel="true"
                                        rows="10">
              <x:columns value="#{scrollerList.columnHeaders}" var="columnHeader">
                <f:facet name="header">
                    <x:commandSortHeader columnName="#{columnHeader}" arrow="false">
                        <f:facet name="ascending">
                            <h:graphicImage value="images/ascending-arrow.gif" rendered="true" border="0"/>
                        </f:facet>
                        <f:facet name="descending">
                            <h:graphicImage value="images/descending-arrow.gif" rendered="true" border="0"/>
                        </f:facet>
                        <h:outputText value="#{columnHeader}" />
                    </x:commandSortHeader>
                </f:facet>
                <!-- row is also available -->
                <h:outputText value="#{scrollerList.columnValue}" />
            </x:columns>
                </x:dataTable>
            <h:panelGrid columns="1" styleClass="scrollerTable2" columnClasses="standardTable_ColumnCentered" >
                <x:dataScroller id="scroll_1"
                        for="data"
                        fastStep="10"
                        pageCountVar="pageCount"
                        pageIndexVar="pageIndex"
                        styleClass="scroller"
                        paginator="true"
                        paginatorMaxPages="9"
                        paginatorTableClass="paginator"
                        paginatorActiveColumnStyle="font-weight:bold;"
                        >
                    <f:facet name="first" >
                        <h:graphicImage url="images/arrow-first.gif" border="1" />
                    </f:facet>
                    <f:facet name="last">
                        <h:graphicImage url="images/arrow-last.gif" border="1" />
                    </f:facet>
                    <f:facet name="previous">
                        <h:graphicImage url="images/arrow-previous.gif" border="1" />
                    </f:facet>
                    <f:facet name="next">
                        <h:graphicImage url="images/arrow-next.gif" border="1" />
                    </f:facet>
                    <f:facet name="fastforward">
                        <h:graphicImage url="images/arrow-ff.gif" border="1" />
                    </f:facet>
                    <f:facet name="fastrewind">
                        <h:graphicImage url="images/arrow-fr.gif" border="1" />
                    </f:facet>
                </x:dataScroller>   
                   <x:dataScroller id="scroll_2"
                                for="data"
                                rowsCountVar="rowsCount"
                                displayedRowsCountVar="displayedRowsCountVar"
                                firstRowIndexVar="firstRowIndex"
                                lastRowIndexVar="lastRowIndex"
                                pageCountVar="pageCount"
                                pageIndexVar="pageIndex"
                               >
                            <h:outputFormat value="{0} hits, hits  {2} - {3}. page {4} / {5}
                            " styleClass="standard" >
                                <f:param name="myRowsCount" value="#{rowsCount}" />
                                <f:param name="myDisplayedRowsCountVar" value="#{displayedRowsCountVar}" />
                                <f:param name="myFirstRowIndex" value="#{firstRowIndex}" />
                                <f:param name="myLastRowIndex" value="#{lastRowIndex}" />
                                <f:param name="myPageIndex" value="#{pageIndex}" />
                                <f:param name="myPageCount" value="#{pageCount}" />
                            </h:outputFormat>
                        </x:dataScroller>       
            </h:panelGrid>
              </h:form>
        </h:panelGroup>
         </f:facet>
         </x:panelLayout>
    </f:view>
    </body>
    </html>
    snippet of faces-config.xml
    <managed-bean>
            <managed-bean-name>scrollerList</managed-bean-name>
            <managed-bean-class>my.tests.DatatableTestBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
    and the bean
    package my.tests;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import org.apache.log4j.Logger;
    public class DatatableTestBean {
        private DataModel data;
        private DataModel columnHeaders;
        Logger logger;
        public DatatableTestBean() {
            List headerList = new ArrayList();
            headerList.add("Index");
            headerList.add("Type");
            headerList.add("Model");
            columnHeaders = new ListDataModel(headerList);
            List rowList = new ArrayList();
            for (int i = 0; i <= (double) ((double) Math.random() * (double) 1000); i++) {
                List colList = new ArrayList();
                colList.add(new Integer(i));
                colList.add("Car Type " + i);
                colList.add(i % 2 != 0 ? "green" : "blue");
                rowList.add(colList);
            data = new ListDataModel(rowList);
        public DataModel getData() {
            return data;
        public DataModel getColumnHeaders() {
            return columnHeaders;
        public Object getColumnValue() {
            Object columnValue = null;
            if (data.isRowAvailable() && columnHeaders.isRowAvailable())
                columnValue = ((List) data.getRowData()).get(columnHeaders.getRowIndex());
            return columnValue;
    }Does anyone know, if I'm totally wrong or can see the mistake I or the implementation do. Does anyone has any suggestions, how to get always a right result?
    Any help is very appreciated.
    thanks, Stephan

    the datascroller is based on the first attribute of the datatable to calculate the index.
    try to set the first attribute to '1' in your jsp. The goal is to reset this value when your data have changed.

  • Need advice for dispalying multiple rows with datatable.

    Hi All,
    We have to design a conference booking search form which contains nX48 table.
    n -> indicates the conference rooms and 48 are the time slots(30 mins gap).
    While booking a conference room user enteres from time and to-time and from and to dates.
    In our search form, user searches with in the range of dates and times.
    We give a option for user to view according to date wise or room wise.
    Now main prblm is that we are capturing from and to times but how do we represent in data table.
    out of 48 columns assume only 4 slots are booked i.e 1200 hrs to 1400 hrs. so we need to display an image in that columns and up on clicking on that cell we have to produce data regarding that booking.
    In our pojo we have to and from time variables , but how can we display in datatable..should have to take a 48 column pojo.., if so how can I get the data at intersection point?
    Please do help me...
    Regards,
    Kranthi Kiran

    You could certainily create a 48 or 96 column grid. I would assume a simple "bar" image would go into that grid. You can create a method that gets called to determine if the image is rendered or not. Use a stylesheet (inline style) to set the width of the grid.
    While making a table with 48 column definitions is somewhat messy it is certainly no harder than cut and paste. The messy part is how to implement the boolean getter (DI) call to determine if a cell image is rendered as this would require 48 or 96 unique method definitions (one for each time slot). If you are will to do this then the solution is straight forward with a table.
    As for clicking on the image cell that is not an issue and easily handled.
    You have not mentioned what component suite you want to use. May I recommend that you take a look at Apache Trinidad (MyFaces project) or Oracle's ADF offering.
    If not you could do this with two tag iterators (e.g. tr:iterator) but fussing with trying to make sure you get cell alignment might be hard to do since you would not have a "master" grid in which you would be rendering your data.
    Could also write your own component ... but suspect you don't want to go there.
    You will find that they provide a robust table implementation that also supports the concept of "details", sort of a drill down capability that you can add to see additional information associated with a summary line in a table.

  • Command Link with Datatable doesnt work

    I had read the previosu posts stating that commandLink with the datatable will be corrected with the new version of Jsf- 1_1_01 .I installed the new version and the commandLink doesnt work inside a datatable still

    try initialising the List attached to the dataTable
    in the constructor or use an outputLink
    -DevioutputLink is similar to <href in jsp.It cannot implement the actionListener and action parameters which a commandLink does. Using a constructor for initializing is fine but when i want it to implement certain method then it creates a problem.

  • Proble with datatable ... ExecuteQuery

    Hi all,
    I have a matrix with 2 column for example DocNum and DocDate.
    I fill matrix with a DataTable datasource
    the first executequery return me a correct format of date
    102 | 22.08.2006
    103 | 23.08.2006
    when i try to refill the matrix with another call of ExecuteQuery ... the format in a matrix change like this..
    102 | 20060822
    103 | 20060823
    Thanks a lot

    Hey Dimitri
    In Matrix (or any other items), the way data is displayed is determined by the binded data source
    for dates:
    datasource value is 20060822
    and displayed value should be 22.08.2006
    Maybe your binding to the fields is lost when doing the second executequery
    regards
    Emmanuel

  • Ajax with Datatable

    I have a requirement of showing the data table rows dynamically.
    Please help me how it can be achieved using the Ajax technology.

    Hi Balus i did try but not working for me, i am explaining here it what I am doing
    I have action class ShoppingProcessor like this@Begin
         public String loadNewPage()
            do something
    public String processShopDetail()
            do something
    @End
    public String exitShop()
    }and on page request loadNewPage() is called which populates page first time then page is rendered
    Now in page i have proceed button as<a4j:commandButton value="Proceed" action="#{shoppingProcessor.processShopDetail()}" reRender="shopTable" />but when i try proceed button it goes to loadNewPage() again and displays refreshed page instead i want only to get updated dataTable.
    Thanks
    Chhaya

  • Do request scoped beans work with dataTable??

    I have a datatable to display values from a managed bean. For each item, I display a command link allowing the user to "drill down" on the item for more information.
    I only need the list in the managed bean for this one request so I'd like to place it in request scope. When I do so, the command link does not work (when I select the link the current page is redisplayed and the action method I specify is never called). I also tried specifying an action listener, but that does not get called either.
    If I have the bean in session scope, everything works fine.
    Does anyone know if using a dataTable requires that the associated ban value be in session scope? If so, can you explain why?
    Thanks!

    By the way, I have an hypothesis why this does not work...
    The datatable values MUST be specified using a value binding expression. When the restoreState method for the component is called, JSF attempts to use the VB expression to get the table values. When the managed bean is not found, it creates a new (empty) one and the world ends (actually it just returns back to the original page because it cannot figure out what to do)

  • 9.0.3 JSP DataScroller Error (Not a Missing DataHandler)

    I generate the Browse Page/Form for DepartmentsView1. It includes a DataHandler, DataScroller, and DataTable (with the AM and DS tags) as appropriate. I can run this successfully with Netscape 4.77, IE 5.5, IE 6.0.26.
    However a colleague runs this in IE 6.0.26 and the DataScroller does strange things; for example, upon opening the JSP, the Next link does not do anything; selecting records 13-15 works, but Next takes you back to records 1-3 not 10-12. Previous returns a Null exception. On the same machine, this JSP page works fine with Netscape 7, so it seems to be something with IE on that machine. All security and advanced options are set at the default.
    Any ideas out there?
    9.0.3 (build 1008 and 988 and before)

    It is not just the wizard-generated JSP page. This also happens if I drop the components into a new JSP Page.

  • Values from columns of datatable...

    Hi guys,
    i'm working with my jsf application to create a datatable.
    It works well,but now i've added a commandlink button to dynamically adding a new column(i use this datatable for input data,each row is an experiment).
    It works fine,column is correctly added.
    At the end of each row of my datatable i've a submit button to send values of the row into db.
    My question is:
    My datatable has 5 fixed fields and other dinamic fields that user can add with button. My 5 fixed values have to go into a table(and it works) and i want that dynamic values(that use has added) go into another table,each one as a different row.
    Example
    usa italy french england japan rome tokyo
    i want usa italy french englan japan go into a table(as a row) and rome tokio goes into another table
    rome
    tokio(different rows).
    How can i do it?
    My problem is i'm not able to binding the dynamic input fields to bean....can you help me?
    Here is my class
    public class BiosamplesTable {
         private List biosamples= new ArrayList();
         private HtmlDataTable biosampleDataTable;
    private int autokey2;
         private Biosample biosampleItem;
         private int nrows;
         private DataModel mColumns;
         private int load=0;
         private String columnLabel;
         public HtmlDataTable getBiosampleDataTable()  {
              return biosampleDataTable;
         public void setBiosampleDataTable(HtmlDataTable biosampleDataTable) {
              this.biosampleDataTable = biosampleDataTable;
         public Biosample getBiosampleItem() {
              return biosampleItem;
         public void setBiosampleItem(Biosample biosampleItem) {
              this.biosampleItem = biosampleItem;
         public List getBiosamples() throws Exception {
              loadBiosamples();
              // Reload after every request.
              return biosamples;
         public void setBiosamples(List biosamples) {
              this.biosamples = biosamples;
         public void loadBiosamples() throws Exception {
              if (load==0){
              for (int i = 0; i < nrows; i++) {
                   Biosample biosample = new Biosample();
                   biosamples.add(biosample);
                   setBiosamples(biosamples);
                   load=1;
              else
                   setBiosamples(biosamples);
         public int getNrows() {
              return nrows;
         public void setNrows(int nrows) {
              this.nrows = nrows;
         public DataModel getColumnDataModel()
             if (mColumns == null)
               String[] result = new String[]{};//sono le colonne di partenza,in questo caso 1!!!
               mColumns = new ListDataModel(new ArrayList(Arrays.asList(result)));
             return mColumns;
         public void addColumn(ActionEvent e)
             if(columnLabel!=null);//metter l'if
               List columns = (List) getColumnDataModel().getWrappedData();
               columns.add(columnLabel);
         public String getColumnLabel(){
              return columnLabel;
         public void setColumnLabel(String columnLabel){
              this.columnLabel=columnLabel;
    }and this is my jsp page
    <t:dataTable
        value="#{biosamplesTable.biosamples}"
        var="biosampleItem"
         binding="#{biosamplesTable.biosampleDataTable}" border="3" bgcolor="pink" >
        <h:column >
            <f:facet name="header">
                <h:outputText value="Organism"/>
            </f:facet>
           <h:selectOneMenu value="#{biosampleItem.organism}">
                <f:selectItems value="#{biosample.selectOrganism}"/>
           </h:selectOneMenu>
        </h:column>
        <h:column>
            <f:facet name="header">
                <h:outputText value="Treatment Protocol" />
            </f:facet>
            <h:inputText value="#{biosampleItem.treatmentProtocol}" />
        </h:column>
        <h:column >
            <f:facet name="header">
                <h:outputText value="Extraction Method" />
            </f:facet>
            <h:inputText value="#{biosampleItem.extractionMethod}" />
        </h:column>
        <h:column >
            <f:facet name="header">
                <h:outputText value="Label"/>
                </f:facet>
            <h:inputText value="#{biosampleItem.label}" />
        </h:column>
        <h:column>
            <f:facet name="header">
                <h:outputText value="Hybridation" /></f:facet>
            <h:inputText value="#{biosampleItem.hybridation}" />
        </h:column>
        <h:column>
            <f:facet name="header">
                <h:outputText value="Amplification" /></f:facet>
            <h:inputText value="#{biosampleItem.amplification}" />
        </h:column>
        <t:columns value="#{biosamplesTable.columnDataModel}" var="column"  >
         <f:facet name="header">
        <h:panelGroup>
        <h:outputText value="#{column}" />
        <h:commandLink actionListener="#{biosamplesTable.removeColumn}">
        <h:outputText value="Elimina"/>
        </h:commandLink>
        </h:panelGroup>
        </f:facet>
             <h:inputText value="#{biosampleProperties.value}" />
        </t:columns>
        <h:column>
            <f:facet name="header">
                <h:outputText value="Actions" />
            </f:facet>
            <h:commandLink
            value="Invia dati biosample" actionListener="#{biosamplesTable.editBiosample}" id="editBiosample">
            </h:commandLink>
        </h:column>
        </t:dataTable>     i want the values of each added column goes as different row into a biosampleProperties table....
    Thanks..

    u can't achieve this with DataTable u need tu use JSTL ...exactly the
    C-Tag
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

  • Datatable wackiness - JSF trying to read a non-existant field from a bean

    I am having a very strange problem in JSF. I currently have one links page with four commandLinks in it, and one JSF page witha datatable in it, and an IBM <hx:pagerDeluxe> in it to page through the data. Each command link fires off a different action, as shown below:
         <h:commandLink action="UM02">
              <h:outputText value="UM02" />
         </h:commandLink>
         <h:commandLink action="UM03">
              <h:outputText value="UM03" />
         </h:commandLink>          ..........etc ........
    My Navigation rules all point to one JSP file, but with a different param appended to the URL:
              <from-view-id>/index.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>UM02</from-outcome>
                   <to-view-id>/jsp/mappings/listViewUM02.jsp?tbl=UPD_MAP_UM02</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>UM03</from-outcome>
                   <to-view-id>/jsp/mappings/listViewUM02.jsp?tbl=UPD_MAP_UM03</to-view-id>
              </navigation-case>     So as you can see, I have one JSF file to display a list from any given table name. I also dynamically populate the dataTable through my code, by reading through a list of columns for each table, and creating a "UIColumn":
              while( itr.hasNext() ){
                   String fieldName = (String) itr.next();                                                  
                   ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{var." + fieldName + "}");
                   HtmlOutputText header = new HtmlOutputText();               
                   header.setValue(fieldName);               
                   UIColumn col = new UIColumn();
                   UIOutput out = new UIOutput();
                   out.setValueBinding("value", vb);
                   col.setHeader( header );
                   col.getChildren().add(out);               
                   dataTable.getChildren().add(col);               
              }          And that dataTable is shown in the JSF page. So i can go back to the main links page, click on another table name, and it will populate the datatable with the correct columns, data, etc. The problem happens when I go to one table, say UM02, and hit ">" on the pager, to go to the next page, which works, THEN i go back to the links page, and hit "UM03" and the first page displays fine. When I try to go to the next page, I get an error saying that the backing bean UM03Bean does not have field "subProductCd". Basically, values from the old dataTable objects are being used for smoe reason when I page. Not sure why this is happening.
    My datatable is defined like this:
         <h:form id="dataTableForm"><h:dataTable id="dataTable1" border="0" cellpadding="2"
              cellspacing="0" columnClasses="columnClass1"
              headerClass="headerClass" footerClass="footerClass"
              rowClasses="rowClass1, rowClass2, rowClass3"
              styleClass="dataTableEx" width="70%" rows="10"
              value="#{TestAction.list}" var="var"
              binding="#{TestAction.listDataTableUI}">
              <f:facet name="footer">
                   <hx:panelBox styleClass="panelBox" id="pagerbox">
                        <hx:pagerDeluxe styleClass="pagerDeluxe" id="deluxe1" for="dataTable1"/>                              
                        <h:commandLink action="home">
                             <h:outputText value="Back Home"></h:outputText>
                        </h:commandLink>
                   </hx:panelBox>     
              </f:facet>
         </h:dataTable>
         </h:form>

    BalusC wrote:
    It is comparing the selected value against the List<SelectItem> returned by getSetoresOrigem() as it is during the apply request values phase of the form submit request.Ok. That's what I supposed JSF was doing.
    BalusC wrote:
    If the selected value isn't in there, then you will get this error.I can understand this, but is this right? As I said, the old value isn't really there because I changed the list values to new ones. But the new value (the value of fSetorOrigem ) corresponds to a value that exist in the new list items, so a valid value. So JSF is not considering that I also changed the list, not just the value. It is comparing the new value with the old list, not the new one. Acting like this JSF is making the page looks like a static HTML page, not a dynamic one. If I can't change the list and the value, what's the point of that? In my point of view I'm not doing anything wrong, I'm not violating any JSF rules.
    Marcos

  • Command Link as a row of a datatable in JSF

    Hi All,
    I am new to JSF. I have a Datatable with n number of rows.
    I would like to have a command Link in each of the rows, so that when i click the command link i should get the data of the entire row in my edit page.
    Can anyone suggest how can i achieve this.
    Regards
    SN

    Hi,
    Do following:
    1- add a datatable in your page and fill it with data comes from database(Assume u have no problem with datatable)
    2- add a column as commandLink in data table. e.g.
    <h:column>
    <f:facet name="header">
    <h:outputText value="name" />
    </f:facet>
    <t:commandLink action="editObject" immediate="true" >
    <h:outputText value="#{theobject.name}" />
    <t:updateActionListener property="#{objectForm.id}" value="#{objectDto.id}" />
    </t:commandLink>
    </h:column>
    in this code:
    "name" is header of column,
    "editObject" is defined in navigation rule to navigate to edit page, lets say object form.
    "theobject.name" the value that mouse gets finger over it!
    "objectForm.id" the pointer to an "id setter" of a managed bean (named objectForm) defined in faces-config.xml. In this setter you can load corresponding data from database
    "objectDto.id" the pointer to an "id getter" of a managed bean (named objectDto) defined in faces-config.xml. this getter return the id of the entity row you clicked on.
    3- Clearly, you need to defined all managed beans, and dont forget to have a customized setter for id of objectForm (setId) to load the entity from database and fill all editable properties(as you like) in this function (setId).
    4- you need a JSF page to redirect to it for editing properties and feed by objectForm
    5- Thats it :)

  • Ice:dataTable binding

    Hi
    I have got problem with dataTable. If I add binding attribute (binding="#{moodContainer.htmlDataTable}") to my view the table isn't displayed.
    import com.icesoft.faces.component.ext.HtmlDataTable;
    public class MoodContainer {
    private HtmlDataTable htmlDataTable;
    private int myRowIndex;     
    private List<MoodVO> moodContainer = new ArrayList<MoodVO>();
         moodContainer.add(new MoodVO(1,"01.04.2009", Grade.TWO, Weather.SUNNY, true, true, false, true, true, "1234"));
         moodContainer.add(new MoodVO(1,"01.04.2009", Grade.TWO, Weather.SUNNY, true, true, false, true, true, "1234"));
         moodContainer.add(new MoodVO(1,"01.04.2009", Grade.TWO,
         public List<MoodVO> getMoodContainer() {
              return moodContainer;
             public int getMyRowIndex() {
             return htmlDataTable.getRowIndex();
             public void setMyRowIndex(int myRowIndex) {
             this.myRowIndex = myRowIndex;
         public HtmlDataTable getHtmlDataTable() {
              return htmlDataTable;
         public void setHtmlDataTable(HtmlDataTable htmlDataTable) {
              this.htmlDataTable = htmlDataTable;
         }I also tried to use UIData instead of HtmlDataTable but it doesn't work for me.
    Do you know what I am doing wrong?
    Thanks in advance
    Mariusz
    P.S. I am using facelets and ICEfaces 1.8.0
    Edited by: syllepsa on Jun 24, 2009 11:49 PM
    Edited by: syllepsa on Jun 24, 2009 11:50 PM

    Hi syllepsa,
    Your coding part not display array list data assigning to htmlDataTable . Only creating moodContainer array list.
    kush

  • Date format in Matrix loaded by DataTable is shown as 20080319

    Hello,
    I've loaded most of our matrixes with DataTables. No problems up to now. Also date columns where shown in correct B1 GUI format.
    But now with a new matrix the date is 'suddenly' shown as '20080319'. When I view at B1 system information (at the bottom of B1) the column is described correctly with B1 GUI format:
    U_DateEndPr (Date)
    19.03.2008 [Form....Item..., U_DatEndPr]
    I've made a test (one of many):
    I've loaded the 'problem-matrix' with some columns (including one date column) from another DataTable which works correctly on another Matrix/Pane.
    The result is the same:
    In the first (correct working) matrix (pane 1) the date is 19.03.2008 and
    in the second matrix 20080319
    Is there something wrong with the matrix itself?
    I have absolutly no idea where my fault is.
    Does anybody made the same or similar experiences?
    So long,
    Roland

    Hello Petr,
    for the test which I've made i can say yes: I've loaded the problem-DataTable with the same query as the working dataTable.
    The only difference is:
    The problem-matrix has less columns than the working matrix. So I couldn't bound the problem.-DataTable/Matrix to all of the query result columns.
    Another hint:
    The Date format '20080319' looks like the result of SDK-ValueEx (B1-DB-Format-String)
    In another column beside '20080319' there's a double-value. This is shown with the correct decimal-separator of B1 (I've changed decimal sep. to '#' for test. The columns ar shown as:
    '20080319'  |  142#89
    ...so the second column is displayed correctly but the date format is still wrong...
    And:
    I get the same result when I do the problem-DataTable bind to exactly the same dataTable-UID as of the working DataTable.
    So at the moment I suppose that the error is in the Matrix-Object. Because both matrixes are loaded by the same DataTable (for trial) and only one of them shows wrong date-format.
    I forgot:
    The form with the problem-matrix was made with a 2 years old screenpainter. Althogh I've made changes on the form with a actual screenpainter - could this be a problem?
    Hmm, but I don't think so because on another pane and matrix of the same old form the date works corectly...
    Edited by: Roland Toschek on Mar 19, 2008 1:07 PM

Maybe you are looking for

  • CS3 JS Dialog Boxes

    Hi all, Does Illy CS3 JS now allow more stuff in Dialox Boxes? Can we now add Radio buttons etc. Can we also add images? Regards Norbert

  • How to save resized photo in the event

    I am having trouble saving my resized photo in my event. When I open an event, choose the photo I want to resize, and use the export feature, I am unable to choose my event as a place to save to. Any suggestions. What I end up doing is saving it some

  • Clarification about linking order

    We have Workshop 5.0 compiler on a 2.6 system. We are trying to create an executable linking a few object files with some static libraries (*.a ) and a few dynamic libraries(*.so). But, one particular function definition, say func1 is available in li

  • IPod Service Will Not Run

    I have an 80GB iPod Classic and when I downloaded iTunes 8, this box popped up saying that "iPodService Module has encountered a problem and needs to close". It does this and it won't let me sync my iPod because my iPod doesn't show up in iTunes or t

  • Bill of Materials style query ( hierarchical query question)

    Hi, I'm having difficulty trying to SQL query for the following. *(1) Outline of proposed table design* SERVERS SERVER_ID SERVER_DESC etc. SERVER-MAJORCOMPONENTS SERVER_ID COMPONENT_ID SERVER-PARTS COMPONENTS_ID PARENT_COMPONENT_ID COMPONENT_DESC etc