This discussion is archived
12 Replies Latest reply: Jan 8, 2013 2:46 PM by 931325 RSS

Dynamic Tab UI Shell - close tab action & number of open tabs control

931325 Explorer
Currently Being Moderated
Hi,
I browsed through the forum, but could not get hold of any concrete solution for the question on how to capture the close tab action event and perform some action on that?
The below thread discusses my question but does not appear to have a proper solution
Re: Dynamic Tab UI Shell: controlling the Close icon

And one other question is, currently in the TabContext the number of open tabs is set to 15 limit. How can I override that such that I do not allow more than 7 tabs open at a time?

Please help me with the above two queries. Thanks !

Regards,
SS
  • 1. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    My jdev version is 11.1.2.0.0. To add further information to my query, I need to check for any data change in each page fragment before closing and prompt a message (Tab Dirty message). Please let me know your thoughts.

    Thanks !
  • 2. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    Sudipto Desmukh Expert
    Currently Being Moderated
    See if this has any info which can be of help ->
    http://www.oracle.com/technetwork/issue-archive/2012/12-mar/o22adf-1518265.html
  • 3. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    Thanks Sudipto. From the above link(way too helpful), I understand that we can inject the tabContext across btf's and set the markCurrentTabDirty to true. But I'm still struggling to figure out, where I should be setting the flag to true since the user would just enter data on the form and without saving can click on the tab close icon. Though from the AM transaction dirty attribute I can find whether anything is really changed on the page, I'm not sure as to on what action I can set that to the tabContext.markCurrentTabDirty?

    Any thoughts?
  • 4. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    Frank Nimphius Employee ACE
    Currently Being Moderated
    Hi,

    the sample you can download from this article sets the tab dirty indicator when users submit the edit form. For this the submit button action (or if you want to use a value change listener) accesses the tabContext bean class that the dynamic tab shell template passes as an input parameter to the called task flow in the region. You just need to make sure your task flow has an input parameter for the tabIndex. So basically the article has exactly the solution you are looking for.

    For reducing the limit of opened tabs from 15 to 7 you have two options.

    1. Control the number of opened tabs using the tabContext API. So whenever users want to open a new tab, just check for how many tabs are currently open
    2. Download the dynamic tab shell sources and create your own custom template from it. This however will de-couple your custom template from any future changes in the default template (which for some customers however appears to be okay)

    Frank
  • 5. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    Thanks for your response Frank. I went through the sample application, it was really helpful, but, say I have several input text/dropdowns/etc components on my screen, having a valuechange listener for each & every component does not sound to be an optimal solution. Isn't there a way I can track the closeIcon ActionEvent?

    And regarding controlling the number of open tabs, yes that works good. Thank you.
  • 6. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    Can anyone please let me know how we can track the closeIcon ActionEvent on the Tab?
  • 7. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    It is surprising why is it that the control for close icon action of the panel tab on the dynamic UI Shell template is not available since I believe this is one of the most common scenario. Or there is pretty good chance that I'm overlooking something and struggling to understand it.

    There are say 60+ components on the page, instead of having a value change for each component, leaving the implementation of the closeIcon action to the developer should help solve lot of issues. I was planning to do this in the close Icon action on the panel tab (as per the article in https://blogs.oracle.com/groundside/entry/ever_wondered_how_uncommitteddatawarning_works)

    ViewPortContext rootViewPort = ControllerContext.getInstance().getCurrentRootViewPort();
    boolean uncommittedChanges = rootViewPort.isDataDirty();

    Any pointers would be of real great help. Thanks

    Edited by: SS on Jun 19, 2012 4:48 PM
  • 8. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    any thoughts....?

    Edited by: SS on Jun 26, 2012 1:31 PM
  • 9. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    Just to give an update on where I am with this one...May be will be helpful to someone else as well...

    I am planning to try out the below two things...
    1) http://www.oracle.com/technetwork/developer-tools/adf/learnmore/79-global-template-button-strategy-360139.pdf (for the close button action)
    2) http://soadev.blogspot.com/2010/03/customising-dynamic-tab-shell.html (for other layout adjustments)

    Will update the thread later with more concrete updates. In the meantime, if there is any other simpler way, please let me know. Appreciate all your responses. Thanks !
  • 10. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    Frank Nimphius Employee ACE
    Currently Being Moderated
    Hi,

    not that the close event is a functionality planned for a revisd version of the dynamic tab. So if you go with the default packaged tab shell template, your application at some point will start consuming the template that has the event on board. However I don't know which version of the template is the target version for this

    Frank
  • 11. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    Ok. Thanks for the info Frank.

    Since we cannot wait until then, some time soon, I'll try to follow the above links and try to implement it. However, as per your response earlier, I understand that this de-couples any future updates to the template.
  • 12. Re: Dynamic Tab UI Shell - close tab action & number of open tabs control
    931325 Explorer
    Currently Being Moderated
    Sorry for so much delay. Finally, got some time to play with the template and downloading the dynamicTabTemplate source code and overriding the closeIcon worked like a charm.
    Let me summarize what I did to help someone who is looking for this :)
    1) Downloaded the source code for dynamicTabTemplate
    2) Added and additional attribute closeTab to the template
    +<attribute>+
    +<attribute-name>closeTab</attribute-name>+
    +<attribute-class>java.lang.String</attribute-class>+
    +<required>+
    true
    +</required>+
    +</attribute>+
    2) edited the dynamicTabShell.jspx, closeIcon commanlink actionListener to be bound to "#{viewScope.tabContext.closeIcon}"
    3) Implemented the closeIcon method in TabContext
    +@Override+
    +public void closeIcon(ActionEvent actionEvent) {+
    CloseIconInterface bean = getBean();
    bean.closeIcon(actionEvent);
    +}+
    4) Generated the jar.
    5) Removed the oracle provided default dynamicTabTemplate jar and instead added my custom generated jar to the application
    6) Applied the new template
    7) Set all the attributes along with the new closeTab attribute. This would take the BackingBean name...example: <f:attribute name="closeTab" value="#{xxxScope.xxxBean}"/>
    8) Made xxxBean to implement CloseTabInterface
    9) Implemented the closeIcon method with custom code to confirm page close before removing the Tab.

    However like you said, i'll keep tab on future updates to the default tab template updates to not miss any bug fixes or enhancements.

    Thanks everyone who looked into this for me and Hope this helps someone else :)...Good luck !

Legend

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