No announcement yet.

Conditional section buttons

  • Filter
  • Time
  • Show
Clear All
new posts

  • Conditional section buttons


    Is there a way to make section buttons conditional like row buttons?
    I know that I can make them 'disabled' but there is there a way to make them enabled by an event in that section?

    Kind regards, Theo

  • #2
    Hi Theo -

    In your case, what type of event would take place in order to hide/show the section button?



    • #3
      I have a 2 buttons: create and display pdf report. It's a large and complex report so I do not want to recreate the report every time the user displays it. But as long as the report doesn't exist the display report button must be disabled.
      Kind regards, Theo


      • #4
        Hi Theo - the following steps should accomplish what you want:
        • Click the Security button (it is on the same row as the Behaviors button)
        • Locate your display pdf button in the list shown and give it a "feature name". Let's suppose that you call it "displayPDF"
        • We want to disable the "displayPDF" feature by default when the application opens. You can do this by either specifying a "startup" (EXNABSTART) and calling disableFeature('displayPDF') or changing the URL of the app in Portal Admin to contain "df=displayPDF".
        • Next, we need to enable the displayPDF feature when the PDF report is created. I assume that your Create PDF button already calls an RPG program based off of EXNABBTN. If so, does that call return a file or a JSON response (via calls to SetResponse)? If it does not return a file then we can enable the feature by calling SetReponse('enableFeature':'displayPDF'). If you are returning a file let us know and we will provide instructions on how to handle that.


        • #5
          Hi Sean,

          Thanks, that will do.
          enableFeature('displayPDF') was what I was looking for.
          SetReponse('enableFeature':'displayPDF') works for me.

          Thanks, Theo