こんにちは私はprimefacesバージョン3.2を使用しています 私が使用しているuiレイアウトは タブビューです。その中には、アコーディオンパネルとアコーディオンのすべてのタブの中に、 2つの形式。ただ、
Primefaces、activeindex複数のタブを呼び出さないactionlistener
tabview>タブ> accordionpanel>タブ>をForm1と
tabview>タブ> accordionpanel>タブ> Form2を今すぐように...
よう
、問題があります上記のシナリオでアクティブなインデックスアクションが呼び出されていないことを確認します。しかし、私はアコーデオンパネルのタブからのfromsを削除すると、それは呼ばれ、うまく動作します。
これは私のXHTML tabviewコード
<p:tabView id="tabView" activeIndex="#{profileInfoManagedBean.myCurrentTab}" >
<p:ajax event="tabChange" listener="#{profileInfoManagedBean.tabIsChanged}" />
<p:tab id="locationInfoTab" title="Location Info">
<p:accordionPanel id="aPanel">
<p:tab id="tab1" title="Country">
<h:form id="form1">
<p:growl id="growl" life="5000" />
<p:messages id="messages" />
<h:panelGrid columns="3" cellpadding="5" cellspacing="5">
<p:column>
<h:outputLabel for="country" value="Country: "></h:outputLabel>
</p:column>
<p:column>
<p:inputText id="country" value="#{profileInfoManagedBean.country.country}" required="true" label="City">
<f:validateLength minimum="5" maximum="20" />
<p:ajax event="blur" update="msg1"></p:ajax>
</p:inputText>
</p:column>
<p:column>
<p:message id="msg1" for="country" display="icon"></p:message>
</p:column>
</h:panelGrid>
<p:commandButton type="submit" action="#{profileInfoManagedBean.addCountry}" value="Save" ajax="true" ></p:commandButton>
</h:form>
<p:separator />
<h:form id="countryDataTableForm">
<p:panel>
<p:growl id="messagesww" />
<p:confirmDialog id="confirmDialog" message="Are you sure you want to delete the selected row ?"
header="Deleting Row" severity="alert" widgetVar="confirmation1">
<p:commandButton id="confirm" value="Yes Sure" update="messagesww" oncomplete="confirmation1.hide()"
action="#{profileInfoManagedBean.deleteObject}" />
<p:commandButton id="decline" value="Not Yet" onclick="confirmation1.hide()" type="button" />
</p:confirmDialog>
<p:dataTable style="width: 700px;" var="coun" value="#{profileInfoManagedBean.countryList}" selection="#{profileInfoManagedBean.deletingObj}" rowKey="#{coun.countryId}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
paginator="true" rows="5" rowsPerPageTemplate="10,15,20,25" editable="true">
<p:ajax event="rowEdit" update="@this"
listener="#{profileInfoManagedBean.onEditRow}" />
<p:column headerText="Country">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{coun.country}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{coun.country}" style="width:100%" />
</f:facet>
</p:cellEditor>
</p:column>
<p:column id="inactive" filterBy="#{coun.isActive}"
headerText="isActive" footerText="exact"
filterOptions="#{profileInfoManagedBean.isActiveDropDown}"
filterMatchMode="exact">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{coun.isActive}"></h:outputText>
</f:facet>
<f:facet name="input">
<h:selectOneMenu value="#{coun.isActive}" >
<f:selectItem itemLabel="True" itemValue="true" />
<f:selectItem itemLabel="False" itemValue="false" />
</h:selectOneMenu>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Edit">
<p:rowEditor />
</p:column>
<p:column headerText="Delete">
<p:commandButton type="button" onclick="confirmation1.show()"
id="delCountry" title="Delete Country" icon="ui-icon ui-icon-trash" />
</p:column>
<p:column selectionMode="single">
<f:facet name="header">
<h:outputText value="select" />
</f:facet>
</p:column>
</p:dataTable>
</p:panel>
</h:form>
</p:tab>
</p:accordionPanel>
</p:tab>
<p:tab id="basicInfoTab" title="Basic Info">
<p:accordionPanel id="aPanel2">
<p:tab id="tab2" title="basic info">
<h:form id="dkk">
This is basic info tab.
</h:form>
<h:form id="ddkk">
This is basic info tab.
</h:form>
</p:tab>
</p:accordionPanel>
</p:tab>
</p:tabView>
I've got multiple tabs in the tabview and also multiple tabs in each accordion panel.
Waiting for the response.
私はここでアクティブなインデックスを使用しています。タブがクリックされるたびに、バインドされたBeanメンバー変数に格納されます。 あなたの提案では、私はコマンドボタンを押して、タブではなく、それを行う必要があります。 私がurコードから得たものを言いたくない場合は、説明してください。 ありがとう –