Question

Here is my JSF .xhtml code. issue is that JSF value not sent to server when its change & save.its still send to server just earlier values please help me to sort out this issue

thanks all :-)

        <ui:decorate template="/jsf/templates/one_column.xhtml">
            <ui:define name="label">
                <h:outputText value="Card Status" style="font-weight:bold;" />
            </ui:define>
            <ui:define name="field">


            <h:selectOneMenu value="#{profileController.selectedBean.title}">
                <f:selectItems value="#{profileController.titles}"/>
            </h:selectOneMenu>                          


                <h:selectOneMenu 
                    value="#{cardManagementController.selectedCardBean.cardStatusId}" >
                    <f:selectItem itemValue="null" itemLabel="please select" 
                        noSelectionOption="true" />
                    <f:selectItems 
                        value="#{cardManagementController.listCardTypeStatus}"
                        var="cardStatus" itemLabel="#{cardStatus.name}"
                        itemValue="#{cardStatus.statusId}" />
                </h:selectOneMenu>
            </ui:define>
        </ui:decorate>

also here i will show my class codes

private CardBean selectedCardBean = new CardBean();
public void editCard() {
    if (selectedCardBean != null) {//THIS selectedCardBean is still shows earlier records
        cardService.editCardInformation(selectedCardBean);
        selectedCardBean = new CardBean();
        editCardEnabled = false;
    }
    searchCard();
}

Code Added

            <!-- Buttons  -->
            <ui:decorate template="/jsf/templates/one_column.xhtml">
                <ui:define name="label">
                </ui:define>
                <ui:define name="field">
                    <a4j:commandButton value="Submit" execute="@form"
                        action="#{cardManagementController.editCard()}"
                        render="#{rich:clientId('hpnlRes')} #{rich:clientId('hpnlSearch')} #{rich:clientId('hpnlEdit')}" />
                    <a4j:commandButton value="Back" style="margin-left:10px;"
                        action="#{cardManagementController.hideEditCard()}"
                        render="#{rich:clientId('hpnlRes')} #{rich:clientId('hpnlSearch')} #{rich:clientId('hpnlEdit')}" />
                </ui:define>
            </ui:decorate>
Was it helpful?

Solution

issue with my controller class..i fixed it thanks all

there i get item value but pass from form its id

thatswhy

<f:selectItems 
                        value="#{cardManagementController.listCardTypeStatus}"
                        var="cardStatus" itemLabel="#{cardStatus.name}"
                        itemValue="#{cardStatus.statusId}" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top