Forum Stats

  • 3,782,041 Users
  • 2,254,585 Discussions
  • 7,879,899 Comments

Discussions

Simple Question: How to use dynamic action (button, checkbox or LOV) to show and hide items in a DML

MaLau
MaLau Member Posts: 34 Blue Ribbon
edited Jul 11, 2016 9:51AM in APEX Discussions

Hi,

from my point of view this is a quite simple exercise for most of you.

We have a little APEX (v 5.0.2.00.07) application for the DBAs in our company to request storage. They simply have to type in mount point sizes they need for a new databases.

Storage colleagues can than create a script execution command to create the requested storage (the provided values for the mount point sizues will be used as input variables for the storage creation script).

So far so simple.

Now the mount point design has changed and so some fields in the DML Form (which is based on a db table where all values are stored) are not necessary anymore so I would like to hide them in the DML Form as well as a report on another report page.

Hidding itself is very simple. Just go to the "Page Designer", select the field(s) you want to hide under "Page Items" and select "Hidden" for Type of this item(s).

It could happen that a DBA has to request a db with the old mount point design so I would like to provide the possibility to show the hidden fields again.

For me personally it doesn't matter if this it triggered by a button, a checkbox or an LOV (e.g. values OLD and NEW).

As already mentioned for me it feels like a very simple use case for a Dynamic Action.

What I already did:

------------------------------------------------------------------------------------------

1.

in page designer right click on the created button, checkbox or LOV --> "Create Dynamic Action"

2.

"True" - Action will be "Show"

Seletion Type "Item(s)"

Under Item(s) I have to add the related fields I would like the display again

Fire On Page Load "No"

"False" - Action will be "Hide"

Selection Type and Items are equal to True Action

