title: primefaces datatable on dialog does not show in first time
body: <p>I'm using primefaces-3.4 and have a dialog (detail page) to be shown details of the selected item on datatable on master page. my bean is @ViewScoped and at actionListener method I'm loading details for sure. When the master page displayed, at first click on p:commandButton, it does not fill the dialog where at second click it displays correctly. I've checked using Chrome developer tools, and see nothing anormal, it's just details of the selected item is not getting "bind" to UI.</p>
  
  <p>here is my bean code and xhtml</p>
  
  <pre><code>@PostConstruct
  public void init() {
      // load credits if there is an account selected...
      if (mainBean.getSelectedAccount() != null) {
  
          ArrayList&lt;Credit&gt; cs = loadCredits(mainBean.getSelectedAccount());
          setCredits(cs);
          mainBean.getSelectedAccount().setCredits(cs);
      }
      if (this.selectedCredit != null) {
          ArrayList&lt;Installation&gt; installations = loadInstallations(selectedCredit);
          selectedCredit.setInstallations(installations);
          setPaymentAmount(Float.parseFloat(installations.get(installations.size()-1).getAmount()));
      }
  }
  ....
  //actionListener to select
  public String select() {
      if (selectedCredit != null) {
          ArrayList&lt;Installation&gt; installations = loadInstallations(selectedCredit);
          selectedCredit.setInstallations(installations);
      }
      return null;
  }
  </code></pre>
  
  <p>and here is snippets in my xhtml</p>
  
  <pre><code>&lt;p:dataTable var="credit" selectionMode="single"
                          emptyMessage="Kayıt Bulunamadı..."
                          selection="#{accountBean.selectedCredit}" rowKey="#{credit.id}"
                          value="#{accountBean.credits}" id="credit_table" paginator="true"
                          paginatorAlwaysVisible="false" rows="10"&gt;
                          &lt;f:facet name="header"&gt;
                              &lt;small&gt;İlgili krediyi seçtikten sonra "Detay" butonuna
                                  tıklayınız..&lt;/small&gt;
                          &lt;/f:facet&gt;
                          &lt;p:column&gt;
                              &lt;h:outputText headerText="Kredi ID" value="#{credit.id}" /&gt;
                          &lt;/p:column&gt;
                          &lt;p:column headerText="Kredi Adı"&gt;
                              &lt;h:outputText value="#{credit.name}" /&gt;
                          &lt;/p:column&gt;
                          &lt;p:column headerText="Tutarı"&gt;
                              &lt;h:outputText value="#{credit.total}" /&gt;
                          &lt;/p:column&gt;
  
                          &lt;f:facet name="footer"&gt;
                              &lt;p:toolbar&gt;
                                  &lt;p:toolbarGroup align="left"&gt;
                                      &lt;p:commandButton actionListener="#{accountBean.select}"
                                          icon="ui-icon-search"
                                          update=":productdetailform:product_detail"
                                          oncomplete="kredidetail.show();" value="Detay"&gt;
                                          &lt;f:ajax render=":productdetailform:product_detail" /&gt;
                                      &lt;/p:commandButton&gt;
  ....
  &lt;h:form id="productdetailform"&gt;
              &lt;p:dialog id="product_detail"
                  header="#{accountBean.selectedCredit.name}" widgetVar="kredidetail"
                  modal="true" height="700" width="850"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="twelve columns"&gt;
                          &lt;ul class="block-grid three-up"&gt;
                              &lt;li&gt;&lt;b&gt;Kredi Hesap Adı: &lt;/b&gt; &lt;h:inputText readonly="true"
                                      value="#{accountBean.selectedCredit.name}" /&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;b&gt;Kredi Tutarı: &lt;/b&gt; &lt;h:inputText readonly="true"
                                      value="#{accountBean.selectedCredit.total}" /&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;b&gt;Veriliş Tarihi: &lt;/b&gt; &lt;p:calendar readonly="true"
                                      pattern="dd.MM.yyyy" readonlyInput="true" id="loan_date"
                                      value="#{accountBean.selectedCredit.loanDate}" /&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;b&gt;Ödenen: &lt;/b&gt; &lt;h:inputText readonly="true"
                                      value="#{accountBean.selectedCredit.paid}" /&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;b&gt;Kalan: &lt;/b&gt; &lt;h:inputText readonly="true"
                                      value="#{accountBean.selectedCredit.remaining}" /&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;b&gt;Durumu: &lt;/b&gt; &lt;h:outputText value="AKTİF" /&gt;&lt;/li&gt;
  
                          &lt;/ul&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="twelve columns"&gt;
                          &lt;p:dataTable var="ins" emptyMessage="Kayıt Bulunamadı..."
                              value="#{accountBean.selectedCredit.installations}"
                              id="credit_details_table"&gt;
                              &lt;p:column headerText="Taksit No"&gt;
                                  &lt;h:outputText value="#{ins.installationNo}" /&gt;
                              &lt;/p:column&gt;
                              &lt;p:column headerText="Vadesi"&gt;
                                  &lt;h:outputText value="#{ins.paymentDue}"&gt;
                                      &lt;f:convertDateTime pattern="dd.MM.yyyy" /&gt;
                                  &lt;/h:outputText&gt;
                              &lt;/p:column&gt;
                              &lt;p:column headerText="Taksit Tutarı"&gt;
                                  &lt;h:outputText value="#{ins.amount}" /&gt;
                              &lt;/p:column&gt;
                              &lt;p:column headerText="Taksit Tutarı"&gt;
                                  &lt;h:outputText value="#{ins.paidAmount}" /&gt;
                              &lt;/p:column&gt;
                              &lt;p:column headerText="Ödeme Durumu"&gt;
                                  &lt;h:outputText value="#{ins.status}" /&gt;
                              &lt;/p:column&gt;
                              &lt;p:column headerText="Ödeme Tarihi"&gt;
                                  &lt;h:outputText value="#{ins.actualDate}" /&gt;
                              &lt;/p:column&gt;
                          &lt;/p:dataTable&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/p:dialog&gt;
          &lt;/h:form&gt;
  </code></pre>
  
  <p>so what is the problem actually?</p>