Topic
  • 6 replies
  • Latest Post - ‏2012-11-27T21:05:24Z by Codeoline
Codeoline
Codeoline
141 Posts

Pinned topic Error Message Clear!

‏2012-11-21T19:57:46Z |
I have a button that will clear all of my input fields and it works great. I would like to be able to clear the date validation error message (Through Date is before From Date) also with this button. Nothing i have tried seems to work. Any ideas?
Updated on 2012-11-27T21:05:24Z at 2012-11-27T21:05:24Z by Codeoline
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Error Message Clear!

    ‏2012-11-23T16:29:43Z  
    If you go to Application tree view of the model(in the source tab), you will find a method named clear_<<importPageName>>_Errors, under WebApp -> methods ->

    You can invoke this method like any other methods you created using method builder.

    Cheers
    Selva
  • Codeoline
    Codeoline
    141 Posts

    Re: Error Message Clear!

    ‏2012-11-26T14:49:23Z  
    If you go to Application tree view of the model(in the source tab), you will find a method named clear_<<importPageName>>_Errors, under WebApp -> methods ->

    You can invoke this method like any other methods you created using method builder.

    Cheers
    Selva
    I can not seem to get both the button and the method to work at the same time. Would i be able to use a dialog box for the message that the user has to close before they can move on?
    Thank You
  • mburati
    mburati
    2561 Posts

    Re: Error Message Clear!

    ‏2012-11-26T20:11:17Z  
    • Codeoline
    • ‏2012-11-26T14:49:23Z
    I can not seem to get both the button and the method to work at the same time. Would i be able to use a dialog box for the message that the user has to close before they can move on?
    Thank You
    It looks like you're trying to reset server side generated HTML (the server side custom validation message) with a client side (Javascript based) method to clear the form.

    - Since you already have client side Javascript walking the form to clear fields, you could have that JS also find the custom error message element and clear its innerHTML, to keep the entire reset on the client side.

    - If you have anything else you need to reset on the server, you may be able to mix a server action call (eg, Button builder or HTML Event Action builder onclick) on that button with additional Javascript executed on that button (the server side would clear whatever it is your server side validation check uses and then just redisplay the page, and the client side JS you're now using could be prepended onto the onclick (eg, with an Attribute Setter builder) for that button.

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • Codeoline
    Codeoline
    141 Posts

    Re: Error Message Clear!

    ‏2012-11-26T21:26:48Z  
    • mburati
    • ‏2012-11-26T20:11:17Z
    It looks like you're trying to reset server side generated HTML (the server side custom validation message) with a client side (Javascript based) method to clear the form.

    - Since you already have client side Javascript walking the form to clear fields, you could have that JS also find the custom error message element and clear its innerHTML, to keep the entire reset on the client side.

    - If you have anything else you need to reset on the server, you may be able to mix a server action call (eg, Button builder or HTML Event Action builder onclick) on that button with additional Javascript executed on that button (the server side would clear whatever it is your server side validation check uses and then just redisplay the page, and the client side JS you're now using could be prepended onto the onclick (eg, with an Attribute Setter builder) for that button.

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    I would like to keep it all in the current rest button. I have tried adding

    document.getElementById('after_ValidationError').value = "";
    AND
    document.getElementById('after_ValidationError').innerHTML = "";

    to the function but neither work.

    Obviously I am doing something wrong yet, I have no idea what.

    Do you have any suggestions as to what I may be doing wrong?

    Thank You
  • mburati
    mburati
    2561 Posts

    Re: Error Message Clear!

    ‏2012-11-26T21:55:35Z  
    • Codeoline
    • ‏2012-11-26T21:26:48Z
    I would like to keep it all in the current rest button. I have tried adding

    document.getElementById('after_ValidationError').value = "";
    AND
    document.getElementById('after_ValidationError').innerHTML = "";

    to the function but neither work.

    Obviously I am doing something wrong yet, I have no idea what.

    Do you have any suggestions as to what I may be doing wrong?

    Thank You
    If your model still looks like the one originally attached above, then it didn't look like that element had an id attribute to me when I last looked (just a name attribute) so getElementById wouldn't return that element. If you know your portlet is only going to be placed on a portal page once (and nothing else on the page is likely to use the id you choose to use) then you could use an Attribute Setter builder to set the id attribute to a unique id that you choose. If it does need to be used on the portal page more than once (more than one copy of your portlet on the same portal page) then you would need to ensure the id you set is unique for each instance (eg, using the Unique Client-Side ID builder).

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • Codeoline
    Codeoline
    141 Posts

    Re: Error Message Clear!

    ‏2012-11-27T21:05:24Z  
    • mburati
    • ‏2012-11-26T21:55:35Z
    If your model still looks like the one originally attached above, then it didn't look like that element had an id attribute to me when I last looked (just a name attribute) so getElementById wouldn't return that element. If you know your portlet is only going to be placed on a portal page once (and nothing else on the page is likely to use the id you choose to use) then you could use an Attribute Setter builder to set the id attribute to a unique id that you choose. If it does need to be used on the portal page more than once (more than one copy of your portlet on the same portal page) then you would need to ensure the id you set is unique for each instance (eg, using the Unique Client-Side ID builder).

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    This works great Thank You so much.