title: how can inputText disabled using old data entry?
body: <p>When I click on "Add Invoice" button then open dialog box.
  fill some data and save it in database table.
  When I click on "Add Invoice" button second time primefaces inputText value is old data and inputText disable at that time.
  But following code does not working properly. 
  Always inputText blank with disable true ...
  Please help me. Thanks</p>
  
  <pre><code>&lt;p:dataTable id="invoiceTable" var="invoiceProductsServicesDetail"
      value="#{invoiceBean.invoiceProductsServicesDetails}" border="1"
      editable="true"&gt;
      &lt;p:column headerText="Sr. No."&gt;
          &lt;p:outputLabel
              value="#{invoiceProductsServicesDetail.serialNumber}" /&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="HSN Code"&gt;
              &lt;p:outputLabel value="#{invoiceProductsServicesDetail.hsnCode}" /&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Quantity"&gt;
              &lt;p:outputLabel value="#{invoiceProductsServicesDetail.quantity}" /&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Rate"&gt;
              &lt;p:outputLabel value="#{invoiceProductsServicesDetail.rate}" /&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Percentage Discount"&gt;
              &lt;p:outputLabel
                  value="#{invoiceProductsServicesDetail.percentDiscount}" /&gt;
          &lt;/p:column&gt;
          &lt;f:facet name="footer"&gt;
              &lt;p:commandButton value="Add Invoice" type="button"
                  onclick="PF('addInvoice').show();" /&gt;
          &lt;/f:facet&gt;
   &lt;/p:dataTable&gt;
  </code></pre>
  
  <p>Following Dialoag box open when click on "Add Invoice" Button. And it get input.</p>
  
  <pre><code>&lt;p:dialog id="invoiceDialog" header="Add Invoice"
      widgetVar="addInvoice" minHeight="40" showEffect="explode"
      hideEffect="fold"&gt;
      &lt;table border="1" id="dialogTable"&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;p:outputLabel value="HSN Code" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;p:outputLabel value="Quantity" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;p:outputLabel value="Rate" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;p:outputLabel value="Percentage Discount" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;p:inputText value="#{invoiceBean.hsnCode}" size="6"
                  disabled="#{invoiceBean.hsnCode != null}" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;p:inputText id="quaintity"
                  value="#{invoiceBean.quantity}" size="3" styleClass="Alingment"
                  required="true" label="Quantity"
                  requiredMessage="Quantity Require Entry" autocomplete="off"
                  disabled="#{invoiceBean.quantity != 0}" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;p:inputText id="rate" value="#{invoiceBean.rate}"
                  styleClass="Alingment" required="true" label="Rate"
                  requiredMessage="Rate Require Entry" autocomplete="off"
                  disabled="#{invoiceBean.rate != 0}" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;p:inputText value="#{invoiceBean.percentDiscount}"
                  size="2" styleClass="Alingment" autocomplete="off"
                  disabled="#{invoiceBean.percentDiscount != 0}" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
      &lt;/table&gt;
      &lt;p:commandButton value="Save New Invoice"
          action="#{invoiceBean.addRow}" update=":form:invoiceTable growl"
          process="@form invoiceTable" onclick="PF('addInvoice').hide();"&gt;
          &lt;p:confirm header="Confirmation" message="Are You Sure ?"
                      icon="ui-icon-alert" /&gt;
          &lt;f:ajax render=":form:invoiceTable" /&gt;
      &lt;/p:commandButton&gt;
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p>Manage Bean : invoiceBean
  Here, I following method is used to store data in specific object.</p>
  
  <pre><code>public void addRow() {
      int lastBalance, currentBalance, storeBalance;
      transaction = new Transaction();
      invoiceProductsServicesDetail = new InvoiceProductsServicesDetail();
      invoiceDao = new InvoiceDao();
      transactionDao = new TransactionDao();
      FacesContext facesContext = FacesContext.getCurrentInstance();
      DataTable dataTable = (DataTable) facesContext.getViewRoot()
              .findComponent("form:invoiceTable");
      UIComponent uiTable = ComponentUtils.findParentForm(facesContext,
              dataTable);
      final AjaxBehavior behavior = new AjaxBehavior();
      try {
          if (descriptionOfGoodsOrService != ""
                  &amp;&amp; descriptionOfGoodsOrService != null &amp;&amp; rate != 0
                  &amp;&amp; quantity != 0) {
              amount = (rate * quantity);
              this.grossTotal = amount = (amount - (amount * (percentDiscount / 100)));
              this.netTotal = ((amount) + (amount * (Constants.VAT / 100)) + (amount * (Constants.SERVICE_TAX / 100)));
  
              if (chequeAmount &lt;= amount) {
                  invoiceProductsServicesDetails = invoiceDao.getInvoiceProductsServicesDetailData(invoices.get(
                          0).getId());
  
                  transactions = transactionDao.getTransactions(invoices.get(
                          0).getId());
                  invoiceProductsServicesDetail.setSerialNumber(dataTable
                          .getRowCount() + 1);
                  invoiceProductsServicesDetail.setHsnCode(hsnCode);
                  invoiceProductsServicesDetail
                          .setPercentDiscount(percentDiscount);
                  invoiceProductsServicesDetail.setQuantity(quantity);
                  invoiceProductsServicesDetail.setRate(rate);
                  invoiceProductsServicesDetail.setInvoiceId(invoices.get(0)
                          .getId());
  
                  invoiceProductsServicesDetails
                          .add(invoiceProductsServicesDetail);
  
                  if (transactions.size() != 0) {
                      setTransactions(transactions);
                      lastBalance = transactions.get(transactions.size() - 1)
                              .getBalance();
                  } else {
                      lastBalance = 0;
                  }
                  currentBalance = amount - chequeAmount;
                  storeBalance = lastBalance + currentBalance;
  
                  transaction.setModeOfPayment(modeOfPayment);
                  if (modeOfPayment.equals("Cheque")) {
                      transaction.setBankName(bankName);
                      transaction.setChequeNumber(chequeNumber);
                      transaction.setBalance(storeBalance);
                  } else {
  
                      transaction.setBalance(storeBalance);
  
                  }
                  transaction.setChequeAmount(chequeAmount);
                  transaction.setReceiptNumber(String.valueOf(new Date()
                          .getTime()));
                  transactionDao.setTransaction(transaction, invoices.get(0).getId());
                  this.transactions = transactionDao.getTransactions(invoices.get(0).getId());
                  invoiceDao.insertInvoiceProductsServicesDetail(invoiceProductsServicesDetail);
                  RowEditEvent rowEditEvent = new RowEditEvent(uiTable,behavior, invoiceProductsServicesDetail);
                  rowEditEvent.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
                  dataTable.broadcast(rowEditEvent);
              } else {
  
                  FacesMessage message = new FacesMessage(
                          FacesMessage.SEVERITY_INFO, "System Error",
                          "Your Enter Amout Is Must Less Then Total Amount");
                  facesContext.addMessage(null, message);
              }
  
          }
      } catch (AbortProcessingException e) {
          e.printStackTrace();
      } finally {
          invoiceProductsServicesDetail = null;
      }
  }
  </code></pre>