Skip to Content
0
Former Member
Feb 21, 2009 at 03:10 PM

accessing input field from the JSP in dynpage

734 Views

HI all,

I am trying to access the input field of the jsp page in my JSPDynpage but it is always return null.My Input is a normal HTML element not a HTMLB element

JSP File :

<hbj:content id="myContext" >

<hbj:page title="PageTitle">

<hbj:form id="myFormId" >

<div class="content">

<table cellpadding="2" cellspacing="2">

<tr>

<td>

<label for="name"><strong>UserName:</strong></label><span id="info_name">(This field is required)</span><br />

<input name="name" id="name" size="10" maxlength="10" type="text" />

</td>

</tr>

<tr>

<td>

<label for="email"><strong>EmailID:</strong></label><span id="info_email">(This field is required)</span><br />

<input name="email" id="email" size="20" maxlength="20" type="text" /></td>

</tr>\

</Table>

JSPDynpage:

InputField myInputField = (InputField) getComponentByName("name");

if (myInputField != null) {

name = myInputField.getValueAsDataType().toString();

}

InputField myInputField1 = (InputField) getComponentByName("email");

if (myInputField1 != null) {

name = myInputField1.getValueAsDataType().toString();

}

In both the cases myInputField and myInputField1 are null . My Question is what should be the parameter that i need to pass for getComponentByName method.

Regards,

Raj.