7 Replies Latest reply on Apr 11, 2007 8:54 PM by liu yida

    rich:dataTable problem

    liu yida Newbie

      I am new to JSF and facing few problems in solving this,
      My question is I have a dataTable with columns ,and these columns are editable columns.

      if i change value of component then i submit the form. at the backing bean i can read the value of dataTable after changed;but if i just only change rich:dataTable to h:dataTable ,i can get the value what i change.

      who can tell me how to get the list value in rich:dataTable.
      thanks.
      there is my view code:

      
       <h:form id="queryForm" >
      
       <rich:dataTable id="searchTable"
       value="#{packQueryPage.ciqQueryCondition}" var="queryCondition"
       >
       <f:facet name="header">
      
       <rich:column>
       <h:outputText value="Logic"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="SearchItem"></h:outputText>
       </h:column>
       <rich:column>
       <h:outputText value="SearchRelation"></h:outputText>
       </rich:column>
       <rich:column>
       <h:outputText value="Searchword"></h:outputText>
       </rich:column>
       </f:facet>
       <rich:column>
       <h:selectOneMenu id="logic0" value="#{queryCondition.logic}">
       <f:selectItems value="#{packQueryPage.searchlogic}"/>
       </rich:selectOneMenu>
       </rich:column>
       <rich:column>
       <h:selectOneMenu id="searchItem0" value="#{queryCondition.item}">
       <f:selectItems value="#{packQueryPage.searchItem}"/>
       </rich:selectOneMenu>
       </rich:column>
       <rich:column>
       <h:selectOneMenu id="relation0" value="#{queryCondition.relation}">
       <f:selectItems value="#{packQueryPage.searchRelation}"/>
       </h:selectOneMenu>
       </rich:column>
       <rich:column>
       <h:inputText value="#{queryCondition.word}"></h:inputText>
       </rich:column>
       </rich:dataTable>
      
       <h:commandButton id="searchButton" value="Search" action="#{packQueryPage.searchAction}"></h:commandButton>
       </h:form>
      


        • 1. Re: rich:dataTable problem
          Sergey Smirnov Master

           

          "eda" wrote:
          if i change value of component then i submit the form. at the backing bean i can read the value of dataTable after changed;but if i just only change rich:dataTable to h:dataTable ,i can get the value what i change.


          I am not sure I understand what you want and what you get in both cases (rich: and h:). Could you clarify this please.

          • 2. Re: rich:dataTable problem
            liu yida Newbie

            thank you for you reply

            for example:
            <rich:column>
            <h:inputText value="#{queryCondition.word}"></h:inputText>
            </rich:column>
            the column can be input and edit

            if i input the any word in the column i can't get the column through
            #{packQueryPage.ciqQueryCondition},when the tag is rich:datatable and rich:column;but if i use the tag h:datatable and h:column i can get the value what i input.
            this is my test code

            public class PackCIQQueryCondition {
             private String logic;
             private String item;
             private String relation;
             private String word;
            
             public PackCIQQueryCondition() {
             this.logic = "";
             this.item = "";
             this.relation = "";
             this.word = "";
             }
            
             public PackCIQQueryCondition(String item) {
             this.logic = "";
             this.item = item;
             this.relation = "";
             this.word = "";
             }
            
            
            
            
             public String getLogic() {
             return logic;
             }
            
             public void setLogic(String logic) {
             this.logic = logic;
             }
            
             public String getItem() {
             return item;
             }
            
             public void setItem(String item) {
             this.item = item;
             }
            
             public String getRelation() {
             return relation;
             }
            
             public void setRelation(String relation) {
             this.relation = relation;
             }
            
             public String getWord() {
             return word;
             }
            
             public void setWord(String word) {
             this.word = word;
             }
            
            
            }
            
            
             public String searchAction() {
            
             System.out.print(this.fromDate);
             System.out.println(this.fromDate);
             System.out.print(orderby);
            
             for(PackCIQQueryCondition condition:ciqQueryCondition)
             {
             System.out.print(condition.getItem() + " " + " " + condition.getWord() + "xiame");
             }
            
            
             return "CIQSearch";
             }
            
            


            • 3. Re: rich:dataTable problem
              Sergey Smirnov Master

              What the version of richfaces you use - 3.0.0 or one of the latest 3.0.1 snapshot ?

              • 4. Re: rich:dataTable problem
                liu yida Newbie

                i use richfaces 3.0.0

                • 5. Re: rich:dataTable problem
                  liu yida Newbie

                  and i use jsf 1.2_04

                  • 6. Re: rich:dataTable problem
                    Sergey Smirnov Master

                    with facelets or without ?

                    • 7. Re: rich:dataTable problem
                      liu yida Newbie

                      without facelets