CommandLink not invoking the action method
Hi,
I have commandLink that doesn't call the action method specified in the managed bean. I also have scope of the bean as session. I tried with commandButton also. Any thoughts on this? I am using myfaces1.1.4.
The source code is as follows:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>
<f:subview id="itemdetails">
<f:loadBundle basename="messages" var="msgs"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Item Details</title>
<LINK REL=StyleSheet HREF="buttons.css" TYPE="text/css" />
</head>
<body bgcolor="#DEE7F7">
<h:form>
<h:commandLink action="#{ItemDetailsBean.addItems}" styleClass="label" value="Add" />
<h:panelGrid id="panel" columns="4" border="0" styleClass="tableborder" style="text-align:left">
<f:facet name="header">
<h:outputText value="Item Details" styleClass="title" />
</f:facet>
<h:outputLabel value="#{msgs.line}" styleClass="label"/>
<h:panelGroup>
<h:column>
<h:inputText id="lineNumber" value="#{ItemDetailsBean.lineNumber}" required="false" />
<h:outputText escape="false" value="<br>"/>
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.elApplicationTypeJapan}" styleClass="label"/>
<h:inputText id="elApplicationTypeJapan" value="#{ItemDetailsBean.elApplicationTypeJapan}" required="false" />
<h:outputLabel value="#{msgs.ro}" styleClass="label" />
<h:panelGroup>
<h:column>
<h:inputText id="roNumber" value="#{ItemDetailsBean.roNumber}" required="false" />
<h:outputText escape="false" value="<br>" />
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.elApplicationTypeNotJapan}" styleClass="label"/>
<h:inputText id="elApplicationTypeNotJapan" value="#{ItemDetailsBean.elApplicationTypeNotJapan}" required="false" />
<h:outputLabel value="#{msgs.item}" styleClass="mandatory"/>
<h:panelGroup>
<h:column>
<h:inputText id="itemNumber" value="#{ItemDetailsBean.itemNumber}" required="true" />
<h:graphicImage id="itemDescLov" value="#{msgs.imagesLov}" style="cursor:hand"/>
<h:inputText id="itemDesc" value="#{ItemDetailsBean.itemDesc}" required="true" />
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.elModelType}" styleClass="label"/>
<h:inputText id="elModelType" value="#{ItemDetailsBean.elModelType}" required="false" />
<h:outputLabel value="#{msgs.uom}" styleClass="mandatory"/>
<h:panelGroup>
<h:column>
<h:inputText id="uomCode" value="#{ItemDetailsBean.uomCode}" required="true" />
<h:graphicImage id="uomCodeLov" value="#{msgs.imagesLov}" style="cursor:hand"/>
<h:inputText id="uomDesc" value="#{ItemDetailsBean.uomDesc}" required="true" />
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.elApprovalNumber}" styleClass="label"/>
<h:inputText id="elApprovalNumber" value="#{ItemDetailsBean.elApprovalNumber}" required="false" />
<h:outputLabel value="#{msgs.qty}" styleClass="mandatory"/>
<h:panelGroup>
<h:column>
<h:inputText id="quantity" value="#{ItemDetailsBean.quantity}" required="true" />
<h:outputText escape="false" value="<br>"/>
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.ordinanceCodeNo}" styleClass="label"/>
<h:inputText id="ordinanceCode" value="#{ItemDetailsBean.ordinanceCode}" required="false" />
<h:outputLabel value="#{msgs.qtyperunitprice}" styleClass="mandatory"/>
<h:panelGroup>
<h:column>
<h:inputText id="quantityPerUnitPrice" value="#{ItemDetailsBean.quantityPerUnitPrice}" required="true" />
<h:outputText escape="false" value="<br>"/>
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.ordinanceClassficationNumber}" styleClass="label"/>
<h:inputText id="ordinanceClassficationNumber" value="#{ItemDetailsBean.ordinanceClassficationNumber}" required="false" />
<h:outputLabel value="#{msgs.unitprice}" styleClass="mandatory"/>
<h:panelGroup>
<h:column>
<h:inputText id="unitPrice" value="#{ItemDetailsBean.unitPrice}" required="true" />
<h:outputText escape="false" value="<br>"/>
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.smallSum}" styleClass="label"/>
<h:inputText id="smallSum" value="#{ItemDetailsBean.smallSum}" required="false" />
<h:outputLabel value="#{msgs.hsCode}" styleClass="mandatory" />
<h:panelGroup>
<h:column>
<h:inputText id="hsCode" value="#{ItemDetailsBean.hsCode}" required="false" />
<h:outputText escape="false" value="<br>"/>
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.secretCodeFlag}" styleClass="label"/>
<h:inputText id="secretCodeFlag" value="#{ItemDetailsBean.secretCodeFlag}" required="false" />
<h:outputLabel value="#{msgs.countryoforigin}" styleClass="label"/>
<h:panelGroup>
<h:column>
<h:inputText id="countryOfOrigin" value="#{ItemDetailsBean.countryOfOrigin}" required="false" />
<h:graphicImage id="countryOfOriginLov" value="#{msgs.imagesLov}" style="cursor:hand"/>
<h:inputText id="countryOfOriginDesc" value="#{ItemDetailsBean.countryOfOriginDesc}" required="false" />
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.comprehensivePreInspectionFlag}" styleClass="label"/>
<h:inputText id="comprehensivePreInspectionFlag" value="#{ItemDetailsBean.comprehensivePreInspectionFlag}" required="false" />
<h:outputLabel value="#{msgs.countryofdiffusion}" styleClass="label"/>
<h:panelGroup>
<h:column>
<h:inputText id="countryOfDiffusion" value="#{ItemDetailsBean.countryOfDiffusion}" required="false" />
<h:graphicImage id="countryOfDiffusionLov" value="#{msgs.imagesLov}" style="cursor:hand"/>
<h:inputText id="countryOfDiffusionDesc" value="#{ItemDetailsBean.countryOfDiffusionDesc}" required="false" />
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.ear}" styleClass="label"/>
<h:inputText id="ear" value="#{ItemDetailsBean.ear}" required="false" />
<h:outputLabel value="#{msgs.countryofassembly}" styleClass="label"/>
<h:panelGroup>
<h:column>
<h:inputText id="countryOfAssembly" value="#{ItemDetailsBean.countryOfAssembly}" required="false" />
<h:graphicImage id="countryOfAssemblyLov" value="#{msgs.imagesLov}" style="cursor:hand"/>
<h:inputText id="countryOfAssemblyDesc" value="#{ItemDetailsBean.countryOfAssemblyDesc}" required="false" />
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.tsca}" styleClass="label"/>
<h:inputText id="tsca" value="#{ItemDetailsBean.tsca}" required="false" />
<h:outputLabel value="#{msgs.hazardousgoods}" styleClass="label"/>
<h:panelGroup>
<h:column>
<h:selectBooleanCheckbox id="hazardousGoods" value="#{ItemDetailsBean.hazardousGoods}"/>
<h:outputText escape="false" value="<br>"/>
</h:column>
</h:panelGroup>
<h:outputLabel value="#{msgs.inspection}" styleClass="label"/>
<h:inputText id="inspection" value="#{ItemDetailsBean.inspection}" required="false" />
<h:outputText escape="false" value="<br>"/>
<h:outputText escape="false" value="<br>"/>
<h:outputLabel value="#{msgs.ewarningGoods}" styleClass="label"/>
<h:inputText id="warningGoods" value="#{ItemDetailsBean.warningGoods}" required="false" />
</h:panelGrid>
</h:form>
</body>
</f:subview>
</html>

