I am having 3 jsp files which are included in a single jsp using jsp action includes.
Now each external include is having different form. In the JspDynPage Processor
i am getting null using
InputField inputFld = (InputField)pageContext.getComponentForId("input1");
Please advise me how to get form controls data and how to deal this.
Thanks
Markandeya
The detailed code i used is
1.mainPage.jsp
<jsp:include page="incECHeaderExt.jsp" flush="true" />
<jsp:include page="incPartItemsExt.jsp" flush="true" />
<jsp:include page="incFooterExt.jsp" flush="true" />
2. incECHeaderExt.jsp
<%@ taglib uri="tagLib" prefix="hbj" %>
<hbj:content id="editPageContext" >
<hbj:page title="Edit Claim">
<hbj:form id="form1" >
<hbj:inputField id="input1"
design="STANDARD"
value="aa"
type="STRING"
/>
<!-- many controls-->
</hbj:form>
</hbj:page>
</hbj:content>
3. incPartItemsExt.jsp
<%@ taglib uri="tagLib" prefix="hbj" %>
<hbj:content id="editPageContext" >
<hbj:page title="Edit Claim">
<hbj:form id="form2" >
<hbj:inputField id="input2"
design="STANDARD"
value="bb"
type="STRING"
/>
<!-- many controls-->
</hbj:form>
</hbj:page>
</hbj:content>
4. incFooterExt.jsp
<%@ taglib uri="tagLib" prefix="hbj" %>
<hbj:content id="editPageContext" >
<hbj:page title="Edit Claim">
<hbj:form id="form3" >
<hbj:button
id="button_Submit"
text="Submit"
onClick="saveClick"
design="EMPHASIZED"
width="100"
/>
</hbj:form>
</hbj:page>
5. JSPDynPage method
public void onSaveClick(Event event) throws PageException {
InputField inputFld = (InputField)pageContext.getComponentForId("input1");
if(inputFld != null){
absVal = inputFld.getValueAsDataType();
objHeader.setValueAt(absVal,1,9);
}
}
The controls of same form/page in which button click event is triggered are accesible with
InputField inputFld = (InputField)this.getComponentForId("input1");
This is giving 'null' for all other external jsp
forms.
Please let us know how to access all forms controls in the external jsp pages.
Thanks
Markandeya
Add a comment