This discussion is archived
8 Replies Latest reply: May 24, 2013 2:29 AM by 1010593 RSS

how to add some fields in a form given a certain condition?

1010593 Newbie
Currently Being Moderated
hi,
on a page apex I have a form based on a table of about 10 fields, only 5 fields are visible, the other 5 fields must be visible when a field of the top 5 is true.

Example: First field = name Second field=surname third field = age ; if age is> 18 then add more fields to the form.

I thought of a PL / SQL procedure but do not know how to begin?
Please help me.
thanks in advance
  • 1. Re: how to add some fields in a form given a certain condition?
    Nicolette Expert
    Currently Being Moderated
    1007590

    Since you don't mention your apex version I assume you are using apex 4.0 or above.

    Do the 5 hidden items need to appear when the user enters the data.
    If so use dynamic actions Show and Hide.

    If de condition of displaying the items is only necessary on time of page rendering use the condition attributes of the items.

    Nicolette
  • 2. Re: how to add some fields in a form given a certain condition?
    1010593 Newbie
    Currently Being Moderated
    Hi Nicolette,

    now I try the dynamic action.
    thank you very much
  • 3. Re: how to add some fields in a form given a certain condition?
    1010593 Newbie
    Currently Being Moderated
    Hi,

    I created a dynamic action but does not work.
    I selected the item concerned with the condition.
    is a flag of type char (1), and when I entered is equal to TRUE.
    I specified the action TRUE: show other items
    I did not specify the action to FALSE.
    It does not work ....
    I do something wrong?
    Thanks
  • 4. Re: how to add some fields in a form given a certain condition?
    Nicolette Expert
    Currently Being Moderated
    1007590
    1007590 wrote:
    Hi,

    I created a dynamic action but does not work.
    I selected the item concerned with the condition.
    is a flag of type char (1), and when I entered is equal to TRUE.
    Do you mean the condition type is equal to and the value TRUE for the dynamic action?
    How can a item that holds only one character ever be equal to the word TRUE.

    What should be entered in the item for the others to be shown?

    Check out this [url http://apex.oracle.com/pls/apex/f?p=VANBAREN_FORUM_TRY_OUT:SHOWHIDE::::::?c=VANBAREN]demo.

    Check the checkbox and a item will be shown.
    Or type in the word TRUE in the text item. A different item will be shown.

    In the Dynamic actions region you will find the different settings of the dynamic actions and actions used.

    Nicolette
  • 5. Re: how to add some fields in a form given a certain condition?
    1010593 Newbie
    Currently Being Moderated
    Hi Nicolette,

    you're right I changed the value of the flag (char (1)) with Y instead of true, but it does not work.
    Hidden fields should become editable in the same form.
    I tried many times but it does not work.

    Here are the steps:
    1 - type of dynamic action = standard
    2 = action-name show_fields
    3-Specify when you finish would like the Dynamic Action to fire:
    selection-type = ITEMS
    Items = flag
    condition equal to Y
    4 - specify the action TRUE =show
    5 - Select Which page elements you would like the dynamic action to control = ITEMS (here insert the hidden items from view).

    maybe I'm wrong step No. 5?
    thanks for the help
  • 6. Re: how to add some fields in a form given a certain condition?
    1010593 Newbie
    Currently Being Moderated
    you're right I changed the value of the flag (char (1)) with Y instead of true, but it does not work.
    Hidden fields should become editable in the same form.
    I tried many times but it does not work.

    Here are the steps:
    1 - type of dynamic action = standard
    2 action-name = show_ fields
    3-Specify when you finish would like the Dynamic Action to fire:
    selection-type = ITEMS
    Items = flag
    condition equal to Y
    4 - specify the action TRUE = show
    5 - Select Which page elements you would like the dynamic action to control = ITEMS (here insert the hidden items from view).

    maybe I'm wrong step No. 5?
    thanks for the help
  • 7. Re: how to add some fields in a form given a certain condition?
    Nicolette Expert
    Currently Being Moderated
    1007590

    The items that are initial hidden how are they defined?
    You have to define these as where they displayed.

    So the editable item that be shown when the flag is set should not be defined as a hidden item.

    If you still have trouble set up a demo of what you have so far on apex.oracle.com.
    And post the login credentials of a guest developer so I can have look.

    Nicolette
  • 8. Re: how to add some fields in a form given a certain condition?
    1010593 Newbie
    Currently Being Moderated
    HI,

    now it works
    I changed the hidden items in textfield.
    thank you very much

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points