Forum Stats

  • 3,828,022 Users
  • 2,260,848 Discussions
  • 7,897,433 Comments

Discussions

How do I set the #REGION_ID# from the region template?

BillC
BillC Member Posts: 1,069 Bronze Badge
edited Sep 1, 2008 1:59PM in APEX Discussions
Hi,
I know where to set the #REGION_STATIC_ID#
in a region template but can't find the text field or way to set the #REGION_ID#.

Once it is set I am hoping to access it in Javascript as the table id of the report table.
Am I on the right track?
Where do I set it?

Bill
Tagged:

Answers

  • John Edward Scott
    John Edward Scott Member Posts: 5,475 Gold Badge
    Hi Bill,

    Why can't you use REGION_STATIC_ID to do that?

    John.
    --------------------------------------------
    http://jes.blogs.shellprompt.net
    http://www.apex-evangelists.com
  • BillC
    BillC Member Posts: 1,069 Bronze Badge
    Because you have to use a modified template don't you?
    The normal Reports Region that I use has #REGION_ID#as a normal ID just don't know how to access it..
  • BillC
    BillC Member Posts: 1,069 Bronze Badge
    Well I just changed the #REGION_ID# in the standard template to #REGION_STATIC_ID# just to see if I'm on the right track.

    But APEX puts another table within this "Region" table so this ID is accessing the wrong table.

    How do I put an id on something within a report without using the APEX_ITEMs. I do it all the time with APEX_ITEMs but I was hoping to learn how to do it with the generic report.
  • Arie Geller
    Arie Geller Member Posts: 4,183 Gold Trophy
    Hello Bill,

    >> but can't find the text field or way to set the #REGION_ID#.

    The #REGION_ID# substitution string is being set, internally, by the APEX engine, and you can’t change it (because this value is one of the PK identified the region).

    So, your options are to use #REGION_STATIC_ID#, which you can set as you need, or the original #REGION_ID#, and retrieve its value from the APEX dictionary.

    >> Because you have to use a modified template don't you?

    Yes. You need to substitute #REGIN_ID# with #REGIN_STATIC_ID#. The APEX engine is smart enough to substitute this string with the original region id, if you didn’t provide a value for the static id (which means you have backward compatibility for regions without static id).

    >> But APEX puts another table within this "Region" table so this ID is accessing the wrong table.

    I don’t know thr theme you are working with, but as far as I know, if you modifying the template, the static id will replace the original id, and not on top of it.

    The normal Reports Region that I use has #REGION_ID#as a normal ID just don't know how to access it..

    If, for any reason, you want to continue using the original region id, you can retrieve it from the APEX dictionary. You can use similar code to the following:

    Select region_id
    from APEX_APPLICATION_PAGE_REGIONS
    where application_id=:APP_ID
    and page_id=:APP_PAGE_ID
    and region_name=<<region name>>

    Regards,
    Arie.
  • 357241
    357241 Member Posts: 3,791
    Hello,

    If your trying to get access to the region body or some other element of the region you can also do something like

    id="#REGION_STATIC_ID#_body"

    if you look at some of the newer themes you'll see that in places.

    Carl
  • BillC
    BillC Member Posts: 1,069 Bronze Badge
    Hi Carl,

    It work great to access the "Region" table, But the table I see I really need to access is the one within the region.

    I'm trying to just add rows to a report with JS. I have 2 reports, 1 that shows the rows in my XREF table and 1 that I select the rows to insert into the XREF table.

    When I click on the id of a row to move it hides that row, AJAX inserts it to that XREF table and then I add the row to the table just to show that it was moved.

    Can I access that inner table easily? One idea was to you the APEX_ITEM to give each row an id so I can cascadeUpTil get to the TABLE but it doesn't work if there is no rows. No rows, no IDs available.

    Thank you, Bill
  • fac586
    fac586 Senior Technical Architect Member Posts: 20,981 Red Diamond
    edited Sep 1, 2008 1:59PM
    If your trying to get access to the region body or some other element of the region you can also do something like

    id="#REGION_STATIC_ID#_body"

    if you look at some of the newer themes you'll see that in places.
    I've had some problems with that.

    2573425
This discussion has been closed.