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

Related questions

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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.