6 Replies Latest reply on Aug 20, 2009 4:51 AM by Nikica Maric

    h:inputText inside rich:datatable

    Nikica Maric Newbie

      Hi,

      can someone tell me what i am doing wrong with this.

      i have list (List) in MyBean. also, declared HtmlDataTable object for binding rich:datatable to bean.

      in table, in jsp part, i have inputs that could be changed. there are inputtext and selectOneMenu.
      the problem is when i submit changes from form they are not visible on BackingBean. here is a code, so maybe you will see mistakes.

      thanks in advance!!!

      class SomeObject {
      private String type;
      private String value;
      public void setType(String type) {
      this.type = type;
      }
      public String getType() {
      return type;
      }
      public void setValue(String value) {
      this.value = value;
      }
      public String getValue() {
      return value;
      }
      }


      class MyBean {
      List list = new ArrayList();
      HtmlDataTable table;

      ....
      getters/setters
      ....

      public String onContinue() {
      .....
      //here i don't see changes that i made on form
      }
      }

      View.jsp

      ....
      <rich:dataTable id="objects" binding="#myBean.table}"
      value="#{myBean.list}" var="obj">

      ...
      <rich:column>
      <h:inputText id="input_value" value="#{obj.value}" />
      </rich:column>
      <rich:column>
      <h:selectOneMenu id="select_type" value="#{obj.type}">
      <f:selectItem itemLabel="type1" itemValue="type1" />
      <f:selectItem itemLabel="type2" itemValue="type2" />
      <f:selectItem itemLabel="type3" itemValue="type3" />
      </h:selectOneMenu>
      </rich:column>
      .....
      </rich:dataTable>
      <a4j:commandLink id="continueLink" immediate="true" action="#{myBean.onContinue}">
      <h:graphicImage value="/images/butt-continue.gif" />
      </a4j:commandLink>
      ....