[SOLVED] Wizard loosing data

UI Components for JSF
Strider
Posts: 70
Joined: 03 Dec 2009, 22:24

18 Mar 2010, 12:42

Hi,
i have a problem using the p:wizard component and h:selectOneListBox. The values of the selectOneListBox are deleted in Phase 4 of the lifecycle. Normal h:inputText works fine.
Using GF v3 with latest Primefaces 2.0.1-Snapshot.
My bean:

Code: Select all

@ManagedBean(name = "pprBean")
@ViewScoped
public class PprBean implements Serializable {

    private String selection = null;

    public String getSelection() {
        return selection;
    }

    public void setSelection(String selection) {
        this.selection = selection;
    }

    public void save() {
        FacesMessage msg = new FacesMessage("Save", "Value: "+selection+" is set");
        FacesContext.getCurrentInstance().addMessage(null, msg);
    }

    /** Creates a new instance of PprBean */
    public PprBean() {
    }
}
The site:

Code: Select all

            <h:form id="dataForm" prependId="false">
                <p:wizard effect="both">
                    <p:tab title="anwendungsdaten">
                        <p:panel header="Anwendungsdaten">
                            <h:selectOneListbox id="language" size="1" value="#{pprBean.selection}">
                                    <f:selectItem itemLabel="Deutsch" itemValue="de"/>
                                    <f:selectItem itemLabel="Englisch" itemValue="en"/>
                                    <f:selectItem itemLabel="Französisch" itemValue="fr"/>
                                </h:selectOneListbox>
                        </p:panel>
                    </p:tab>
                    <p:tab title="summery">
                        <p:panel header="Zusammenfassung">
                            <h:outputText value="Selection: #{pprBean.selection}"/>
                            <p:growl id="growl" sticky="true" showDetail="true"/>
                            <p:commandButton value="Save" action="#{pprBean.save}" update="growl"/>
                        </p:panel>
                    </p:tab>
                </p:wizard>
            </h:form>
As result it shows only:
"Value: null is set"

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 Mar 2010, 01:57

I've noted this down and will look at it this week, as wizard is enhanced lately, we need to make sure it handles cases like this before release.

Thanks for your feedback.

User avatar
bardu
Posts: 293
Joined: 30 Dec 2009, 08:27
Location: Canada

23 Mar 2010, 23:29

Just want to confirm, facing the same issue.
JSF-2.0, mojarra-2.1 | PrimeFaces-3.0-M1 | GFv3.1 | NetBeans 7 | Ubuntu 11.04
www.yukonlive.ca
www.yukonlive.de

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

24 Mar 2010, 18:45

Ok, thanks, I'll update this post once issue is resolved.

User avatar
bardu
Posts: 293
Joined: 30 Dec 2009, 08:27
Location: Canada

14 Apr 2010, 04:49

I'm using a <h:selectOneMenu> component inside a <p:wizard> component and have the same issue. While the <f:selectItems> value is populated correctly from a Set, the value attribute of the <h:selectOneMenu> component is alway null.

If I take out the wizard component everything works as expected. Currently, I'm using the snapshot from April 11.
JSF-2.0, mojarra-2.1 | PrimeFaces-3.0-M1 | GFv3.1 | NetBeans 7 | Ubuntu 11.04
www.yukonlive.ca
www.yukonlive.de

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

18 Apr 2010, 23:35

Hi Guys,

I've spent some time on this issue, replicated a similar case and setting partial process fixed the issue.

Code: Select all

<p:commandButton value="Save" action="#{pprBean.save}" update="growl" process="@this"/>
The button that completes the flow should just execute it's action without causing process on wizard form elements.

User avatar
bardu
Posts: 293
Joined: 30 Dec 2009, 08:27
Location: Canada

19 Apr 2010, 02:18

Hi Cagatay,

indeed, process="@this" solved the data loose on my <h:selectOneMenu> component, but unfortunately introduces a new issue. All values of the input components in the last tab of the wizard are null now.

Any ideas?

Cheers,
Stephan
JSF-2.0, mojarra-2.1 | PrimeFaces-3.0-M1 | GFv3.1 | NetBeans 7 | Ubuntu 11.04
www.yukonlive.ca
www.yukonlive.de

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Apr 2010, 09:27

In that case, I think you need to set the id of the tab to the process attribute. process="tabid".

User avatar
bardu
Posts: 293
Joined: 30 Dec 2009, 08:27
Location: Canada

19 Apr 2010, 19:03

process="lastTabIdofWizard" (the tab ID of the last tab in the wizard) resolved all my issues in this thread.

Thanks.
JSF-2.0, mojarra-2.1 | PrimeFaces-3.0-M1 | GFv3.1 | NetBeans 7 | Ubuntu 11.04
www.yukonlive.ca
www.yukonlive.de

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Apr 2010, 20:12

Glad to hear Stephan. :)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 8 guests