Programatically making a tab dirty in UI Shell

Hi,
Is there any other way to check whether the current tab is dirty before closing it apart from the one given in doc?
Thanks.

In the method that is invoked on tab close:
boolean isTransDirty = false; // holds the transaction state of the dynamic tab content for which close event is fired
try{
DCBindingContainer dcBindingContainer = (DCBindingContainer) AdfUtils.resolveExpression("#{bindings}");
dcBindingContainer = (DCBindingContainer)dcBindingContainer.getExecutableBindings().get(this.getSelectedTabIndex());
if(dcBindingContainer != null){
for( Object exeBinding : dcBindingContainer.getExecutableBindings() ) {
isTransDirty = isTransDirty(exeBinding);
if(isTransDirty){
break;
System.out.println(" is Trans Dirty : " + isTransDirty);
}catch(Exception e){
e.printStackTrace();
// method isTransDirty(Object ..)
private boolean isTransDirty(Object exeBinding){
boolean isDirty = false;
try{
if(exeBinding instanceof JUIteratorBinding ){
JUIteratorBinding juIteratorBinding = (JUIteratorBinding) exeBinding;
System.out.println(" Iterator : " juIteratorBinding.getName() "\t" + "D.C : " + juIteratorBinding.getDataControl().getName());
isDirty = juIteratorBinding.getDataControl().isTransactionDirty();
if(isDirty){
System.out.println(" Dirty because of " + juIteratorBinding.getName());
return isDirty;
}else if(exeBinding instanceof DCTaskFlowBinding){
DCTaskFlowBinding dcTaskFlowBinding = (DCTaskFlowBinding) exeBinding;
for( Object taskflowExeBinding : dcTaskFlowBinding.getExecutableBindings() ) {
isDirty = isTransDirty(taskflowExeBinding);
if(isDirty){
return isDirty;
}else if(exeBinding instanceof JUFormBinding){
JUFormBinding jUFormBinding = (JUFormBinding) exeBinding;
for( Object juFormIterBind : jUFormBinding.getIterBindingList() ) {
isDirty = isTransDirty(juFormIterBind);
if(isDirty){
return isDirty;
for( Object juFormExeBinding : jUFormBinding.getExecutableBindings() ) {
isDirty = isTransDirty(juFormExeBinding);
if(isDirty){
return isDirty;
}catch(Exception e){
e.printStackTrace();
return false;
hope this helps Vinod ;)

Similar Messages

  • ADF UI Shell tabs dirty

    Hi,
    I am using JDeveloper 11.1.14 and ADF-BC in my project.
    I am using ADF-UI shell design pattern in my application to show tabs and invoke task flows.
    On close of a tab or switching tab,if there are unsaved changes[transaction dirty],I want warn the user of any unsaved changes.
    How can I implement this??
    Please help.
    Thanks,
    Praveen

    Praveen,
    Searching via Google or the forum search would find:
    {thread:id=1012600}
    {thread:id=1110844}
    John

  • Change language of tab Launcher.java UI shell

    hi
    Im using Dynamic Tab UI Shell template
    in launcher.java
    public void launchSecondActivity(ActionEvent actionEvent)
    _launchActivity(
    "Next Activity",
    "/WEB-INF/flows/second.xml#second",
    false);
    i want to change "Next Activity" to arabic language , when i write a aword in arabic it is converted to "????"
    Studio Edition Version 11.1.1.3.0 ,Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    thanks

    hi
    the problem solved
    use this
    String toarabic(String tab){
    try{
    tab=new String(tab.getBytes("iso8859-1"),"windows-1256");
    catch(Exception e){
    e.printStackTrace();
    return tab;
    then in change your code to
    public void launchSecondActivity(ActionEvent actionEvent)
    _launchActivity(
    toarabic("write_arabic_Text"),
    "/WEB-INF/flows/second.xml#second",
    false);
    note: in every jspx page the following code must be added
    <?xml version='1.0' encoding='windows-1256'?>
    <jsp:directive.page contentType="text/html;charset=windows-1256"/>
    But i think in jdeveloper 11.1.1.4 they solved this problem without the above code ( im using 11.1.1.3)

  • Bind an Action at Tab switching in Dynamic Shell Tab.

    Hi,
    I am using Jdeveloper 11.2.4
    I am using Dynamic UI shell in my main application.
    My requirement is that when i have more then 1 tab open and i switch among them, i fire an event i.e. Whenever i move from 1 tab to the other, an event should be fired and i can catch that event in my Function in Bean.
    The main reason i want this is because which ever tab is currently in focus, i need to get the details of that tab and set a few variables based on them.
    So whenever the tab is changed, i can call the same function.

    Hi Marcel,
    I expose my problem.
    In the FormA (in reality it's a table View), I have a toolbar with a button. The action of this button call a popup iView which update database and at return of this popup I update my FormA with a timer. This popup return a boolean flag which indicate if the timer must call my web service or not. So, at the beginning, the FormA don't contain any rows and the timer will not call my web service because there are not any rows which can contain the return flag of my popup.
    To resolve this problem, I think to create a FormB (a form view) with a button (same name and action that the button in the toolbar of the FormA) and a hidden text field. Now, FormA don't call the popup iView, it's FormB  which do it.
    So, when I click on the button (in toolbar) of the FormA, I would like apply ('Apply to' option in button properties of the FormA) this action to the button of my FormB to call the popup iView and, when this popup iView return a flag, this flag will be store in a hidden text field of the FormB. The timer look at the value of this hidden text field and will call my web service or not to update the FormA.
    But the 'Apply to' option for another form (not self) don't work.
    I hope you understand my expression
    Regards

  • How to save individual tabs in oracle dynamic shell

    Hi,,
    When I press the save button in a tab on my adf application the other opened records in the other opened tabs are affected and validated by this button!!!
    I want to save the content of the current tab only
    Edited by: 996170 on Mar 26, 2013 2:05 AM

    Hi,
    If the save button is a specific to that tab then you can set the immediate=true property of button and if it is global save button then it would have alternate approach to avoid the validations of other tabs.

  • Making the Tab key not work in the JTextArea

    In my view I have a JTextArea along with a bunch of JTextFields and JComboBoxes. The user is usually going to tab out of a field in order to go to the next field. What's happening is when the user tries to tab out of the JTextArea, the cursor just moves by a tab length within the JTextArea instead of going to the next field. And if the JextArea has some text in it and if the user tabs into the JTextArea, the whole text gets selected and on hitting the next tab, it gets wiped out.
    I am trying to make the JTextArea not respond to the tab by writing the following code. Keymap keyMap = JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP);
    KeyStroke tabKey = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0, false);
    keyMap.removeKeyStrokeBinding(tabKey);
    jTextArea1.setKeymap(keyMap);But it's still not working. Can anybody tell what's wrong with that code. Or is there any other way to do it? Any help/hints appreciated.
    Thanks.

    >
    If you're using jdk1.4, those other solutions won't
    work because the focus subsystem has changed radically
    (see
    http://java.sun.com/j2se/1.4/docs/api/java/awt/doc-file
    /FocusSpec.html). The upshot is that you have to
    specifically register the keystrokes that you want to
    use for focus traversal. In your case, you have to
    re-register the Tab and Shift-Tab keys, and
    they don't seem to have provided a simple way to do
    that. Here's what I come up with:Set forwardTraversalKeys = new TreeSet();
    forwardTraversalKeys.add(KeyStroke.getKeyStroke(
    KeyEvent.VK_TAB));
    forwardTraversalKeys.add(KeyStroke.getKeyStroke(
    KeyEvent.VK_TAB, InputEvent.CTRL_MASK));
    textArea.setFocusTraversalKeys(
    KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
    forwardTraversalKeys);
    Set backwardTraversalKeys = new TreeSet();
    backwardTraversalKeys.add(KeyStroke.getKeyStroke(
    KeyEvent.VK_TAB, InputEvent.SHIFT_MASK));
    backwardTraversalKeys.add(KeyStroke.getKeyStroke(
    KeyEvent.VK_TAB, InputEvent.SHIFT_MASK |
    K | InputEvent.CTRL_MASK));
    textArea.setFocusTraversalKeys(
    KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
    backwardTraversalKeys);Or, you can just press CTRL+TAB instead of TAB when
    you get to the JTextArea :).=====================================
    i used the above thing but i am getting exceptions classcast exception n method not found (forwardTraversalKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB));)keystroke.get keyStroke(int)???? where i am going wrong as it will be quite helpful for me am using jdk1.4.1_02
    thnaks

  • JFrame.pack() causes problems with jtabbedpane(making new tabs)and resizing

    I have a JFrame with a JTabbedPane inside of it. Inside of each tab I put a JPanel with a JTextArea in it. When I create a new tab, I do something like textArea.requestFocusInWindow();
    However, this will not work unless I do a frame.pack() right after I created the new tab and right before that line of code.
    This in turn causes another problem. If I resize the jframe and then create a new tab, the window will snap back to the size it had before creating the tab. I assume this has to do with the pack() function, however nothing else I try will make the cursor blink in the JTextArea.
    Is there a solution to this...either something to make the cursor blink or something other than the pack function to update the JFrame?
    Thank you

    This posting should help you out:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=581478

  • Making a tab default in tabstrip

    Hi,I have an urgent requirement.
    In a tabstrip of five tabs, how to make 3rd tab default.
    I mean to say,if i am executing a program having such tabstrip then selection screen should open with fields defined in subscreen of third tab.

    This is the code i have written..but its not working:
    *& Report  ZEXAMPLE
    REPORT  ZEXAMPLE
            NO STANDARD PAGE HEADING.
    TABLES:sscrfields.
    *   Selection screen
    *Selection screen for vendor1 and vendor2.
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK tab_block FOR 16 LINES,
                        TAB (23) button1 USER-COMMAND push1,      "#EC NEEDED
                        TAB (23) button2 USER-COMMAND push2       "#EC NEEDED
                        " etc
                        DEFAULT SCREEN 1001,
                        END OF BLOCK tab_block.
      SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.
        SELECTION-SCREEN END OF SCREEN 1001.
        SELECTION-SCREEN BEGIN OF SCREEN 1002 AS SUBSCREEN.
        SELECTION-SCREEN END OF SCREEN 1002.
      " etc.
      INITIALIZATION.
        button1 = text-bu1.
        button2 = text-bu2.
        " etc.
        tab_block-prog = sy-repid.
        tab_block-dynnr = 1002.
        tab_block-activetab = 'BUTTON2'.
        " etc.
        AT SELECTION-SCREEN.
          CASE sscrfields-ucomm.
            WHEN 'PUSH1'.
              tab_block-dynnr = 1001.
              tab_block-activetab = 'TAB2'.
    ENDCASE.         " etc.

  • Programatically selecting a tab

    Is there a way I can automatically select a tab in my tabbed
    panel? I have two tabs and in one panel I have a textbox with a
    submit button. When clicked it uses ajax to update the content in
    the other tab so I'd like to also switch the view to that tab.
    Thanks.

    http://labs.adobe.com/technologies/spry/samples/tabbedpanels/tabbed_panel_sample.htm
    Check the second and third examples.

  • Popups making original tab blank, can you help?

    Recently i have had a problem where pop ups are causing my original tab to become blank. for example: say i was on this page and i click a link that caused a pop up. this page would go blank and my pop-up blocker successfully blocks the pop-up. I noticed it one day when i clicked on a video on the internet (i forget which site). when i clicked play an avertisement pop-up opened causing my video page to go blank. I couldnt watch the video.

    Which pop-up blocker are you using?
    Did you check their setting or disable this extension or program?
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Making a tab invisible

    Hi
    We've a requirement to make some tabs in our web dynpro application invisible to all users and some visible only to admins.
    We can't find any useful BAdIs for it.
    Any solutions ?
    Thanks
    Pushpraj

    Hi,
    Make no. of context attributes of type wdui_visibility and bind with visibility property of tab.
    By default set it as 02 so that it will be visible to every one. Bind only that tabs which You dont want to display on the condition.
    And based on the user You  can make it invisible by setting it 01.
    I hope it helps.
    Regards,
    Rohit

  • Making conditions tab non editable in PO

    Friends
    My requirement is to make the conditions which defaults in the PO from pricing procedure to be greyed out. The conditions adopted from Inforecord in to the PO (i.e.) discounts and Packing and forwarding also needs to be greyed out in PO. Kindly guide me
    Regards
    Arvind

    If you want to enter/display field 'Net price' immediately after enterin
    transaction for specific users, you can define function authorizations
    for buyers (customizing transaction OMET) and set for specific function
    authorizations key value in field 'Field sel.' to value display:
    a) Ta: SPRO:
    MM-> Purchasing -> Purchase Order ->
    Define Screen Layout At Document level
    Let say choose: '$DE1' as Field selection key
    Field Selection Group:Choose Quantity and Price
    Field Label: Set 'Price and price unit' to display
    b) Ta: OMET
    Unchecked the 'Indicator: Enter/change conditions' check box and fill
    in the Field selection key as set previously($DE1).
    c) Ta: SU3
    Then for user in User Profile create parameter EFB with value equal to
    function authorizations key defined in OMET.

  • Making tabs invisible in FPM_OIF_COMPONENT does not work

    we have a requirement to hide some FPM tabs (main views) in the ESS talent profile iView.
    after making those tabs invisible in the FPM component configuration they still show up as visible. Any idea why?
    more precisely, we are making FPM tabs (main views) invisible In component configuration HRTMC_EP_OIF of component FPM_OIF_COMPONENT.
    Regards,
    Tiberiu

    Hi,
    I assume here that at design time you make them via the configuration invisible. At runtime if you see the tabs then i suspect that there are some Dynamic programming involved or other variants exists that you haven't changed yet.
    Go back to the application configuration and test it from there and if it is still not working then use the Debugger to see what happens and why your configuration is not working.

  • Change tab control page programatically using boolean.

    I am wondering if there is a way to programatically change the tabs on tab control when a user clicks a button on  the interface? Here is what I am trying to do and if anybody has any great ideas please let me know. I have a tab control with currently 3 tabs. I want a button on the main area of the vi to go to page 2 and back to page 1 as the user clicks it. The second is that I want about 5 buttons in page 2 that will go to say page 3-5. Any ideas. Thanks
    Derek Tucker
    Derek Tucker
    [email protected]

    Sure, though I don't know why the user can't just click the tabs themselves. All you need is a simple event structure and writing to a local variable of the tab control.
    Attachments:
    tab control.vi ‏43 KB

  • UIShell template; from Tab to the underlying Application Module

    Hello,
    We have based our application on the UI Shell template from Oracle: http://www.oracle.com/technetwork/developer-tools/adf/uishell-093084.html .
    Thank to that template, we can launch different taskflows from a generic menu. As you may know, each taskflow belongs to a tab of a panel tab,
    which lets you switch from one launched taskflow to another one.
    The problem is that we need to way detect if any underlying application module referring to the current active tab has some pending changes (is dirty) in some way,
    so that we can make mark the current tab as dirty too.
    That way (once the tab at the view level is programmatically marked as "dirty") a popup asking for confirmation would automatically appear when the user tries to close the tab itself.
    When the user wants to close the tab despite any pending changes, we want to rollback them.
    In short, we need to:
    - retrieve all the AM instances starting from the current TAB
    - mark a tab as dirty when the first change to the only AM's belonging to the current tab happens
    - rollback any pending changes to those AM's when the user wants to close the tab anyway.
    The difficult part comes from a comment iabout a method explained in the UI Shell Documentation, which states that "the model level does not track to which tab the data belongs":
        public void currentTabDirty(ActionEvent e)
            * When called, marks the current tab "dirty". Only at the View level
            * is it possible to mark a tab dirty since the model level does not
            * track to which tab data belongs.
          TabContext tabContext = TabContext.getCurrentInstance();
          tabContext.markCurrentTabDirty(true);
        } 

    Hi,
    you can get the tab binding for each tab in a templae
    List<Tab> tabs = tabContext.getTabs();
    for(Tab t : tabs){
      DCBindingContainer bindings = (DCBindingContainer) t.getBinding();
      List bindingIterators = bindings.getExecutableBindings();
       for (Object bindingIterator : bindingIterators ){
          if(bindingIterator instanceof DCIteratorBinding){
                   DCDataControl dc = ((DCIteratorBinding) bindingIterator ).getDataControl();
                   boolean isTransactionDirty = dc.isTransactionDirty();
                   if(isTransactionDirty == true){
                       ... do what you need to do here ...
    }If you want to have a quick check if any task flow exposed in the dynamic tab shell template is dirty (so if you are not particular interested in which data control has a dirty transaction, as the above code would allow you to figure out) then you can use
       ControllerContext.getInstance().getCurrentRootViewPort().isDataDirty();This would return true if any state of the task flows has a dirty state
    Let me know if it works for your need.
    Frank
    Edited by: Frank Nimphius on Sep 13, 2012 8:17 PM

Maybe you are looking for

  • How do I add a email to my iMessage so that I can have two emails

    How do I add a email to my iMessage so that I can have two emails

  • How do I find and remove duplicates on the 11.2 itunes?

    How do I find and remove duplicates on the 11.2 itunes?

  • Validation of SC/PO

    Hi all, I am doing FI validation in SRM 4.0.Actually i am getting error based on the GL account and company code at line item which are based on the costcenter or internal order or WBS using...for this i am using FM BAPI_ACC_GL_POSTING_CHECK(RFC enab

  • Barcode system in WM

    Hi All, My client  is managing their WH at MM-IM level now they are looking for WM module. 1)They have simple warehouse with 2 storage types. 2)They want to implement bar code system in their warehouse. Is it possible to meet their requirements with

  • How to know the point where one menu popUp is showed ?

    hi, I need know the point where one popUp menu is showed, but I have problems to do it.... I can install actionListener for method actionPerformed of class AbstractAction but the event I get does not able to say the point... In the documentation, I r