IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

How to toggle hideable panel from Java code instead of from async control

  • 1.  How to toggle hideable panel from Java code instead of from async control

    Posted Mon December 14, 2015 11:42 AM

    Is it possible to toggle a hideable panel when a command button is clicked?


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 2.  RE: How to toggle hideable panel from Java code instead of from async control

    Posted Mon December 14, 2015 12:59 PM

    I thought about using Invoke Script to toggle the panel but cannot figure out to toggle after the command control is clicked.


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 3.  RE: How to toggle hideable panel from Java code instead of from async control

    Posted Mon December 28, 2015 01:40 PM

    Hello,

    Doesn’t the command button refresh the whole page on click?

    You can try Event.waitUntiLoaded javascript event in this case.

    or use an async command control and put the toggle javascript code in the corresponding “On Smth” box.

    There are more possibilitites.

    Can you explain a little more in depth what is your exact problem? Where is the pain point?

    Best regards,
    Vlad Turian


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 4.  RE: How to toggle hideable panel from Java code instead of from async control

    Posted Tue December 29, 2015 05:37 PM

    Where would I add the Event.waitUntilLoaded javascript?
    I am using Designer 8.2.
    The command button control has Client-Side Events tab. Under this tab, I see Click, Double Click, Mouse Down, etc; but none of these options are appropriate.
    The jsf Form control has Client-Side Events tab as well. Under this tab, I see Click, …, Submit; but these options are not appropriate either.

    Here’s my problem in detail.
    I have one portlet with one form having toggle options and hideable panels. One of the hiedable panel had a async command button. When it is clicked, a webservice refresh() call is made, and current hidable panel is refreshed when the response is returned.
    Now I need to use synchronous command button. When the sync com button is clicked, the webservice refresh() is made, and the page is refreshed. However, the last hideable panel is hidden this time.
    I tried to set the toggle option by setting “Default Focus” property of Form Display - no hideable panel displayed although the toggle option is auto selected.


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 5.  RE: How to toggle hideable panel from Java code instead of from async control

    Posted Wed December 30, 2015 09:56 AM

    Hi Joy,

    When I want to make sure some javascript code is executed before the page is loaded I use the following:

    • I add an “Script Block” in the component you know it will be refreshed. Usually for page refresh you can use the outermost component (the form)
    • I add the following code in the Script Block
    
    Event.waitUntilLoaded(function(){ 
    //your code goes here
    }); 

    However please note that this code will execute every time the page is refreshed (not just when it is refreshed as a part of your webservice action).

    Hope it helps,
    Vlad Turian


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine