views:

24

answers:

2

Hello, executing this form the action is not executed, but if I comment the combo boxes the action is executed without any problem, so I assume my spring webflow is ok.
The combo boxes are populated with the correct data without any problem so I suppose the problem is in the jsf template.

Code:

<%@ include file="/jsp/taglibs.jsp"%>
<t:saveState value="#{traballadorManageBean.traballador.cargoTraballador.idCargoTraballador}"/>
<t:saveState value="#{traballadorManageBean.traballador.tipoPerfil.idTipoPerfil}"/>
<t:saveState value="#{traballadorManageBean.traballador.centro.idCentro}"/>
<t:saveState value="#{traballadorManageBean.traballador.nome}"/>
<t:saveState value="#{traballadorManageBean.traballador.apelido1}"/>
<t:saveState value="#{traballadorManageBean.traballador.apelido2}"/>
<t:saveState value="#{traballadorManageBean.traballador.usuario}"/>
<t:saveState value="#{traballadorManageBean.traballador.contrasinal}"/>
<t:saveState value="#{traballadorManageBean.traballador.email}"/>

<t:messages/>
<t:panelGrid id="insertarTraballador" width="100%">

    <f:verbatim>
        <br />
    </f:verbatim>
    <t:outputText value="#{msg.ins_traballador_datos}" styleClass="bigTitle"/>
    <t:panelGrid id="datosTraballador" align="right" width="100%"
        styleClass="tablaBorde" cellpadding="2" cellspacing="2" columns="4">

        <t:panelGroup>
            <t:outputText value="#{msg.ins_traballador_cargo_traballador}" />
        </t:panelGroup>
        <t:panelGroup>
            <t:selectOneMenu id="comboCargosTraballador" 
                value="#{traballadorManageBean.traballador.cargoTraballador.idCargoTraballador}" tabindex="1">   
                <f:selectItem itemLabel="--------------------------------" itemValue="-1" />
                <f:selectItems value="#{traballadorManageBean.listaCargosTraballador}" />       
            </t:selectOneMenu>
        </t:panelGroup>

        <t:panelGroup>
            <t:outputText value="*" styleClass="campoObligatorio" />        
            <t:outputText value="#{msg.ins_traballador_tipo_perfil}" />
        </t:panelGroup>     
        <t:panelGroup>
            <t:selectOneMenu id="comboTiposPerfil" 
                value="#{traballadorManageBean.traballador.tipoPerfil.idTipoPerfil}" tabindex="2">   
                <f:selectItem itemLabel="--------------------------------" itemValue="-1" />
                <f:selectItems value="#{traballadorManageBean.listaTiposPerfil}" />         
            </t:selectOneMenu>
        </t:panelGroup>

        <t:panelGroup>
            <t:outputText value="*" styleClass="campoObligatorio" />        
            <t:outputText value="#{msg.ins_traballador_centro_traballo}" />
        </t:panelGroup>     
        <t:panelGroup>
            <t:selectOneMenu id="comboCentroReceptor" 
                value="#{traballadorManageBean.traballador.centro.idCentro}" tabindex="3">   
                <f:selectItem itemLabel="--------------------------------" itemValue="-1" />
                <f:selectItems value="#{traballadorManageBean.listaCentros}" />             
            </t:selectOneMenu>
        </t:panelGroup>

        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>     
        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>

        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>     
        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>

        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>     
        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>

        <t:panelGroup>
            <t:outputText value="*" styleClass="campoObligatorio" />    
            <t:outputText value="#{msg.ins_traballador_usuario}" />
        </t:panelGroup>     
        <t:panelGroup>
            <t:inputText id="txtUsuario" tabindex="4" value="#{traballadorManageBean.traballador.usuario}" size="30" />
        </t:panelGroup>

        <t:panelGroup>
            <t:outputText value="*" styleClass="campoObligatorio" />    
            <t:outputText value="#{msg.ins_traballador_contrasinal}" />
        </t:panelGroup>     
        <t:panelGroup>
            <t:inputText id="txtContrasinal" tabindex="5" value="#{traballadorManageBean.traballador.contrasinal}" size="30" />
        </t:panelGroup>

        <t:panelGroup>
            <t:outputText value="#{msg.ins_traballador_email}" />
        </t:panelGroup>     
        <t:panelGroup>
            <t:inputText id="txtEmail" tabindex="6" value="#{traballadorManageBean.traballador.email}" size="60" />
        </t:panelGroup>

        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>     
        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>

        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>     
        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>

        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>     
        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>

        <t:panelGroup>
            <t:outputText value="*" styleClass="campoObligatorio" />        
            <t:outputText value="#{msg.ins_traballador_nome}" />
        </t:panelGroup>     
        <t:panelGroup>
            <t:inputText id="txtNome" tabindex="7" value="#{traballadorManageBean.traballador.nome}" size="40" />
        </t:panelGroup>

        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>     
        <t:panelGroup>
            <f:verbatim><br/></f:verbatim>
        </t:panelGroup>

        <t:panelGroup>
            <t:outputText value="*" styleClass="campoObligatorio" />        
            <t:outputText value="#{msg.ins_traballador_apelido1}" />
        </t:panelGroup>     
        <t:panelGroup>
            <t:inputText id="txtApelido1" tabindex="8" value="#{traballadorManageBean.traballador.apelido1}" size="40" />
        </t:panelGroup>

        <t:panelGroup>
            <t:outputText value="#{msg.ins_traballador_apelido2}" />
        </t:panelGroup>     
        <t:panelGroup>
            <t:inputText id="txtApelido2" tabindex="9" value="#{traballadorManageBean.traballador.apelido2}" size="40" />
        </t:panelGroup>
    </t:panelGrid>


    <t:panelGrid id="botonera" align="center" >
        <t:commandButton id="botonGuardar" tabindex="1000"
            styleClass="button"
            type="submit" 
            value="#{msg.ins_traballador_boton_crear}"
            action="insertar"></t:commandButton>
    </t:panelGrid>      
</t:panelGrid>
+1  A: 

Add <h:messages/> to the page to get notified of any validation/conversion errors. Big chance that you see "Validation error: value not valid" in there. If this is indeed the case, then you need to rewrite your backing bean code to ensure that the getter for all <f:selectItems> tags returns exactly the same list during the form submit request as it did during the initial form display request.

BalusC
Where do I check those notifications? Are they printed in my log file or in my browser?
Dez
In the page, there where you added `<h:messages/>`. I don't do MyFaces, but in Mojarra any "missed" validation/conversion message (i.e. when you don't have a `h:message` or `h:messages` for it in the page) are printed to server log as well.
BalusC
Set <h:messages/> in the jsp file and haven't got any notification printed. Neither in the log file.
Dez
OK, another try to exclude one and other: put bean in session scope and retry.
BalusC
A: 

Solved. It was a JSF problem, because from the combos didn't get the right type of data, populated by the backing bean. And I couldn't get anything from because in our 'framework' we had that feature overridden to display customized messages. BalusC you were right in the points. Thanks

Dez
You're welcome. Slap the framework team with a large trout and don't forget to mark the answer accepted.
BalusC