nulls assigned to some fields from a different tab

UI Components for JSF
Post Reply
tonico
Posts: 51
Joined: 22 Aug 2010, 00:15

09 Sep 2010, 17:42

Primefaces 2.2 M1, Glassfish 3.1

Using 2.2 M1, upgrade yesterday, but I do not think this is 2.2 related alone.

This is a somewhat complex situation... I have a p:tabView with some dynamic tabs in it. Each tab is sourced from specific facelets via a ui:include that resides inside the p:tab component. The tabView and underlying tabs are all under the same h:form component. Something like this:

Code: Select all

                    <h:form id="form2">
                        <opfields:controls />
                        <p:tabView id="tabGroup"   effect="opacity" effectDuration="fast" activeIndex="#{navigationBean.tabIndex}" tabChangeListener="#{navigationBean.tabChangeListener}" dynamic="true" >
                            <c:forEach var="tab" items="#{navigationBean.tabs}">
                                <p:tab title="#{tab.label} - #{tab.index} - #{tab.visible}  " rendered="#{tab.visible}">
                                    <ui:include src="#{tab.contentUrl}" />
                                </p:tab>
                            </c:forEach>
                        </p:tabView>
                    </h:form>
Let's take the case of me having two tabs as following:

Tab 1 ) contains some fields such as name, surname and a selectOneMenu gender field.
Tab 2 ) contains other details, such as address

- If I enter data on tab 1, I can see with firebug that the values get posted
- When I go to tab 2 and I open a dialog ( p:confirmDialog ) then I can see a new http post going on, but carrying only data from tab 2, which is my current tab.

Now here is the issue, on the server side I am logging what happens to the selectOneMenu values. Before I went to tab 2 I could see the value set on the selectOneMenu just like I wanted "gender = male" but when a posting occurred on tab 2 as soon as I clicked on the confirmDialog opening button and the Tab 2's data was posted, the server side shows the setter for the gender field to be getting a null value.

My impression is that when having a dynamic tabView the other form's fields simply get out of the ajax scope. I am also curious to why a inputText that is on the other tab ( tab 1 ) still keeps its value, while just the selectOneMenu does not...


ADDITIONAL INFO: I have found out that when the TabView has dynamic=false rathern than dynamic=true, the issue does no longer occur, but dynamic=false implies another issue ( http://primefaces.prime.com.tr/forum/vi ... f=3&t=4399 ) where the trees inside dialogs won't render. Somehow this is now a trap as I need both scenarios to work.

http://primefaces.prime.com.tr/forum/vi ... f=3&t=4399
- Tonico
Primefaces 2.2.1 - Glassfish 3.1 - Mac OS X Lion

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests