Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen using dynamic="true" on p:tabView, other tabs doesn't open and commandlink in 1st tab is not invoked
    primarykey
    data
    text
    <p>I am using JSF 2.0 with PrimeFaces 3.0 M3. When I set <code>dynamic="false"</code> on <code>&lt;p:tabView&gt;</code>, then it works fine. But when I set it to <code>true</code>, then only the currently active tab works. Other tabs does not run. In the 1st tab I have a command link in a data table, this is also not working.</p> <p>Below is my <code>tabletabview.xhtml</code>:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:ui="http://java.sun.com/jsf/facelets"&gt; &lt;h:head&gt; &lt;/h:head&gt; &lt;h:body&gt; &lt;f:view&gt; &lt;h:form&gt; &lt;p:growl id="growl" showDetail="true" /&gt; &lt;p:tabView cache="false" dynamic="true" activeIndex=0 &gt; &lt;p:ajax event="tabChange" listener="ActivityController.onChange"/&gt; &lt;p:tab title="Search Results 1"&gt; &lt;p:dataTable var="dataItem" value="#{ActivityController.dataList}"&gt; &lt;p:column&gt; &lt;p:panel style="font-size:12px;width:600px"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="#{dataItem.activityname}" /&gt; &lt;/f:facet&gt; &lt;div style="background-color: #DEB887;"&gt; &lt;h:outputText value="Location:" style="color:#FF0000;"&gt;&lt;/h:outputText&gt; &lt;h:outputText value="#{dataItem.address}" /&gt; &lt;br&gt;&lt;/br&gt; &lt;/div&gt; &lt;div style="background-color: #DEB887;"&gt; &lt;h:outputText value="Start Date:" style="color:#FF0000;"&gt;&lt;/h:outputText&gt; &lt;h:outputText value="#{dataItem.startingdate}" /&gt; &lt;br&gt;&lt;/br&gt; &lt;/div&gt; &lt;div style="background-color: #DEB887;"&gt; &lt;h:outputText value="Start Date:" style="color:#FF0000;"&gt;&lt;/h:outputText&gt; &lt;h:outputText value="#{dataItem.endingdate}" /&gt; &lt;/div&gt; &lt;div style="background-color: #DEB887;"&gt; &lt;h:outputText value="Description:" style="color:#FF0000;"&gt;&lt;/h:outputText&gt; &lt;h:outputText value="#{dataItem.description}" /&gt; &lt;br&gt;&lt;/br&gt; &lt;/div&gt; &lt;p:commandLink action="#{ActivityController.editDataItem}"&gt; &lt;div style="display: none"&gt; &lt;h:outputText value="#{dataItem.activityname}" /&gt; &lt;/div&gt; &lt;h:outputText value="more....."&gt;&lt;/h:outputText&gt; &lt;f:setPropertyActionListener target="#{ActivityController.dataItem}" value="#{dataItem}" /&gt; &lt;/p:commandLink&gt; &lt;/p:panel&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; &lt;/p:tab&gt; &lt;p:tab title="Search Results 2"&gt; &lt;p:panel style="width:600px;height:600px"&gt; &lt;p:schedule id="sche" value="#{searchController.eventModel}" editable="true" draggable="false" resizable="false" widgetVar="myschedule"&gt; &lt;p:ajax event="eventSelect" listener="#{searchController.onEventSelect}" update="red" process="@this" /&gt; &lt;/p:schedule&gt; &lt;/p:panel&gt; &lt;/p:tab&gt; &lt;p:tab id="gmap" title="Search Results 3"&gt; &lt;ui:include src="/locationpointers.xhtml"&gt;&lt;/ui:include&gt; &lt;/p:tab&gt; &lt;/p:tabView&gt; &lt;/h:form&gt; &lt;/f:view&gt; &lt;/h:body&gt; &lt;/html&gt; </code></pre> <p>This is the relevant part of my <code>ActivityController.java</code></p> <pre><code>public List&lt;ActivityRegBean&gt; getDataList() { return dataList; } public void setDataList(List&lt;ActivityRegBean&gt; dataList){ this.dataList=dataList; } private ActivityRegBean dataItem; private HtmlInputHidden dataItemId = new HtmlInputHidden() ; public String editDataItem() throws IOException { FacesContext context = FacesContext.getCurrentInstance(); System.out.println(dataItem.activityname); dataItemId.setValue(dataItem.activityid); System.out.println(dataItem.activityid); retfromtable(dataItem.activityname); return "edit"; // Navigation case. } public void onChange(TabChangeEvent event) { System.out.println("tab id = " + event.getTab().getId()); } </code></pre> <p>The <code>ActivityRegBean</code> has a getter and setter.</p> <p>How can I use <code>dynamic="true"</code> on the <code>&lt;p:tabView&gt;</code> without problems?</p>
    singulars
    1. This table or related slice is empty.
    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