1 Reply Latest reply on Mar 25, 2007 5:11 PM by Sergey Smirnov

    a guestion and a tiny bug

    Adrian Iacob Newbie

      bug: the html div does not have the attribute name: in the datascroller first div should not have the name attribute :
      I think that in file htmlDatascroller.jspx there is
      div id="#{clientId}"
      name="#{clientId}" -this should be deleted


      Question: I have created a rich:datascroller and a rich:dataTable from into a h:form, and created several links (h:commandLink) as columns (delete, edit - for that row) There is a listing page and an edit page for a row.

      Problem: at the first page everything works just fine, when you go to the next page all the links stop working. If I press Edit the page is reloaded but I am still on the same page. I don't understand. (It should enter action="#{dataView.createNew}" for example... it doesn't )


      I can give you my project http://www.aditza3x.3x.ro/richfaces/rich_datascroller.zip (there are no jars)
      ajax4jsf, richfaces,jsf jars and facelets should be copied in WEB-INF\lib

      here I have some code listed: my xhtml

      <h:form>
       <rich:datascroller for="dt_generictable" maxPages="20" />
       <h:commandLink value="new Person" action="#{dataView.createNew}" />
       <rich:dataTable id="dt_generictable" var="row"
       value="#{dataView.rows}" rows="2">
       <rich:column>
       <f:facet name="header">
       <h:outputText value="First Name" />
       </f:facet>
       <h:outputText value="#{row.firstName}" />
       </rich:column>
       <rich:column>
       <f:facet name="header">
       <h:outputText value="Last Name" />
       </f:facet>
       <h:outputText value="#{row.lastName}" />
       </rich:column>
       <rich:column>
       <f:facet name="header">
       <h:outputText value="" />
       </f:facet>
       <h:commandLink value="Delete" action="#{dataView.delete}" immediate="true"/>
       </rich:column>
       <rich:column>
       <f:facet name="header">
       <h:outputText value="" />
       </f:facet>
       <h:commandLink value="Edit" action="#{dataView.edit}" immediate="true"/>
       </rich:column>
       </rich:dataTable>
       </h:form>
      


      where dataView is a managed bean (session)


      <managed-bean>
       <managed-bean-name>dataView</managed-bean-name>
       <managed-bean-class>
       ro.datascroller.test.DataEditor
       </managed-bean-class>
       <managed-bean-scope>session</managed-bean-scope>
       </managed-bean>
       <navigation-rule>
       <from-view-id>/DataList.xhtml</from-view-id>
       <navigation-case>
       <from-outcome>create</from-outcome>
       <to-view-id>/DataEdit.xhtml</to-view-id>
       </navigation-case>
       <navigation-case>
       <from-outcome>edit</from-outcome>
       <to-view-id>/DataEdit.xhtml</to-view-id>
       </navigation-case>
       </navigation-rule>
       <navigation-rule>
       <from-view-id>/DataEdit.xhtml</from-view-id>
       <navigation-case>
       <from-outcome>list</from-outcome>
       <to-view-id>/DataList.xhtml</to-view-id>
       </navigation-case>
       </navigation-rule>
      


      private DataModel objModel;
       private String currentAction = "Save";
       List lst;
       public DataEditor() {
       lst = new ArrayList();
       lst.add(new Person("Adrian", "Iacob"));
       lst.add(new Person("Fistname","Lastname"));
       lst.add(new Person("test fistname","test lastname"));
       }
      
      
       public DataModel getRows() {
       objModel = new ListDataModel(lst);
       return objModel;
       }
      
       public String createNew() {
       person = new Person();
       currentAction = "Create";
       return "create";
       }


        • 1. Re: a guestion and a tiny bug
          Sergey Smirnov Master

          1. the issue has been created in Jira for 'name' attribute.

          2. h:commandLink is not designed to be re-rendered without re-rendering the whole form. As soon as datascroller updates only the datatable, this limitation is taken place.

          Try to replace:
          h:form with a4j:form
          h:commandLink with a4j:htmlCommandLink