Skip to Content
0
Former Member
May 15, 2004 at 10:52 AM

Getting form controls data in multiple jsp action includes

42 Views

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);

}

}