Note that there are some explanatory texts on larger screens.

plurals
  1. POActive Index of tabview not getting updated automatically
    primarykey
    data
    text
    <p>Active Index is not getting updated automatically. ReaD in a few posts that by placing the tabView on a form it works. Or by including <code>&lt;p:ajax event="tabChange"/&gt;</code> in the tabview it works. But nothing seems to work</p> <p><strong>xhtml</strong></p> <p><strong>Sample 1 : automatic updates</strong></p> <p> </p> <pre><code> &lt;p:tabView id="categoryTabView" var="promoArticle" value="#{promotionDetailBean.artDTOs}" activeIndex="#{promotionDetailBean.activeTabIndex}"&gt; &lt;p:tab id="categoriesTab" title="#{promoArticle.categoryName}"&gt; &lt;p:dataTable id="promotionDetail_dataTable" var="articlePromo" value="#{promoArticle.artVO}" selection="#{promotionDetailBean.selectedArt}" rowIndexVar="rowIndex"&gt; &lt;p:column id="select" selectionMode="multiple" /&gt; &lt;p:column id="barCode"&gt; &lt;h:inputText id="barCodeInputTxt" value="#{articlePromo.barCode}" styleClass="inputTextStyle" onchange="onSuggestedValueChange('categoryTabView',#{promotionDetailBean.activeTabIndex}, 'promotionDetail_dataTable',#{rowIndex},'originalCostInputTxt')" /&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; &lt;/p:tab&gt; &lt;/p:tabView&gt; </code></pre> <p><strong>Sample 2: Updating on tabChange event</strong></p> <pre><code> &lt;h:form id="form"&gt; &lt;p:growl id="growlm" showDetail="true" /&gt; &lt;p:tabView id="categoryTabView" var="promoArticle" value="#{promotionDetailBean.artDTOs}" &gt; &lt;p:ajax event="tabChange" listener="#{promotionDetailBean.tabChanged}" update=":growlm" /&gt; &lt;p:tab id="categoriesTab" title="#{promoArticle.categoryName}"&gt; &lt;p:dataTable id="promotionDetail_dataTable" var="articlePromo" value="#{promoArticle.artVO}" selection="#{promotionDetailBean.selectedArt}" rowIndexVar="rowIndex"&gt; &lt;p:column id="select" selectionMode="multiple" /&gt; &lt;p:column id="barCode"&gt; &lt;h:inputText id="barCodeInputTxt" value="#{articlePromo.barCode}" styleClass="inputTextStyle" onchange="onSuggestedValueChange('categoryTabView',#{promotionDetailBean.activeTabIndex}, 'promotionDetail_dataTable',#{rowIndex},'originalCostInputTxt')" /&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; &lt;/p:tab&gt; &lt;/p:tabView&gt; </code></pre> <p>I need to identify the cell on "onChange " event. But the activeIndex is always 0, the initialized value. The event doesn't get call.</p> <p><strong>bean</strong></p> <pre><code>private Integer activeTabIndex = 0; public Integer getActiveTabIndex() { return activeTabIndex; } public void setActiveTabIndex(Integer activeTabIndex) { this.activeTabIndex = activeTabIndex; } </code></pre> <p><strong>bean</strong></p> <pre><code>public void tabChanged(TabChangeEvent event){ TabView tv = (TabView) event.getComponent(); this.activeTabIndex = tv.getActiveIndex(); } </code></pre> <p>But the event is not getting trigerred. Nor getting updated automatically.</p> <p>What could be the probable issues ?</p> <p>Thanks, Shikha</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload