Skip to Content
author's profile photo Former Member
Former Member

Getting form controls data in multiple jsp action includes

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

}

}

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 17, 2004 at 04:35 AM

    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 comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      This an urgent requirement and my work is held up.

      I have to split to external jsps due to 64 kb problem

      Any ideas??

      Any help is highly appreciated.

      Thanks

      Markandeya