This discussion is archived
1 2 Previous Next 17 Replies Latest reply: Nov 21, 2013 7:31 PM by scott.wesley RSS

How to dynamically change the region name

pawankumaar Newbie
Currently Being Moderated

Hi,

 

How to change the region name dynamically with respect to item value.

 

Regards,

pavan

  • 1. Re: How to dynamically change the region name
    backintheday Explorer
    Currently Being Moderated

    Creating a page item, such as P6_REGION_TITLE, can then be referenced by including &P6_REGION_TITLE. when editing the region's title.  The page item can then be dynamically altered as needed.  Does this answer your question?

     

    -Seth.

     

    Update: I forgot to mention this will likely require you to submit the page. Perhaps javascript can address a dynamic change without submitting the page. Even a refresh of the region won't work.  (FYI, I'm in APEX 4.2.3).

     

    Message was edited by: backintheday Info about page submit needed.

  • 2. Re: How to dynamically change the region name
    vdsadhi Journeyer
    Currently Being Moderated

    Additional info..

     

    Set Value to the page item which you created for region title based on your item change.

     

    Thanks

    Lakshmi

  • 3. Re: How to dynamically change the region name
    pawankumaar Newbie
    Currently Being Moderated

    Hi seth,

     

    I know  this what u suggested as stated below

     

    Creating a page item, such as P6_REGION_TITLE, can then be referenced by including &P6_REGION_TITLE. when editing the region's title...

     

    k i will tel u the scenario i have transaction type column as lov with values like INWARD,INWARD RETURN ,OUTWARD ,OUTWARD RETURN ...

     

    i have two region with dynamical title &P2_REGION_TITLE. and &P6_REGION_TITLE1........

     

    if i choose transaction type as INWARD or INWARD RETURN  region 1 title to be RECEIPENT DETAILS and region 2  to be SENDER DETAILS........

     

    and i choose transaction type as OUTWARD ,OUTWARD RETURN region 1 title to be SENDER DETAILS  and region 2  to be RECEIPENT DETAILS...

     

     

    please tel me how to handle it.

     

    Thanks

    Pavan

  • 4. Re: How to dynamically change the region name
    pawankumaar Newbie
    Currently Being Moderated

    Hi lakxhmi,

     

    I tried set value with plsql function body..

     

    but it is not working....

     

    Thanks,

    Pavan

  • 5. Re: How to dynamically change the region name
    backintheday Explorer
    Currently Being Moderated

    Pawankumaar,

     

    Take a look at the following:

     

    http://apex.oracle.com/pls/apex/f?p=61075:6

     

    If this is what you are trying to do, let me know; and I will explain how it was done. Remember, though, each change requires a page submit.

     

    -Seth.

  • 6. Re: How to dynamically change the region name
    backintheday Explorer
    Currently Being Moderated

    Pawankumaar,

     

    I forgot to tell you that the username and password are demo/demo.

     

    -Seth.

  • 7. Re: How to dynamically change the region name
    pawankumaar Newbie
    Currently Being Moderated

    hi seth,

     

    ya absolutely can u plz tel me in steps..

     

    thanks,

    pavan

  • 8. Re: How to dynamically change the region name
    backintheday Explorer
    Currently Being Moderated

    Pavan,

     

    A region called Transactions has a page item called P6_TRANS_TYPE which is a select list with your static list of values...

     

    STATIC:INWARD,INWARD RETURN,OUTWARD,OUTWARD RETURN

     

    A region called &P6_REGION_TITLE_1. has a page item called P6_REGION_TITLE_1 which is a hidden item with 'Value Protected' set to No.

     

    A region called &P6_REGION_TITLE_2. has a page item called P6_REGION_TITLE_2 which is a hidden item with 'Value Protected' set to No.

     

    A dynamic action called 'Set Values for Region Titles' with an event of 'Change' for P6_TRANS_TYPE has 3 true actions...

     

    1. Set Value as a PL/SQL Expression with 'Page Items to Submit' as P6_TRANS_TYPE and 'Affected Element' as P6_REGION_TITLE_1:

    CASE WHEN :P6_TRANS_TYPE LIKE 'INWARD%'

         THEN 'RECIPIENT DETAILS'

         ELSE 'SENDER DETAILS' END

     

    2. Set Value as a PL/SQL Expression with 'Page Items to Submit' as P6_TRANS_TYPE and 'Affected Element' as P6_REGION_TITLE_2:

    CASE WHEN :P6_TRANS_TYPE LIKE 'INWARD%'

         THEN 'SENDER DETAILS'

         ELSE 'RECIPIENT DETAILS' END

     

    3. Submit Page with 'Request/Button Name' as P6_TRANS_TYPE

     

    Let me know if you have any questions.

     

    -Seth.

  • 9. Re: How to dynamically change the region name
    pawankumaar Newbie
    Currently Being Moderated

    Hi seth,

     

    region title is changing dynamically  but for every action that transaction type  is reassigning to INWARD oly....

     

    Thanks,

    pavan

  • 10. Re: How to dynamically change the region name
    pawankumaar Newbie
    Currently Being Moderated

    Hi seth,

     

    Initially the transaction type ll be INWARD den region 1 to be RECEIPENT DETAILS den region2 ll be SENDER DETAILS wen the page initially loads right but it is not like that  both the region title ll be empty....

     

    I forget to say onething i already had dynamic action on  tat item whether it reflects any where to it...nd tat action(dynamically hiding the another region) is  also not working ..........

     

    Thanks,

    Pavan

  • 11. Re: How to dynamically change the region name
    backintheday Explorer
    Currently Being Moderated

    Pavan,

     

    Please check your code for a mistake that might result in every transaction type reassigning to INWARD.  The code obviously work as I have already shown.

     

    In regards to the other problems like the empty region titles, I made some changes to the demo I shared with you...

     

    A new dynamic action called 'Set Value on Page Load' with an event of 'Page Load' has 1 true action:

    Set Value as a PL/SQL Function Body with 'Affected Element' as P6_TRANS_TYPE:

    RETURN NULL;

     

    For the P6_REGION_TITLE_1 page item, set the source as PL/SQL Expression:

    CASE WHEN :P6_REGION_TITLE_1 IS NULL THEN 'RECIPIENT DETAILS' END

     

    For the P6_REGION_TITLE_2 page item, set the source as PL/SQL Expression:

    CASE WHEN :P6_REGION_TITLE_2 IS NULL THEN 'SENDER DETAILS' END

     

    Please revisit the apex.oracle.com page I posted earlier.

     

    -Seth.

  • 12. Re: How to dynamically change the region name
    backintheday Explorer
    Currently Being Moderated

    I don't understand what you are trying to say about trying to hide another region.  Let's get this first part working, then we can look at other problems you are having.

  • 13. Re: How to dynamically change the region name
    scott.wesley Guru
    Currently Being Moderated

    Here is a post I've just written on the topic

    Grassroots Oracle: APEX 101 - Set region title on page load

  • 14. Re: How to dynamically change the region name
    pawankumaar Newbie
    Currently Being Moderated

    Thanks to all..

     

    Finally i got the solution..

    I created  2 dynamic actions separately which is suggested by seth

     

                   Set Value as a PL/SQL Expression with 'Page Items to Submit' as P6_TRANS_TYPE and 'Affected Element' as P6_REGION_TITLE_1:

    CASE WHEN :P6_TRANS_TYPE LIKE 'INWARD%'

         THEN 'RECIPIENT DETAILS'

         ELSE 'SENDER DETAILS' END

     

                    Set Value as a PL/SQL Expression with 'Page Items to Submit' as P6_TRANS_TYPE and 'Affected Element' as P6_REGION_TITLE_2:

    CASE WHEN :P6_TRANS_TYPE LIKE 'INWARD%'

         THEN 'SENDER DETAILS'

         ELSE 'RECIPIENT DETAILS' END

     

    and added one more true in each DA like

      1. Action: Set Value
      2. Fire On Page Load: No
      3. Set Type: JavaScript Expression

        $v('P6_REGION_TITLE_1')

      4. Selection Type: DOM Object

        REGION_TITLE1

     

    Change the region title to <span id="REGION_TITLE1">&P6_REGION_TITLE_1.</span>


    In order to refresh existing DA


    Note: Refresh dynamic action only updates the area of the region that changes, rather than the entire HTML block for the region. The title bar is outside of the updated area.

     

    This therefore needs to be done dynamically, by making a slight modification to the region and adding another true action to the Refresh DA

     

    Thanks,

    Pavan

1 2 Previous Next

Legend

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