Topic
4 replies Latest Post - ‏2012-04-12T13:27:53Z by mburati
Sripathiks
Sripathiks
30 Posts
ACCEPTED ANSWER

Pinned topic javascript and Action List call

‏2010-07-21T03:39:54Z |
I have a requirement wherein I have to call a javascript function and then call Action List. I have a page builder which has a button. On click of button, I can either call a javascript or call an Action List. I cannot call both. But my requirement requires both of these actions to occur. How can I do this?
If I had used a Input Form builder, I could have achieved it because I could have called client Javascript on click of button and the Input Form has Input next action. But I could not use Input Form builder and hence need a way to know how to call Clientside Java script first and then Action List. Please suggest the right approach to achieve the above requirement.
Updated on 2012-04-12T13:27:53Z at 2012-04-12T13:27:53Z by mburati
  • SystemAdmin
    SystemAdmin
    1493 Posts
    ACCEPTED ANSWER

    Re: javascript and Action List call

    ‏2010-07-21T10:59:14Z  in response to Sripathiks
    You can use HTML Event Action (or Attribute Setter) to run your script from the button's onclick event: these builders allow you to choose if the event handler will overwrite an existing handler; in your case, you can choose to prepend the new handler before the existing one.
    • Sripathiks
      Sripathiks
      30 Posts
      ACCEPTED ANSWER

      Re: javascript and Action List call

      ‏2010-07-21T14:28:19Z  in response to SystemAdmin
      Thank you. It worked. I used Prepend new value on Html event action and it worked fine.
  • SystemAdmin
    SystemAdmin
    1493 Posts
    ACCEPTED ANSWER

    Re: javascript and Action List call

    ‏2012-04-12T12:24:45Z  in response to Sripathiks
    Hi... nice info,

    I have a requirement where i need to call the Action List first and then a Javascript based on condition in ACtion list. Is there a way out on this?
    • mburati
      mburati
      425 Posts
      ACCEPTED ANSWER

      Re: javascript and Action List call

      ‏2012-04-12T13:27:53Z  in response to SystemAdmin
      WEF Link and Button Action control builders have a "Post Action Behavior" section that lets you specify what should happen after the UI control triggers an action (eg, refresh full browser page vs refresh specified page location vs default smart refresh behavior ...). One of the options there is to Evaluate Results as Javascript (in other words the method or action will return a Javascript string and the UI control will expect JS to be returned and will evaluate and execute the Javascript that has been returned from the action).

      ..mb1