3 Replies Latest reply on Mar 13, 2009 11:42 AM by Nick Belaevski

    Dynamic DataTable with Input

    Ramazan Pekin Newbie

      Hi,
      I am trying to generate dynamic data table with dynamic columns. Over dynamic columns, I need to add HtmlInputText and after form post, I need to take its value.

      
      mainDataTable.getChildren().clear();
      
      mainDataTable.setValue(newSpecialCommission.getSpecialCommissionLimitWrapperList());
      mainDataTable.setVar("specialCommissionLimitWrapper");
      
      HtmlColumnGroup valueColumnGroup = new HtmlColumnGroup();
      
      for (int i=0; i<newSpecialCommission.getDistPartyCreditRangeList().size(); i++) {
       /**
       * CREDIT_RANGE VALUE COLUMN
       */
       HtmlColumn creditRangeValueColumn = new HtmlColumn();
       ValueExpression creditRangeValueExpression = FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createValueExpression(
       FacesContext.getCurrentInstance().getELContext(),
       "#{specialCommissionLimitWrapper.distributionPartyLimitWrapperList["+i+"].sellerRateDefault}",
       String.class
       );
       HtmlInputText creditRangeValueInputText = new HtmlInputText();
       creditRangeValueInputText.setId("distributionPartyLimitWrapper_"+i+"_sellerRateDefault");
       creditRangeValueInputText.setValueExpression("value", creditRangeValueExpression);
       creditRangeValueColumn.getChildren().add(creditRangeValueInputText);
       valueColumnGroup.getChildren().add(creditRangeValueColumn);
      }
      
      mainDataTable.getChildren().add(valueColumnGroup);
      
      


      But, when I post the form, the input values not coming. "sellerRateDefault" is coming as null.

      Can you suggest me any solution, or anyone can show me example like this.