Issue with <p:rowExpansion> binding null values to dropdowns

UI Components for JSF
Post Reply
bobsteriser
Posts: 3
Joined: 19 Sep 2014, 16:02

19 Sep 2014, 16:26

We have been getting an issue where any dropdown <p:selectOneMenu or <h:selectOneMenu is losing its bound value when a row is collapsed within a datatable:

(as a test i used one inputText, one h:select and 2 p:select)

Code: Select all

<p:dataTable
.
.     
<p:rowExpansion>
.
.
<p:panel>
                <p:panelGrid>
                    <p:row>
                        <p:column><h:outputText value="#{i18n['carrierReasonCode.title']}" style="font-weight: bold" /></p:column>
                        <p:column><h:outputText value="#{i18n['trafficTypeCode.title']}" style="font-weight: bold" /></p:column>
                        <p:column><h:outputText value="#{i18n['directionCode.title']}" style="font-weight: bold" /></p:column>
                        <p:column><h:outputText value="#{i18n['consignmentTypeCode.title']}" style="font-weight: bold" /></p:column>
                    </p:row>
                    <p:row>
                        <p:column>
                            <p:inputText value="#{potential.carrierReasonCode}" />
                         </p:column>
                        <p:column>
                            <h:selectOneMenu value="#{potential.trafficTypeCode}" style="width:96%">
                                <f:selectItem itemValue="" itemLabel="#{i18n['select']}" />
                                <f:selectItems value="#{referenceDataController.temp.entrySet()}" var="entry" itemValue="#{entry.key}" itemLabel="#{entry.value}" />
                                <f:ajax event="change" listener="#{potentialController.changed()}" />
                            </h:selectOneMenu>
                        </p:column>
                        <p:column>
                            <p:selectOneMenu value="#{potential.directionCode}" style="width:96%">
                                <f:selectItem itemValue="" itemLabel="#{i18n['select']}" />
                                <f:selectItems value="#{referenceDataController.temp.entrySet()}" var="entry" itemValue="#{entry.key}" itemLabel="#{entry.value}" />
                                <f:ajax event="change" listener="#{potentialController.changed()}" />
                            </p:selectOneMenu>
                        </p:column>
                        <p:column>
                            <p:selectOneMenu value="#{potential.consignmentTypeCode}" style="width:96%">
                                <f:selectItem itemValue="" itemLabel="#{i18n['select']}" />
                                <f:selectItems value="#{referenceDataController.temp.entrySet()}" var="entry" itemValue="#{entry.key}" itemLabel="#{entry.value}" />
                                <f:ajax event="change" listener="#{potentialController.changed()}" />
                            </p:selectOneMenu>
                        </p:column>
                    </p:row>
                </p:panelGrid>
            </p:panel>
.
.
When choosing 22(text) 1,2,3(selects), the update goes through fine when 'expanded':

FINE: UPDATE curpov01 SET pot_carr_reason_cd = ?, pot_con_type_cd = ?, pot_direction_cd = ?, pot_traff_type_cd = ? WHERE (pot_id = ?)
bind => [22, 3, 2, 1, 1000055827]

But then when i click save again .. even though i have not 'expanded' or changed any value, the 3 selects have lost its value (though the 22 stored in the text box remains):

FINE: UPDATE curpov01 SET pot_con_type_cd = ?, pot_direction_cd = ?, pot_traff_type_cd = ? WHERE (pot_id = ?)
bind => [null, null, null, 1000055827]

Is this valid behavior? Or is there a bug in Primfaces when it comes to <p:selectOneMenu> and <p:rowExpansion>?

Code: Select all

INFO:   Initializing Mojarra 2.2.7
INFO:   Running on PrimeFaces 5.0
INFO:   Running on PrimeFaces Extensions 2.1.0
Last edited by bobsteriser on 24 Sep 2014, 15:31, edited 1 time in total.

bobsteriser
Posts: 3
Joined: 19 Sep 2014, 16:02

24 Sep 2014, 15:29

UPDATE: I have tried with some either or *rendered* outputText + selectOneMenu and it seems the value in selectOneMenu overrides the outputText even when rendered="false".

Has anyone else come up with this issue with dropdowns + <p:rowExpansion>? Or is there something missing to make it work?

msmetana
Posts: 1
Joined: 23 Oct 2014, 13:51

23 Oct 2014, 13:58

I have the same Issue. All <p:inputText fileds are processed without problem and all values from component like <p:selectOneRadio..., <p:selectOneMenu..., <p:selectManyCheckbox..., etc. are erased in the moment when the table row is being collapsed. When I handle rowToggle event, the value is erased yet.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

24 Oct 2014, 11:06

Hi,

Thanks for adding this info, but I doubt it helps getting things fixed. For two reasons
- There is no version info, so what version should this be tried on (the initial post was 5.0, but that could be not relevant anymore for newer versions)?
- There is no fully woprking but minimalistic example (xhtml and bean) so even if someone would want to try to check this on any version, they would/might have to spend to much time to try to create an example that reproduces this. Maybe it is e.g. scope related... So please create a full but minimalistic example

bobsteriser
Posts: 3
Joined: 19 Sep 2014, 16:02

27 Oct 2014, 14:36

Hi,

Sorry I have not has a chance to create a small workable demo yet!

I just ran the existing code with primefaces 5.1 and sadly the same occurred ..

Code: Select all

INFO:   Running on PrimeFaces 5.1
INFO:   Running on PrimeFaces Extensions 2.1.0
INFO:   Loading application [jsf-pipeline-web] at [/jsf-pipeline-web]
When expanded

Code: Select all

FINE:   UPDATE curpov01 SET pot_con_type_cd = ?, pot_direction_cd = ?, pot_traff_type_cd = ? WHERE (pot_id = ?)
	bind => [1, 3, 2, 1000055727]
When closed:

Code: Select all

FINE:   UPDATE curpov01 SET pot_con_type_cd = ?, pot_direction_cd = ?, pot_traff_type_cd = ? WHERE (pot_id = ?)
	bind => [null, null, null, 1000055727]

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 29 guests