p:wizard resets selection on f:selectItems on Prime 3 RC1

UI Components for JSF
Post Reply
User avatar
vinnysoft
Posts: 43
Joined: 07 Oct 2011, 23:51

13 Dec 2011, 03:19

Hi,

I have updated to Primefaces 3 RC1, then my p:wizard started to work strange...

Its cleaning the selection of my f:selectItems, so JSF validation says that nothing has been selected and don't execute the action in p:commandButton. The code below shows the problem:

view.xhtml

Code: Select all

<h:form id="form" prependId="false">

            <p:wizard id="wizard" 
                      widgetVar="wiz"  
                      flowListener="#{chamado.eventoProsseguir}"
                      nextLabel="Proximo" backLabel="Anterior">  


                <p:tab id="tabSolicitante" title="Solicitante">  

                    <p:panel header="Dados do Solicitante">                          

                            <p:messages/>

                            <h:panelGrid columns="2">  

                                <h:outputText value="Solicitante: " />  

                                <p:selectOneMenu id="solicitante"
                                                 value="#{chamado.solicitante.nome}"
                                                 required="true"
                                                 requiredMessage="Selecione o solicitante antes de prosseguir!">

                                    <f:selectItems var="item" value="#{chamado.listaSolicitantes}" itemValue="#{item.nome}" itemLabel="#{item.nome}"/>

                                </p:selectOneMenu> 

                            </h:panelGrid>  

                    </p:panel>  

                </p:tab>  

                <p:tab id="tabServico" title="Serviço">  

                    <p:panel header="Dados do Serviço">  

                            <p:messages/>  

                            <h:panelGrid columns="2" >  

                                <h:outputText value="Serviço: " />  

                                <p:selectOneMenu id="servico" 
                                                 value="#{chamado.servico.nome}" 
                                                 required="true" 
                                                 requiredMessage="Selecione o serviço antes de prosseguir!">

                                    <f:selectItems var="item" value="#{chamado.listaServicos}" itemValue="#{item.nome}" itemLabel="#{item.nome}"/>

                                </p:selectOneMenu>  

                            </h:panelGrid>  

                    </p:panel>  

                </p:tab>   

                <p:tab id="tabConfirmacao" title="Confirmação">  

                    <p:panel header="Confirmação">  
                            
                            <p:messages/>

                            <h:panelGrid columns="2" cellspacing="20px" width="100%"> 

                                <h:outputText value="Solicitante:" />  
                                <h:outputText value="#{chamado.solicitante.nome}" />  

                                <h:outputText value="Serviço: " />  
                                <h:outputText value="#{chamado.servico.nome}"/>  

                                <h:outputText value="Descrição: " />  
                                <p:inputTextarea  value="#{chamado.descricao}" 
                                                  style="width: 350px"
                                                  required="true"
                                                  requiredMessage="Preencha a descrição antes de abrir o chamado!"/> 

                            </h:panelGrid>    

                            <p:commandButton value="Abrir Chamado" action="#{chamado.abrirChamado()}" ajax="false" />

                    </p:panel>  

                </p:tab>  

            </p:wizard>  

        </h:form>
ChamadoBean.java

Code: Select all

@ManagedBean(name = "chamado")
@ViewScoped
public class ChamadoBean implements Serializable
{

    private Solicitante solicitante;
    private Servico servico;
    private String descricao;

public String eventoProsseguir(FlowEvent event)
    {
        if (event.getNewStep().equals("tabServico") && getSolicitante().getNome() == null)
        {
            FacesContext.getCurrentInstance().addMessage("Mensagem", new FacesMessage(FacesMessage.SEVERITY_WARN,
                        "Cadastre algum solicitante antes de prosseguir!",""));   
            return event.getOldStep();
        }
        else if (event.getNewStep().equals("tabConfirmacao") && getServico().getNome() == null)
        {
            FacesContext.getCurrentInstance().addMessage("Mensagem", new FacesMessage(FacesMessage.SEVERITY_WARN,
                        "Cadastre algum serviço antes de prosseguir!",""));   
            return event.getOldStep();
        }
        
        return event.getNewStep();
    }

    public String abrirChamado()
    {
           //persist the bean...
    }

     public Collection getListaSolicitantes()
    {
           //returns a collection from model...
    }

     public Collection getListaServicos()
    {
           //returns a collection from model...
    }

//Getters and Setters

}

I'm using Mojarra 2.1.4.

When I go back to Prime 3.0.0M4 it works fine...

Any ideas?

Thanks!
NetBeans 7.1.2 - Mojarra 2.1.11 - PrimeFaces 3.3.1 - PrimeFaces Extensions 0.5.1 - Apache Tomcat 7.0.29 - Hibernate 4.1.4-Final - MySQL 5.5

tofa
Posts: 46
Joined: 18 Feb 2010, 12:12

13 Dec 2011, 16:00

Got the same issue when upgrading to 3 RC1 :/

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

13 Dec 2011, 16:08

Create an issue
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

User avatar
vinnysoft
Posts: 43
Joined: 07 Oct 2011, 23:51

13 Dec 2011, 16:52

NetBeans 7.1.2 - Mojarra 2.1.11 - PrimeFaces 3.3.1 - PrimeFaces Extensions 0.5.1 - Apache Tomcat 7.0.29 - Hibernate 4.1.4-Final - MySQL 5.5

User avatar
vinnysoft
Posts: 43
Joined: 07 Oct 2011, 23:51

14 Dec 2011, 17:06

The issue was closed with user error... anyone knows what error it means??
NetBeans 7.1.2 - Mojarra 2.1.11 - PrimeFaces 3.3.1 - PrimeFaces Extensions 0.5.1 - Apache Tomcat 7.0.29 - Hibernate 4.1.4-Final - MySQL 5.5

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 39 guests