Skip to Content
0
Former Member
Apr 20, 2007 at 01:52 PM

Form Valadation

17 Views

Hi

My application is a 4 step process. From Step1 before moving onto Step 2 there is some valadation, presently only on a single field "Reason". The requirment is that once an error is encountered processing stops and the message displayed.

cheeckMandatory("Reason");

wdComponentAPI.getMessageManager().raisePendingException();

wdThis.wdFirePlugNextOut(); //go to next step

Where "cheeckMandatory" is as:

public void cheeckMandatory( java.lang.String fieldName )

{

//@@begin cheeckMandatory()

IWDMessageManager messageMgr = this.wdComponentAPI.getMessageManager();

Object attributeValue = this.wdContext.currentContextElement().getAttributeValue(fieldName);

IWDAttributeInfo attributeInfo = this.wdContext.getNodeInfo().getAttribute(fieldName);

String description = attributeInfo.getSimpleType().getDescription();

Object o = this.wdContext.currentContextElement();

}

If the line

wdComponentAPI.getMessageManager().raisePendingException();

is included and in the event the Reason field is left blank then we get the following exception:

Error stacktrace:

com.sap.tc.webdynpro.progmodel.controller.MessageManager$AbortMessageManagerException:

at com.sap.tc.webdynpro.progmodel.controller.MessageManager.raisePendingException(MessageManager.java:404)

at com.sap.te.CreateClaimStep1.onPlugNextIn(CreateClaimStep1.java:214)

at com.sap.te.wdp.InternalCreateClaimStep1.wdInvokeEventHandler(InternalCreateClaimStep1.java:149)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:768)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:350)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:635)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:249)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

If I remove the line "wdComponentAPI.getMessageManager().raisePendingException();" The error is displayed on the screen correctly but we move to the next step. Can anyone tell me what might be causing the exception above as the line "wdComponentAPI.getMessageManager().raisePendingException();" stops any further processing.

Thanks

Damien