This discussion is archived
1 2 Previous Next 29 Replies Latest reply: May 20, 2010 7:33 AM by fac586 Go to original post RSS
  • 15. Re: Standard tabs - Burned into the page?
    357241 Oracle ACE
    Currently Being Moderated
    Hello,

    Truthfully it's more a example of how powerful Named Row templates are. I've been messing with them lately to create JSON constructs (now imagine that with a little AJAX based pagination attached) but in doing that I've found all sorts of uses for them.

    I've wrote about it a little before http://carlback.blogspot.com/2006/11/fun-with-report-templates.html but I think they are one of the more underused yet powerful features in APEX.

    Carl
  • 16. Re: Standard tabs - Burned into the page?
    VANJ Journeyer
    Currently Being Moderated
    <p>Carl: That is simply brilliant, you are a genius!

    <p>APEX named row templates, JSON, AJAX, now there is a heady mix of buzzwords, can't possibly imagine what you are cooking up with all that, the suspense is killing me!

    <p>Thanks
  • 17. Re: Standard tabs - Burned into the page?
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    Carl,

    Is this page supposed to show how it works or is it just a sample code for the
    solution Vikas asked for?

    Denes Kubicek
  • 18. Re: Standard tabs - Burned into the page?
    Arie Geller Guru
    Currently Being Moderated
    Hello Denes,

    This page gives you a generic example (and a very smart one, IMHO)of how to use the Named Row report template in order to create any kind of tabs you need. The resource for the tab labels and tab links is a db table you can query, using SQL.

    In order for Vikas to use this solution, all he needs to do is to condition the report region according to his show/hide tab needs.

    Are you missing something in particular in the example?

    Regards,
    Arie.
  • 19. Re: Standard tabs - Burned into the page?
    Arie Geller Guru
    Currently Being Moderated
    Hi Carl,
    " It actually much more powerful than the built in tabs …"
    It just hit me – with the proper db table and a where clause in the SQL, you can actually create a personalized tab system, based on user name, security etc. Really powerful stuff.

    Thanks a lot for sharing,
    Arie.
  • 20. Re: Standard tabs - Burned into the page?
    Arie Geller Guru
    Currently Being Moderated
    Hello,

    I believe the following SQL code will display the same application tab set, so it can be maintain in one place only, and with the built-in tab system tools:
    select tab_label as "TAB_LABEL",'doSubmit("'||tab_name||'");' as "TAB_LINK"
    from apex_application_tabs
    where application_id = :APP_ID
    order by display_sequence
    Regards,
    Arie.
  • 21. Re: Standard tabs - Burned into the page?
    VANJ Journeyer
    Currently Being Moderated
    Arie: You beat me to it! I was thinking of the same thing (querying apex_application_tabs). That would give the best of both worlds, define the tabs declaratively and instead of attaching the tabset to the page, use Carl's technique.

    Some things to keep in mind when using this technique

    1. Standard tabs submit the page so form inputs are saved into session state. If you code the TAB_LINK as a regular link (not a submit), form inputs will be discarded

    2. If you use doSubmit as the TAB_LINK (as Arie showed), the page will be submitted and form inputs will be saved but you need to do something special to branch to the next page (This is not an issue when using regular tabs because the accept processing engine "knows" that a tab has been pressed and branches to the target page)

    I gues we could use an after-submit application process that does
    apex_application.g_unrecoverable_error := true;
    owa_util.redirect_url(:REQUEST);
    Assuming you put TAB_LINK in your doSubmit, of course. Adjust as necessary depending on whether TAB_LINK is just a page id or the entire URL.

    3. To hide/show specific tabs conditionally, it is quite easy using the builtin tabs, just code the condition on the tab itself.

    With this technique, you would need to write all those conditions into your SQL

    To use Arie's example
    select tab_label,tab_link from (
    select tab_label as "TAB_LABEL",'doSubmit("'||tab_name||'");' as "TAB_LINK",
    case when <some condition> then 'Y' else 'N' show_tab
    from apex_application_tabs
    where application_id = :APP_ID
    order by display_sequence
    ) where show_tab='Y'
    Thanks
  • 22. Re: Standard tabs - Burned into the page?
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    Arie, I was just asking myself what this thing is good for. I saw some code and nothing else.
    When trying to click on other tabs I got an error. That was a reason for my question. I guess
    I understand the things better visually.

    Denes Kubicek
  • 23. Re: Standard tabs - Burned into the page?
    357241 Oracle ACE
    Currently Being Moderated
    Hello,


    Yeah sorry I should have made working links, I'll see if I can fix that up today. I just figured to show the most generic case.

    The one thing I think this would be really useful for most people is to create user driven tabs systems. Like adding a tab in my.yahoo.com or the personalized google home page. If you building some sort of information dashboard allowing the end user the ability to customize at least portions of their main navigation will sell some seats, people love messing with that stuff.

    Carl
  • 24. Re: Standard tabs - Burned into the page?
    Arie Geller Guru
    Currently Being Moderated
    Hi Vikas,
    " If you use doSubmit as the TAB_LINK (as Arie showed), the page will be submitted and form inputs will be saved but you need to do something special to branch to the next page (This is not an issue when using regular tabs because the accept processing engine "knows" that a tab has been pressed and branches to the target page)"
    I've played in the past with #TAB_LINK# and if you'll check the source code you'll see it is only being substitute with doSubmit('T_....'); . I suspect the processing engine "knows" it is a tab just by the tab naming convention – prefix T_. So I believe that if you are using the TAB_LINK from the apex_application_tabs view, you don't need to worry about the branching. If you're creating your own link repository, your suggestion seems like a good solution.
    " Standard tabs submit the page so form inputs are saved into session state. If you code the TAB_LINK as a regular link (not a submit), form inputs will be discarded"
    Sometimes I prefer it this way (as you said, the opposite of the default tab behavior). I'm trying to educate my users to take an explicit action – pressing a button – whenever they want to save something on page. It seems that for some of the users, the intuitive behavior of a tab is like pressing "esc" or "cancel". All they want is to leave the current page in favor of another. Usually I encourage this behavior, as it is consistent with the behavior of pagination in tabular forms. Users learned that in order to save their work they need to press "submit" and any other action can result in them losing their work.

    Since I've read Carl's blog, I've been playing around with the Named Row report template, and I totally agree with him – this is very powerful tool. I can certainly understand why this is his new favorite.

    Regards,
    Arie.
  • 25. Re: Standard tabs - Burned into the page?
    369835 Newbie
    Currently Being Moderated
    Carl,

    I'm very new to Apex so sorry if this is a daft question.

    I'd like to utilise your trick for the sql-driven tabs and have followed (at least I think I have!) your steps but I don't know how to make my pages use this new template. Every page in my applications uses One Level Tabs and I can't figure out how to change them to use the new copy I've called SQL One Level Tabs.

    Also, where do I put my sql ?

    Sorry if these are daft questions

    Cheers

    Scott
  • 26. Re: Standard tabs - Burned into the page?
    608392 Newbie
    Currently Being Moderated
    Hi,

    Made changes to the Select table as it appears there is a small change for the newer 3.1.1 version.

    select tab_label as "TAB_LABEL",'javascript:doSubmit('''||tab_name||''');' as "TAB_LINK"
    from apex_application_tabs
    where application_id = :APP_ID
    order by display_sequence

    I have all the tabs rendered, but when I press the button, I am getting an error as previously suggested by Vikas.

    ERR-1777: Page 6 provided no page to branch to. Please report this error to your application administrator.

    Restart Application


    So the behaviour of the dynamic tabs changed since Carl, Vikas and you have worked out this solution back at the end of 2006.

    Can any one look into this problem, and update the solution please. This is a brilliant solution, but I feel it is broken now.

    Thanks.

    John
  • 27. Re: Standard tabs - Burned into the page?
    608392 Newbie
    Currently Being Moderated
    Small breakthrough:

    By replacing the query with the following, I am now able to make the dynamic menus work:

    select tab_label as "TAB_LABEL",
    'f?p=&APP_ID.:'||tab_page||':&SESSION.::&DEBUG.:' as "TAB_LINK"
    from apex_application_tabs
    where application_id = :APP_ID
    order by display_sequence

    I still have the issue where I don't know what is the current tab. All suggestions will be appreciated.

    John
  • 28. Re: Standard tabs - Burned into the page?
    774224 Newbie
    Currently Being Moderated
    Hi

    I followed this thread and I was able to make the report that has the same functionallity as the tabs in APEX + the extra functionality. At present however I have created already some pages in my application. Is there a way to make the tab-report appearing on all this pages without adding it physically to the page.

    Kind regard
  • 29. Re: Standard tabs - Burned into the page?
    fac586 Guru
    Currently Being Moderated
    Is there a way to make the tab-report appearing on all this pages without adding it physically to the page.
    Put the tab replacement report in the appropriate region on Page Zero.

    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/ui.htm#sthref1406


    (Please don't post follow-ups to ancient threads: post a new thread of your own, and reference any previous thread(s) you think are relevant using the formatting options described in the FAQ:

    http://wiki.oracle.com/page/Oracle+Discussion+Forums+FAQ

    Also, if you have not already done so, please update your forum profile with a better handle than "user8902028".)
1 2 Previous Next