Skip to Content
0
Former Member
Feb 06, 2007 at 04:37 AM

JSPDynPage event not firing

32 Views

Hi, <p>

I created a JSPDynPage and subsequently coded the corresponding jsp and java file(s).</p>

<b>JSP</b><p>

<%@ taglib uri = "tagLib" prefix = "hbj" %><br>

<hbj:content id = "myContext"><br>

<hbj:page title="Check LockOut Count"><br>

<hbj:form id="myForm"> <br>

<hbj:textView id="welcome_message" design="header1" text="Please enter the following information:"/><br>

<hbj:gridLayout><br>

<hbj:gridLayoutCell rowIndex="1" columnIndex="1"><br>

<hbj:label id="lblLoginID" required="true" text="Login ID:" design="Label" labelFor="txtLoginID"/><br>

</hbj:gridLayoutCell><br>

<hbj:gridLayoutCell rowIndex="1" columnIndex="2"><br>

<hbj:inputField id="txtLoginID" type="string" maxlength="100"/><br>

</hbj:gridLayoutCell><br>

</hbj:gridLayout><br>

<hbj:button id="btnSubmit" text="Check" onClick="btnSubmitClicked" width="100" design="emphasized" /><br>

</hbj:form><br>

</hbj:page><br>

</hbj:content><br>

</p>

<br>

<b>Java File</b>

<p>package com.WebService.ActiveDirectory;<br><br>

import com.WebService.CheckPasswordExpiryResponse;<br>

import com.sapportals.htmlb.InputField;<br>

import com.sapportals.htmlb.event.Event;<br>

import com.sapportals.htmlb.page.DynPage;<br>

import com.sapportals.htmlb.page.PageException;<br>

import com.sapportals.portal.htmlb.page.JSPDynPage;<br>

import com.sapportals.portal.htmlb.page.PageProcessorComponent;<br>

import com.sapportals.portal.prt.component.IPortalComponentResponse;<br>

import com.sapportals.portal.prt.runtime.PortalRuntime;<br><br>

public class CheckLockOutCount extends PageProcessorComponent {<br><br>

public DynPage getPage(){<br>

return new CheckLockOutCountDynPage();<br>

}<br><br>

public static class CheckLockOutCountDynPage extends JSPDynPage{<br>

private String loginID;<br>

private String results;<br>

<br>

public CheckLockOutCountDynPage() {<br>

this.setTitle("Check LockOut Count");<br>

}<br>

<br>

public void doInitialization(){<br>

} <br><br>

public void doProcessAfterInput() throws PageException {<br>

InputField txtLoginID = (InputField)getComponentByName("txtLoginID");<br>

this.loginID = txtLoginID.getValue().toString(); <br>

}<br><br>

public void doProcessBeforeOutput() throws PageException { <br>

}<br><br>

public void onbtnSubmitClicked(Event event) throws PageException {<br>

IPortalComponentResponse response = (IPortalComponentResponse)this.getResponse();<br>

response.write("<script language='JavaScript'>");<br>

response.write("alert('Event fired');");<br>

response.write("</script>");<br>

} <br>

}<br>

}<br><br>

</p><br>

<b>Expected results</b>

<p>Once the user enters the login ID and click the "Check" button, the user should receive a Java Alert message, which says "Event fired". However, when the button is clicked, nothing happens. The page refreshes and the input field is reset.<br>

Can anyone point out what went wrong?</p>

<br>

Thank You.

Message was edited by:

Voon Siong Lum