Fire On Page Load "Yes" (don't know if this is really necessary)

------------------------------------------------------------------------------------------

Actually I'm not able to setup something which works.

For a LOV / Select List I defined static values

----------------------------------------------------

STATIC:OLD;Return1,NEW;Return2

----------------------------------------------------

The Dynamic Action config will then be:

---------------------------------------------

Event: Change

Selection Type: Item(s)

Item(s): <My Select List Item>

Condition: equal to

Value: OLD

---------------------------------------------

In case of a button or a checkbox I'm a bit confused about the value I have to use in condition of the Dynamic Action.

For checkboxes I read about

-----------------------------

Condition: in list

Value: others

-----------------------------

For buttons I don't have any idea.

I would prefer a solution with a button but as explained currently non of my attemps seems to work.

Thanks in advance for any assistance.

Tagged:
Mahmoud_Rabie

Best Answer

  • MaLau
    MaLau Member Posts: 34 Blue Ribbon
    edited Jul 11, 2016 9:51AM Accepted Answer

    Here is how I solved it on my own now. Thanks to Mahmoud, at the end it proably works nearly equal like described in discussion: Re: Dynamically show/hide columns in IR Reports

    As mentioned in my case I had to show/hide fields in a DML Form.


    Solution:
    (setup the DML Form or IR is straight forward and nothing specific has to be configured -> so it will not be described in the solution below)
    ##################################################################
    Define a new page item 
    ----------------------------------------------
    Identification
    Name: "P<NUMBER_OF_THE_PAGE>_STORAGE_LAYOUT" 
    Type: "Radio Group"
     

    List of Values
    Type: "Static Values"
    Static Values: "STATIC:New;1,Old;0"
    Display Extra Values: No
    Display Null Value: No
     
    (optional - if the value itself should be stored in the related table of DML Form or IR)
    Source
    Type: "Item"
    Name: "P<NUMBER_OF_THE_PAGE>_STORAGE_LAYOUT"
    ----------------------------------------------
     
    Add a Dynamic Action to the created item (right mouse button "Create Dynamic Action" or use the "Dynamic Actions"-Menu)
    ----------------------------------------------
    Identification
    Name: "NEW-OLD_STORAGE_LAYOUT"
     
    When
    Event: "Change"
    Selection Type: "Item(s)"
    Item(s): "P<NUMBER_OF_THE_PAGE>_STORAGE_LAYOUT"
    Condition: "equal to"
    Value: "1"
     
    True Action
    --------------
    Identification 
    Action "Hide"
     
    Affected Elements
    Selection Type: "Item(s)"
    Item(s): "<Item(s) you wanna hide/show>"
     
    Execution Options
    Event: "NEW-OLD_STORAGE_LAYOUT"
    Fire When Event Result Is: "True"
    Fire On Page Load: Yes
    --------------
     
    False Action (right mouse button on the new Dynamic Action "Create FALSE Action")
    --------------
    Identification 
    Action "Show"
     
    Affected Elements
    Selection Type: "Item(s)"
    Item(s): "<Item(s) you wanna hide/show>"
     
    Execution Options
    Event: "NEW-OLD_STORAGE_LAYOUT"
    Fire When Event Result Is: "False"
    Fire On Page Load: No
    --------------
    ----------------------------------------------
    ##################################################################
     
    Now it is possible to show and hide fields for the mount points I talked about via New/Old Radio button selection.
    The trigger item could also be a "Select List", a check-box or a Button. (defining the static value is mostly equal to the example above, except for a button ... I was not able to configure a button to switch between true and false state).

    Mahmoud_Rabie

Answers

  • Mahmoud_Rabie
    Mahmoud_Rabie Cloud Solution Architect, Member Posts: 3,216 Bronze Crown
    edited Jul 6, 2016 9:57PM

    Hi MaLau

    I hope these threads help or solve your problem

    Regards

    Mahmoud

    MaLau
  • MaLau
    MaLau Member Posts: 34 Blue Ribbon
    edited Jul 7, 2016 5:58AM

    Hi Mahmoud,

    thanks for your reply.

    I made a little mistake in the question so I have to hide/show fileds in a DML Form and not an IR.

    Anyway it will probably work in a nearly similar way.

    I will update this discussion when (and how) it works.

    Regards,

    Martin

  • MaLau
    MaLau Member Posts: 34 Blue Ribbon
    edited Jul 11, 2016 9:51AM Accepted Answer

    Here is how I solved it on my own now. Thanks to Mahmoud, at the end it proably works nearly equal like described in discussion: Re: Dynamically show/hide columns in IR Reports

    As mentioned in my case I had to show/hide fields in a DML Form.


    Solution:
    (setup the DML Form or IR is straight forward and nothing specific has to be configured -> so it will not be described in the solution below)
    ##################################################################
    Define a new page item 
    ----------------------------------------------
    Identification
    Name: "P<NUMBER_OF_THE_PAGE>_STORAGE_LAYOUT" 
    Type: "Radio Group"
     

    List of Values
    Type: "Static Values"
    Static Values: "STATIC:New;1,Old;0"
    Display Extra Values: No
    Display Null Value: No
     
    (optional - if the value itself should be stored in the related table of DML Form or IR)
    Source
    Type: "Item"
    Name: "P<NUMBER_OF_THE_PAGE>_STORAGE_LAYOUT"
    ----------------------------------------------
     
    Add a Dynamic Action to the created item (right mouse button "Create Dynamic Action" or use the "Dynamic Actions"-Menu)
    ----------------------------------------------
    Identification
    Name: "NEW-OLD_STORAGE_LAYOUT"
     
    When
    Event: "Change"
    Selection Type: "Item(s)"
    Item(s): "P<NUMBER_OF_THE_PAGE>_STORAGE_LAYOUT"
    Condition: "equal to"
    Value: "1"
     
    True Action
    --------------
    Identification 
    Action "Hide"
     
    Affected Elements
    Selection Type: "Item(s)"
    Item(s): "<Item(s) you wanna hide/show>"
     
    Execution Options
    Event: "NEW-OLD_STORAGE_LAYOUT"
    Fire When Event Result Is: "True"
    Fire On Page Load: Yes
    --------------
     
    False Action (right mouse button on the new Dynamic Action "Create FALSE Action")
    --------------
    Identification 
    Action "Show"
     
    Affected Elements
    Selection Type: "Item(s)"
    Item(s): "<Item(s) you wanna hide/show>"
     
    Execution Options
    Event: "NEW-OLD_STORAGE_LAYOUT"
    Fire When Event Result Is: "False"
    Fire On Page Load: No
    --------------
    ----------------------------------------------
    ##################################################################
     
    Now it is possible to show and hide fields for the mount points I talked about via New/Old Radio button selection.
    The trigger item could also be a "Select List", a check-box or a Button. (defining the static value is mostly equal to the example above, except for a button ... I was not able to configure a button to switch between true and false state).

    Mahmoud_Rabie
This discussion has been closed.