Skip to Content

Getting Error: java.lang.IllegalArgumentException: can't parse argument 0

HI All,

I am implementing the Message Pool in NWDS.

I have two InputFields: Firstname and Lastname.

and i have a method name: CheckMandatory which takes one argument as String.

I have implemented this Method in the StartView. Now when i am leaving this fields empty and pressing the Go Button.

Then i am getting the Following Error:

java.lang.IllegalArgumentException: can't parse argument number 0

So pls help me out......

Regards,

Dhruv Shah

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 08:45 AM

    Hi,

    I made some changes in this code ,pls try this as it is

    IWDMessageManager mess = wdComponentAPI.getMessageManager();

    Object value = <b><b>wdContext.currentPersonElement().getAttributeAsText(FieldName);</b></b>

    IWDAttributeInfo attr = wdContext.nodePerson().getNodeInfo().getAttribute(FieldName);

    //if (((String)value).length() == 0)

    if(wdContext.currentPersonElement().getName() == null)

    {

    mess.reportContextAttributeMessage

    (<b>wdContext.currentPersonElement(),</b>

    attr,IMessageWelcome.MISSING_INPUT,new Object[] {Fieldlable},

    true);

    }

    I tested its working for me..

    karthik.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 05:56 AM

    Hi,

    Give these two parameters

    checkMandatory( java.lang.String fieldName, java.lang.String fieldLabel )

    Regards,

    karthik

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 06:21 AM

    Hi,

    Use this code in checkmandatory method

    IWDMessageManager messageMgr = wdComponentAPI.getMessageManager();

    Object attributeValue =wdContext.currentdetElement().getAttributeValue (fieldName);

    IWDAttributeInfo attributeInfo =

    wdContext.nodedet().getNodeInfo().getAttribute(fieldName);

    if (((String) attributeValue).length() == 0) {

    messageMgr.reportContextAttributeMessage( wdContext.currentedetElement(),

    attributeInfo,

    IMessageForm.MISSING_INPUT,

    new Object[] { fieldLabel },

    true);

    }

    } else if (attributeValue instanceof Integer) {

    }

    call that mandatory in the Go action as:

    this.checkMandatory( IPrivate<>View.detailElement.<fieldname>,

    "labelname");

    Then raise pending exception.

    It will work

    Regards,

    karthik.

    Message was edited by:

    karthi keyan

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      THis is the Stack Trace:

      java.lang.IllegalArgumentException: can't parse argument number 0

      at java.text.MessageFormat.makeFormat(MessageFormat.java:1323)

      at java.text.MessageFormat.applyPattern(MessageFormat.java:447)

      at java.text.MessageFormat.<init>(MessageFormat.java:347)

      at java.text.MessageFormat.format(MessageFormat.java:800)

      at com.sap.tc.webdynpro.services.datatypes.core.DataTypeFormatter.format(DataTypeFormatter.java:80)

      at com.sap.tc.webdynpro.progmodel.controller.MessageItem.getMessage(MessageItem.java:211)

      at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.InputFieldAdapter$DataTip.setMessage(InputFieldAdapter.java:1156)

      at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.InputFieldAdapter.getAssociatedAdapters(InputFieldAdapter.java:1323)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:299)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:102)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.MatrixLayoutRenderer.renderMatrixLayoutCellFragment(MatrixLayoutRenderer.java:729)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.MatrixLayoutRenderer.renderMatrixLayoutRowFragment(MatrixLayoutRenderer.java:346)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.MatrixLayoutRenderer.renderMatrixLayoutFragment(MatrixLayoutRenderer.java:302)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.MatrixLayoutRenderer.render(MatrixLayoutRenderer.java:71)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:294)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:102)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:516)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:61)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:294)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:102)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.UiWindowRenderer.render(UiWindowRenderer.java:45)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:294)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:102)

      at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendHtml(HtmlClient.java:555)

      at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:346)

      at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:255)

      at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.retrieveData(HtmlClient.java:157)

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

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

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

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

      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:390)

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

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

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

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

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

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

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

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

      at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

      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:95)

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

      Regards,

      Dhruv Shah

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 06:24 AM

    Hi Dhruv,

    What exactly u r doing in CheckMandatory mathod?? can u send the code , bcos if u r leaving the field empty, obviously the string is null.

    regards

    Sumit

    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.