tags:

views:

239

answers:

2

I am using hx:commandExButton of IBM Faces Client Framework to call my method. But the method is not getting called. But if I use immediate="true" it's getting called. But as you all know with this my model won't get updated, so it has no use to me.

Has anyone faced this? Check the hx:commandExButton id="btnSearch"

    <%-- tpl:metadata --%>
    <%-- jsf:pagecode language="java" location="/src/pagecode/view/costestimation/SearchAssignee.java" --%><%-- /jsf:pagecode --%>
<%-- /tpl:metadata --%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%&gt;&lt;%@taglib
    prefix="h" uri="http://java.sun.com/jsf/html"%&gt;&lt;%@taglib
    uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%><%@taglib
    uri="http://java.sun.com/portlet_2_0" prefix="portlet"%><%@taglib
    uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model"
    prefix="portlet-client-model"%><%@page language="java"
    contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%><portlet-client-model:init>
    <portlet-client-model:require module="ibm.portal.xml.*" />
    <portlet-client-model:require module="ibm.portal.portlet.*" />
</portlet-client-model:init>
<portlet:defineObjects />
<link rel="stylesheet" type="text/css" title="Style"
    href="../../theme/stylesheet.css">
<f:view>
    <f:loadBundle var="giamsBundle"
        basename="com.ibm.costprojectionportlet.nl.GIAMSResourceBundle" />
    <hx:viewFragment id="viewFragment1">

        <hx:scriptCollector id="scriptCollector1">

            <script language="JavaScript"
                src='<%=renderResponse.encodeURL(renderRequest
                                        .getContextPath()
                                        + "/js/common.js")%>'></script>

            <h:outputText value="<br/>" escape="false" />

            <h:outputText id="titleSearch" styleClass="outputText"
                value="#{giamsBundle['title.search']}" escape="false"></h:outputText>

            <h:outputText value="<br/>" escape="false" />

            <h:messages style="font-weight:bold;color:red;" layout="table"></h:messages>

            <hx:panelSection styleClass="panelSection" title="SearchCriteria"
                id="searchCriteriaPanel" initClosed="false"
                style="border-width: thin; border-style: groove">
                <h:form styleClass="form" id="searchCriteriaForm">
                    <h:messages style="font-weight:bold;color:red;" layout="table"></h:messages>
                    <h:panelGrid columns="2" cellpadding="1" border="0" width="100%">
                        <h:column>
                            <hx:panelFormBox helpPosition="over" labelPosition="left"
                                styleClass="panelFormBox" id="formBoxLeft">
                                <hx:formItem styleClass="formItem" id="frmLastName"
                                    label="#{giamsBundle['lbl.search.lastname']}" escape="false">
                                    <h:inputText styleClass="inputText" size="20" id="txtLastName"
                                        value="#{pc_SearchAssignee.assignee.lastName}">
                                    </h:inputText>
                                </hx:formItem>

                                <hx:formItem styleClass="formItem" id="frmHomeCountrySerial"
                                    label="#{giamsBundle['lbl.search.homecountryserial']}"
                                    escape="false">
                                    <h:inputText styleClass="inputText" size="20"
                                        id="txtHomeCountrySerial"
                                        value="#{pc_SearchAssignee.assignee.companyDetails.homeCountrySerial}">
                                    </h:inputText>
                                </hx:formItem>

                                <hx:formItem styleClass="formItem" id="frmHomeCountry"
                                    label="#{giamsBundle['lbl.search.homecountry']}" escape="false">
                                    <h:selectOneMenu styleClass="selectOneMenu" id="ddHomeCountry"
                                        value="">
                                        <f:selectItems value="#{pc_referenceData.telephoneTypeList}" />
                                    </h:selectOneMenu>
                                </hx:formItem>

                                <hx:formItem styleClass="formItem" id="frmHomeBusinessUnit"
                                    label="#{giamsBundle['lbl.search.homebusunit']}" escape="false">
                                    <h:selectOneMenu styleClass="selectOneMenu" value=""
                                        id="ddHomeBusinessUnit">
                                        <f:selectItems value="#{pc_referenceData.telephoneTypeList}" />
                                    </h:selectOneMenu>
                                </hx:formItem>

                                <hx:formItem styleClass="formItem" id="frmforButtons" label=""
                                    escape="false">
                                    <h:panelGroup>
                                        <hx:commandExButton styleClass="commandExButton"
                                            id="btnSearch" value="#{giamsBundle['btn.search']}"
                                            action="#{pc_SearchAssignee.searchAssignee}">
                                        </hx:commandExButton>
                                        <hx:commandExButton styleClass="commandExButton"
                                            id="btnCancel" value="#{giamsBundle['btn.cancel']}"
                                            action="#{pc_SearchAssignee.searchAssignee}">
                                        </hx:commandExButton>
                                    </h:panelGroup>
                                </hx:formItem>

                            </hx:panelFormBox>
                        </h:column>

                        <h:column>
                            <hx:panelFormBox helpPosition="over" labelPosition="left"
                                styleClass="panelFormBox" id="formBoxRight">

                                <hx:formItem styleClass="formItem" id="frmFirstName"
                                    label="#{giamsBundle['lbl.search.firstname']}" escape="false">
                                    <h:inputText styleClass="inputText" size="20" id="txtFirstName"
                                        value="#{pc_SearchAssignee.assignee.firstName}">
                                    </h:inputText>
                                </hx:formItem>

                                <hx:formItem styleClass="formItem" id="frmHomeNotesEmail"
                                    label="#{giamsBundle['lbl.search.homenotesemail']}"
                                    escape="false">
                                    <h:panelGroup>
                                        <h:inputText styleClass="inputText" size="20"
                                            id="txtHomeNotesEmail"
                                            value="#{pc_SearchAssignee.assignee.lotusNotesId}">
                                        </h:inputText>
                                    </h:panelGroup>
                                </hx:formItem>

                                <hx:formItem styleClass="formItem" id="frmHomeLocation"
                                    label="#{giamsBundle['lbl.search.homeloc']}" escape="false">
                                    <h:inputText styleClass="inputText" size="20"
                                        id="txtHomeLocation"
                                        value="#{pc_SearchAssignee.assignee.homeAddress.cityName}">
                                    </h:inputText>
                                </hx:formItem>

                                <hx:formItem styleClass="formItem" id="blank" label=""
                                    escape="false">
                                    <h:outputText id="txtblank" escape="false"></h:outputText>
                                </hx:formItem>

                            </hx:panelFormBox>
                        </h:column>
                    </h:panelGrid>
                </h:form>

                <f:facet name="opened">
                    <hx:jspPanel id="jspPanelMainOpen">
                        <hx:graphicImageEx id="imageExMainOpen"
                            styleClass="graphicImageEx" align="middle"
                            value="/theme/img/form_header.GIF" width="100%" height="20"></hx:graphicImageEx>

                    </hx:jspPanel>
                </f:facet>

            </hx:panelSection>



            <h:outputText id="titleResults" styleClass="outputText"
                value="#{giamsBundle['lbl.search.results']}" escape="false"></h:outputText>

            <h:outputText value="<br/>" escape="false" />

            <hx:dataTableEx border="0" cellspacing="2" width="100%"
                columnClasses="columnClass1" headerClass="headerClass"
                footerClass="footerClass" rowClasses="rowClass1, rowClass2"
                styleClass="dataTableEx" id="searchAssignee"
                value="#{pc_SearchAssignee.assigneeList}" var="searchitr"
                binding="#{pc_SearchAssignee.searchDataTable}"
                rendered="#{pc_SearchAssignee.render}">

                <hx:columnEx id="columnEx1">
                    <f:facet name="header">
                        <hx:panelBox styleClass="panelBox" id="selectPanelBox">
                            <hx:outputSelecticons styleClass="outputSelecticons"
                                id="selectCheckBox"></hx:outputSelecticons>
                        </hx:panelBox>
                    </f:facet>

                    <hx:inputRowSelect styleClass="inputRowSelect"
                        value="#{searchitr.selected}" id="rowSelect"></hx:inputRowSelect>
                    <f:facet name="header"></f:facet>
                </hx:columnEx>

                <hx:columnEx id="columnEx2">
                    <f:facet name="header">
                        <h:outputText id="lblEeId" styleClass="outputText"
                            value="#{giamsBundle['lbl.search.eeid']}"></h:outputText>
                    </f:facet>

                    <h:inputText styleClass="inputText" id="dttxtEEID"
                        value="#{searchitr.employeeID}"></h:inputText>
                </hx:columnEx>

                <hx:columnEx id="columnEx3">
                    <f:facet name="header">
                        <h:outputText id="lblFirstName" styleClass="outputText"
                            value="#{giamsBundle['lbl.search.firstname']}"></h:outputText>
                    </f:facet>

                    <h:inputText styleClass="inputText" id="dttxtFirstName"
                        value="#{searchitr.firstName}"></h:inputText>
                </hx:columnEx>

                <hx:columnEx id="columnEx4">
                    <f:facet name="header">
                        <h:outputText id="lblLastName" styleClass="outputText"
                            value="#{giamsBundle['lbl.search.lastname']}"></h:outputText>
                    </f:facet>

                    <h:inputText styleClass="inputText" id="dttxtLastName"
                        value="#{searchitr.lastName}"></h:inputText>
                </hx:columnEx>

                <hx:columnEx id="columnEx5">
                    <f:facet name="header">
                        <h:outputText id="lblHomeNotesEmail" styleClass="outputText"
                            value="#{giamsBundle['lbl.search.homenotesemail']}"></h:outputText>
                    </f:facet>

                    <h:inputText styleClass="inputText" id="dttxtHomeNotesEmail"
                        value="#{searchitr.homeAddress.addressLine1}"></h:inputText>
                </hx:columnEx>

                <hx:columnEx id="columnEx6">
                    <f:facet name="header">
                        <h:outputText id="lblHomeCountry" styleClass="outputText"
                            value="#{giamsBundle['lbl.search.homecountry']}"></h:outputText>
                    </f:facet>

                    <h:inputText styleClass="inputText" id="dttxtHomeCountry"
                        value="#{searchitr.homeAddress.addressLine1}"></h:inputText>
                </hx:columnEx>

                <hx:columnEx id="columnEx7">
                    <f:facet name="header">
                        <h:outputText id="lblHomeLocation" styleClass="outputText"
                            value="#{giamsBundle['lbl.search.homeloc']}"></h:outputText>
                    </f:facet>

                    <h:inputText styleClass="inputText" id="dttxtHomeLocation"
                        value="#{searchitr.homeTaxID}"></h:inputText>
                </hx:columnEx>

                <hx:columnEx id="columnEx8">
                    <f:facet name="header">
                        <h:outputText id="lblHomeBusUnit" styleClass="outputText"
                            value="#{giamsBundle['lbl.search.homebusunit']}"></h:outputText>
                    </f:facet>

                    <h:inputText styleClass="inputText" id="dttxtHomeBusUnit"
                        value="#{searchitr.homeTaxID}"></h:inputText>
                </hx:columnEx>

                <hx:columnEx id="columnEx9">
                    <f:facet name="header">
                        <h:outputText id="lblAssignStatus" styleClass="outputText"
                            value="#{giamsBundle['lbl.search.assignmentstatus']}"></h:outputText>
                    </f:facet>

                    <h:inputText styleClass="inputText" id="dttxtAssignStatus"
                        value="#{searchitr.homeTaxID}"></h:inputText>
                </hx:columnEx>

            </hx:dataTableEx>

            <h:outputText value="<br/>" escape="false" />

            <hx:commandExButton type="submit" styleClass="commandExButton"
                rendered="#{pc_SearchAssignee.render}" id="btnContinue"
                value="#{giamsBundle['btn.continue']}"
                action="#{pc_SearchAssignee.searchAssignee}">
            </hx:commandExButton>

        </hx:scriptCollector>
    </hx:viewFragment>
</f:view>
A: 

But if I use immediate="true" it's getting called

In other words, it works fine when the non-immediate input values doesn't get gathered, validated, converted and updated in the model. So something has failed there. I see that you have added a <h:messages/>, so you should get notified of any validation/conversion errors. Have you also pay attention to this?

BalusC
A: 

hey guys, i got this issue. actually some of my fields were not mapped properly. i missed out on the following error

R Caused by: javax.faces.el.PropertyNotFoundException: Error testing property 'cityName' in bean of type null at com.sun.faces.el.PropertyResolverImpl.getType(PropertyResolverImpl.java:343)

Hey Balus, nothing showed up for the messages tag

Thanks, Tejas.