Inline popup - close icon null pointer issue

Hi all,
I have a taskflow which is opened as inline popup dialog. Taskflow is in pageFlowScope.
The popup has OK, Cancel. On click of OK and Cancel of dialog it returns a value.
However when I click on Close icon "x" of dialog and return to the calling parent window and try to get the any iterator from the binding container, the iterators are all null.
I am missing something in my configuration.
Thanks
Ajay

Hi,
actually clicking teh 'x' does nothing than closing the dialog.
However when I click on Close icon "x" of dialog and return to the calling parent window and try to get the any iterator from the binding container, the iterators are all null.
What is the code you use and where and when do you call this code ? And what JDeveloper version are you working with ?
Frank

Similar Messages

  • JFrame will not close giving null pointer exception

    Hello ev1, Heres what I'm doing, I have a menu with JButtons that when pressed will take you to a game (this works fine). When your done with the game, you press a button that closes the JFrame(game) and starts the menu again (this gives the error null pointer exception). Heres a brief summary of the design:
    FullScreenSetup class
    has openWindow() that sets up a new full screen JFrame. (works)
    has closeWindow() that removes everything in the contentPane and sets
    visible(false).
    GameMenu class
    uses FullScreenSetup via FullScreenSetup window;
    uses window.openWindow() to set up the window.
    also sets up the buttons and handles them when pressed
    VideoPoker class (the game)
    uses FullScreenSetup via FullScreenSetup window;
    runs the game and has the button that should close the window and go
    back to the menu.
    heres how i thought it should work, in the actionPerformed method I have
    window.closeWindow(); <- this gives me the error
    new GameMenu(); <- this is my ultimate goal (hopefully brings me
    back to the menu screen to choose another game)
    I hope what I have written is enough for someone to help me because I know what it is like to read through hundreds of lines of code to help someone. Thx.

    What I cannot understand is that when going from the menu to the game I use window.closeWindow(); so that I can clear the menu and paste the game on the screen this works fine. so why does it not work a second time?

  • Hide close icon from taskflow inline popups / process window closure

    Hi OTN,
    I would like to know of there is an opportunity to hide "X" close icon from popup window when I run a taskflow in a popup as an inlineDocument?
    Or what is a preferred way to process user window closure to rollback changes?
    In my current application a user always has Cancel button which sets taskflow return parameter as "Cancel" which is then read by dialog return listener.
    The listener would call Rollback if there is "Cancel" returned.
    But "X" close doesn't set any parameter.
    Maybe I sould set "Cancel" as a default return parameter value? Or the right way is to use finalizer?
    Please, advice me.
    Thanks.
    ADF Fusion Web Application
    JDev 11.1.1.3

    You have to define and apply a custom skin. It is easy, read the documentation here:
    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31973/af_skin.htm#BAJFEFCJ
    You can get detailed description of all the supported skin selectors here:
    http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e15862/toc.htm#ComponentLevelSelectors
    Note, that <tt>af|dialog::close-icon-style {display:none;}</tt> will affect all the popup dialogs, but not only the taskflow popup windows. If you need to apply it only to taskflow popup windows, then use <tt>af|panelWindow::close-icon-style{ display:none; }</tt>. Have a look at Frank's blog post http://blogs.oracle.com/jdevotnharvest/2010/12/how-to_hide_the_close_icon_for_task_flows_opened_in_dialogs.html.
    Dimitar

  • Task flow-call  as a Dialog with inline-popup issue JDev 11.1.1.2.0

    I have a very serious issue with task flow-call running as a Dialog with inline-popup
    have bunch of data driven table components pointing to pageDefs with Iterators
    the problem is, the dialog comes first with nothing in it (blank) and it takes 3-5 seconds to fetch all views,
    this is useless, there is no option to control taskflow-call activation , like you do for af:region
    For reference : I am talking about this : http://jobinesh.blogspot.com/2010/08/refresh-parent-view-when-in-line-popup.html
    Download the workspace , connect as HR Schema and you will see what I am talking about
    looks really dumb, it would make sense to show dialog with data all at once, rarther than looking at blank screen to wait for the data to show up
    Edited by: user626222 on Sep 20, 2010 8:57 AM
    can I call this a bug?
    Edited by: user626222 on Sep 20, 2010 1:58 PM
    sometimes I wonder if anyone tested this, as soon as you have some data driven components on your page, you get all sorts of problems in ADF
    But something simple, Adf client side invokes the Dialog as a popup first, and then it thinks oh ya I get massive pageDef to load, so end-user customer will stare at the blank screen for 10 secs , hoping that something will come up or program is crashed
    Well, I am afraid to say you lost your customer :(
    Edited by: user626222 on Sep 20, 2010 2:29 PM
    Edited by: user626222 on Sep 20, 2010 2:35 PM
    Edited by: user626222 on Sep 20, 2010 2:35 PM
    Edited by: user626222 on Sep 20, 2010 2:36 PM

    ok, knowing this fact, I want to show some kind of status indicator during the wait time.
    Unfortunately, putting af:statusIndicator does not work untill after entire page loads
    <?xml version="1.0" ?>
    <?Adf-Rich-Response-Type ?>
    <content action="/EmpApp/faces/displayEmployees.jspx?_adf.ctrl-state=5plp6ahes_72">
    <fragment><![CDATA[<span id="f1::postscript"><input type="hidden" name="javax.faces.ViewState" value="!-e8tyzkiuc"></span>]]>
    </fragment>
    <fragment>
    <![CDATA[<div id="afr::DlgSrvPopupCtnr::content" style="display:none"><div id="j_id12" style="display:none">
    <div style="top:auto;right:auto;left:auto;bottom:auto;width:auto;height:auto;position:relative;" id="j_id12::content">
    <div id="j_id13" class="x142"><div class="x157" _afrPanelWindowBackground="1"></div>
    <div class="x157" _afrPanelWindowBackground="1"></div><div class="x157" _afrPanelWindowBackground="1">
    </div><div class="x157" _afrPanelWindowBackground="1"></div>
    <table cellpadding="0" cellspacing="0" border="0" summary="" class="x146">
    <tr>
    <td class="p_AFResizable x148" id="j_id13::_hse"> </td>
    <td class="p_AFResizable x14a" id="j_id13::_hce"><table cellpadding="0" cellspacing="0" border="0" width="100%" summary=""><tr>
    <td><div id="j_id13::_ticn" class="x151"><img src="/EmpApp/afr/task_flow_definition.png" alt=""></div></td><td class="x14e" id="j_id13::tb">
    <div id="j_id13::_ttxt" class="xz8"></div></td><td>
    <div class="x153"><a href="#" onclick="return false" class="xz7" id="j_id13::close" title="Close"></a></div></td></tr></table></td><td class="p_AFResizable x14c" id="j_id13::_hee"> </td></tr><tr><td class="p_AFResizable x14j" id="j_id13::_cse"> </td>
    <td class="p_AFResizable x14g" id="j_id13::contentContainer">
    <div id="j_id13::_ccntr" class="x14h" style="width:700px;height:430px;position:relative;overflow:hidden;">
    <div id="j_id14" class="xne" style="position:absolute;width:auto;height:auto;top:0px;left:0px;bottom:0px;right:0px">
    <iframe _src="javascript:'<html&gt;<head&gt;<title/&gt;</head&gt;
    <body/&gt;
    </html&gt;'" src="javascript:''" frameborder="0" style="position:absolute;width:100%;height:100%">
    </iframe>
    </div></div></td><td class="p_AFResizable x14l" id="j_id13::_cee"> </td></tr><tr><td class="p_AFResizable x14n" id="j_id13::_fse"><div></div></td>
    <td class="p_AFResizable x14p" id="j_id13::_fce">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" summary=""><tr>
    <td class="p_AFResizable x14u" id="j_id13::_fcc"></td><td align="left" valign="bottom"><div class="p_AFResizable x14y"><a tabIndex="-1" class="x14w" id="j_id13::_ree" title="Resize"></a></div></td></tr></table></td><td class="p_AFResizable x14r" id="j_id13::_fee">
    <div></div></td>
    </tr></table></div></div></div></div>]]>
    </fragment>
    <script-library>/EmpApp/afr/partition/gecko/default/opt/frame-SHEPHERD-PS1-9296.js</script-library>
    This is how it launches the taskflow-call, so there is no way to control this behaviour from the calling taskflow's jspx, feels very closed system,why ADF is not making this behavior Open by some kind of client listener,
    <script>
    <![CDATA[AdfDhtmlLookAndFeel.addSkinProperties({"AFPopupSelectorFooterStart":"x11b","AFPopupSelectorHeader":"x114","af|panelWindow-tr-open-animation-duration":"300","AFPopupSelectorHeaderStart":"x115","AFPopupSelectorContentEnd":"x119","AFPopupSelectorContent":"x117","af|panelWindow::resize-ghost":"x144","AFPopupSelectorContentStart":"x118","AFPopupSelectorFooter":"x11a","AFPopupSelectorFooterEnd":"x11c","AFPopupSelectorHeaderEnd":"x116","AFPopupSelector":"x110",".AFPopupSelector-tr-open-animation-duration":"200"});AdfPage.PAGE.addComponents(new AdfRichPopup('j_id12',{'_dialogURL':'/EmpApp/faces/adf.dialog-request?_adf.ctrl-state=5plp6ahes_76&_rtrnId=1285074907739&__ADFvDlg__=true','_inlineFrameId':'j_id14','_launchId':'r1:0:cb2','_panelWindowId':'j_id13','_rtnId':'1285074907739','contentDelivery':'immediate'}),new AdfRichPanelWindow('j_id13',{'modal':true,'resize':'on','stretchChildren':'first'}),new AdfRichInlineFrame('j_id14',{'source':'javascript:\'\x3chtml>\x3chead>\x3ctitle/>\x3c/head>\x3cbody/>\x3c/html>\''}));AdfPage.PAGE.clearMessages();AdfPage.PAGE.clearSubtreeMessages('r1');]]>
    </script>
    AdfDhtmlRichDialogService.getInstance().launchInline there is no way for me to put af:statusindicator for the wait time using this way
    <script>AdfDhtmlRichDialogService.getInstance().launchInline('j_id12');*</script>
    </content>

  • Issue with nested inline popup taskflow while try to return back to parent.

    Hi Adf Experts,
    I have been facing one issue. Would you please give me how can I solve this issue which address my scenario. I greatly appreciate your help.
    My Scenario:
    I have ViewA which opens inline popup page ViewB. On ViewB also have another inline PopUp page ViewC (i.e. nested inline popup). On ViewB, there is back button which taskFlow return call and navigate back to ViewA. I need to implement same Back trigger event from ViewC (Back Button)to ViewA. For this, I am using ReturnListener on ViewB button which opens ViewC inline page. On returnListener, I have used ViewB back button ActionEvent queue. like:
         RichCommandButton buttonBack;
         public void onReturn( ReturnEvent returnEvent )
              ActionEvent ae = new ActionEvent(buttonBack);
              buttonBack.queueEvent( ae );
    Output Scenario:
    While running from ViewB, it fires same Back Button action from ViewC back button. No issue at all.
    But when I run from ViewA upto ViewC page and on fire back button, I have been facing issue like below.
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
    java.lang.NullPointerException
         at oracle.adfinternal.controller.application.AdfcDirtyPageHandler.getUncommittedDataWarning(AdfcDirtyPageHandler.java:38)
         at oracle.adfinternal.view.faces.context.DirtyPageContextImpl$1.invokeContextCallback(DirtyPageContextImpl.java:74)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1410)
         at oracle.adf.view.rich.component.rich.RichDocument.invokeOnComponent(RichDocument.java:168)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:720)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:678)
    <RegistrationConfigurator> <handleError> ADF_FACES-60096:Server Exception during PPR, #3
    java.lang.NullPointerException
         at oracle.adfinternal.controller.application.AdfcDirtyPageHandler.getUncommittedDataWarning(AdfcDirtyPageHandler.java:38)
         at oracle.adfinternal.view.faces.context.DirtyPageContextImpl$1.invokeContextCallback(DirtyPageContextImpl.java:74)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1410)
         at oracle.adf.view.rich.component.rich.RichDocument.invokeOnComponent(RichDocument.java:168)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:720)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:678)
         at oracle.adfinternal.view.faces.context.DirtyPageContextImpl.initDirtyPageContext(DirtyPageContextImpl.java:58)
         at oracle.adfinternal.view.faces.context.RichPhaseListener.beforePhase(RichPhaseListener.java:252)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:278)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    ...........

    Hi,
    I have a similar issue.
    I have a page (search page) from where i open another dynamic tab(UI dynamic tab shell pattern).
    In this second tab, I open a new jspx using "dialog:open" in my taskflow (of the second tab).
    Now when I navigate to my first tab with advanced search and try executing my search, a managed bean method is called where I have a line of code as follows:
    DCIteratorBinding statusIter = (DCIteratorBinding)getBindings().get("myIterator");
    At this line the statusIter comes as "null" and hence my search fails with the following exception:
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
    javax.faces.el.EvaluationException: java.lang.NullPointerException
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:879)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:312)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: java.lang.NullPointerException
         at com.guycarp.soa.mf.ui.bean.MessageTrackingListBean.createAndExecuteMessageTrackingSearchCriteria(MessageTrackingListBean.java:228)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         ... 50 more
    <RegistrationConfigurator> <handleError> ADF_FACES-60096:Server Exception during PPR, #3
    javax.servlet.ServletException
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    Is there any specific setting which should be done in a taskflow or a page which opens another page using dialog:openwindow?? And why does this effect any other taskflow?
    Any pointers to resolve this are appreciated.
    Thanks in Advance!
    -Swapna

  • Popup window null pointer exception

    Hi,
    I have created a web dynpro application like this: a first window with a button that calls a popup with user info and telephone number and a button OK.
    When I click on OK, the popup window close perfectly, but if I click again on the button of the first page to see again the popup, I get a null pointer exception error:
    The initial exception that caused the request to fail, was:
       java.lang.NullPointerException
        at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handle(ApplicationWindow.java:258)
        at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handleWindowEvents(ApplicationWindow.java:239)
        at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:149)
        at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
        at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
    The popup code:
    IWDWindow myPopup = wdContext.currentPopupNodeElement().getPopupAttribute();
    if (myPopup == null)
         IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("PopWin");
         myPopup = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
         myPopup.setWindowPosition(200, 200);
         wdContext.currentPopupNodeElement().setPopupAttribute(myPopup);
         wdContext.currentPopupNodeElement().setUserName("thibault");
         wdContext.currentPopupNodeElement().setUserTelNumber("01010101");
    myPopup.show();
    The close function for the popup:
    IWDWindow window = wdContext.currentPopupNodeElement().getPopupAttribute();
    window.hide();
    window.destroyInstance();
    Has any one got any solution, I would really appreciate your help.
    Thibault Schalck

    Hi,
       Try changing your code like this under popup.
            IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("PopWin");
         IWDWindow myPopup = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
    wdContext.currentPopupNodeElement().setPopupAttribute(myPopup);
         myPopup.setWindowPosition(200, 200);
         wdContext.currentPopupNodeElement().setPopupAttribute(myPopup);
         wdContext.currentPopupNodeElement().setUserName("thibault");
         wdContext.currentPopupNodeElement().setUserTelNumber("01010101");
    myPopup.show();
    Kiran

  • How to handle the "cancel" button and "close" icon of a popup ?

    Hi,
    I have a popup with "cancel button" and "close icon"(on the top right corner of the popup), I want the same operations to be performed on clicking of any of these two components.
    Is there a way to handle such situation ?
    I read about 2 cases to look into this but they didn't work too well for me.
    1. I read about the "popcancellistener" but that listener is called whenever the popup closes, so suppose I have an "ok button" on the popup to create a record, after the record is created, the popup closes and goes into the "popcancellistener", now the question is "how do we know if it came there because of the 'ok button' or 'some other event'".
    2. I even checked the "DialogListener", now I'm able to distinguish between the 'OK' and 'CANCEL' button in the dialoglistener using the "Dialog.Outcome.ok/cancel", but when a user clicks on the close icon, we do not enter the "DialogListener" at all, so in this case "how do we handle the close icon click event"
    Do let me know if you need any more information from my side.
    Thanks for the help in advance.

    The following mechanism responds to any of the following events: <Esc> key, Close icon ('x'), Cancel button
    JavaScript part:
    function popupClosedListener(event){
                  var source = event.getSource();
                  var popupId = source.getClientId();
                  var params = {};
                  params['popupId'] = popupId;
                  var type = "serverPopupClosed";
                  var immediate = true;
                  AdfCustomEvent.queue(source, type, params, immediate);
    }JSF part:
             <af:popup ....>
                  <af:clientListener method="popupClosedListener"
                                           type="popupClosed"/>
                  <af:serverListener type="serverPopupClosed"
                                          method="#{myBean.serverPopupClosedMetod}"/>
            </af:popup>Finally, Java part:
    public void serverPopupClosedMetod(ClientEvent event){
    }

  • Getting java.lang.Null pointer Exception when i close the pdf file.

    Hi,
    my application is java based thick client application.
    From my application, i am generating report file using crystal report tool.
    the report file is exported as pdf format and stored in my local macine. from this path, am displaying the report in a SWT browser.
    till now its working fine. when i close the browser, i am getting java.lang.null.pointer exception.
    i dont understand from this exception, printed in console.
    please help me.
    java.lang.NullPointerException
    at org.eclipse.swt.ole.win32.OleClientSite.onPaint(OleClientSite.java:921)
    at org.eclipse.swt.ole.win32.OleClientSite.access$2(OleClientSite.java:906)
    at org.eclipse.swt.ole.win32.OleClientSite$1.handleEvent(OleClientSite.java:131)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
    at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1424)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3842)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4541)
    at org.eclipse.swt.internal.ole.win32.COM.CoFreeUnusedLibraries(Native Method)
    at org.eclipse.swt.ole.win32.OleClientSite.releaseObjectInterfaces(OleClientSite.java:1084)
    at org.eclipse.swt.ole.win32.OleControlSite.releaseObjectInterfaces(OleControlSite.java:683)
    at org.eclipse.swt.ole.win32.OleClientSite.onDispose(OleClientSite.java:852)
    at org.eclipse.swt.ole.win32.OleClientSite.access$1(OleClientSite.java:847)
    at org.eclipse.swt.ole.win32.OleClientSite$1.handleEvent(OleClientSite.java:128)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:804)
    at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:755)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
    at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:755)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
    at org.eclipse.swt.widgets.Widget.dispose(Widget.java:441)
    at com.siemens.med.cad.hqm.reports.ReportViewer$1.widgetDisposed(ReportViewer.java:273)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:117)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:804)
    at org.eclipse.swt.widgets.Widget.dispose(Widget.java:441)
    at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:446)
    at org.eclipse.swt.widgets.Shell.dispose(Shell.java:674)
    at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:308)
    at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1643)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3789)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2366)
    at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:477)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3877)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2366)
    at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:477)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3877)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2371)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3420)
    at com.siemens.med.cad.hqm.view.mainUI.HQMMainForm.buildMainShell(HQMMainForm.java:246)
    at com.siemens.med.cad.hqm.event.UserLoginEventHandler.loginDisplay(UserLoginEventHandler.java:240)
    at com.siemens.med.cad.hqm.event.UserLoginEventHandler.widgetSelected(UserLoginEventHandler.java:97)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
    this is the code i have written for display the report file in a browser:
    Display display = Display.getDefault() ;
         Shell shell = new Shell(display, SWT.RESIZE | SWT.CLOSE | SWT.MIN | SWT.MAX | SWT.APPLICATION_MODAL);
    shell.setText(reportTitle);
    shell.setLayout(new FillLayout());
    shell.setMaximized(false);
    shell.setSize(800, 600);
    Composite comp = new Composite(shell, SWT.NONE);
    comp.setLayout(new FillLayout());
    final Browser browser = new Browser(comp, SWT.FLAT);
    try {
    File file = new File(exportFile);
    URL url = file.toURL();
    browser.setUrl("file:" + url.getPath());
    } catch (MalformedURLException malURLEx) {
    // malURLEx.printStackTrace();
    throw new ProgrammingExceptionAdapter(malURLEx);
    shell.addDisposeListener(new DisposeListener() {
    public void widgetDisposed(DisposeEvent arg0) {
    File file = new File(exportFile);
    if (file != null && file.exists()) {
    file.delete();
    browser.dispose();
    shell.open();
    shell.setFocus()'

    TitiTruc, welcome to the forum. Please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.
    db

  • Taskflow as inline popup causes issues while returning..

    Hi,
    I am using 11gr1p1. I have an ADF application where I have a bounded taskflow I call as inline popup. And in the popup I return from the taskflow ..
    Everything works fine when I launch my app within JDeveloper or when I launch it directly.
    It fails when I call the ADF application from a different web page by opening it in a new window. In this case when I click the button in the inline popup to return from the taskflow I got an error in the IE's log as below..
    Line :1
    Char:86
    Error : Access is denied.
    Any help will be great, we spent quite a time to make this work ...
    Test page to launch the ADF app
    <html>
    <head>
    </head>
    <body>
    <div >
    <p ><a href="http://msoyerxp:7101/PopupTest-ViewController-context-root/faces/adf.task-flow?adf.tfId=tf-main&amp;adf.tfDoc=/WEB-INF/tf-main.xml" target="_blank" > Test </a></p>
    </div>
    </body>
    </html>Main taskflow
    <?xml version="1.0" encoding="UTF-8" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="tf-main">
        <default-activity id="__1">MainPage</default-activity>
        <view id="MainPage">
          <page>/MainPage.jspx</page>
          <redirect/>
        </view>
        <task-flow-call id="tf-popup">
          <task-flow-reference>
            <document>/WEB-INF/tf-popup.xml</document>
            <id>tf-popup</id>
          </task-flow-reference>
          <run-as-dialog>
            <display-type id="__7">
              <inline-popup/>
            </display-type>
          </run-as-dialog>
        </task-flow-call>
        <control-flow-rule id="__2">
          <from-activity-id id="__3">MainPage</from-activity-id>
          <control-flow-case id="__5">
            <from-outcome id="__6">Popup</from-outcome>
            <to-activity-id id="__4">tf-popup</to-activity-id>
          </control-flow-case>
        </control-flow-rule>
        <visibility id="__8"/>
      </task-flow-definition>
    </adfc-config>Task flow that I call as inline popup
    <?xml version="1.0" encoding="UTF-8" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="tf-popup">
        <default-activity id="__1">PopUpPage</default-activity>
        <view id="PopUpPage">
          <page>/PopUpPage.jspx</page>
          <redirect/>
        </view>
        <task-flow-return id="taskFlowReturn1">
          <outcome id="__17">
            <name>taskFlowReturn1</name>
          </outcome>
        </task-flow-return>
        <control-flow-rule id="__20">
          <from-activity-id id="__21">PopUpPage</from-activity-id>
          <control-flow-case id="__22">
            <from-outcome id="__24">Return</from-outcome>
            <to-activity-id id="__23">taskFlowReturn1</to-activity-id>
          </control-flow-case>
        </control-flow-rule>
        <visibility id="__8"/>
      </task-flow-definition>
    </adfc-config>Main Page
    <f:view>
        <af:document id="d1">
          <af:form id="f1" targetFrame="_self">
            <af:panelSplitter orientation="vertical" splitterPosition="50" id="ps1">
              <f:facet name="first">
                <af:panelFormLayout id="pfl1">
                  <f:facet name="footer"/>
                  <af:commandButton text="Open Popup" id="cb1" action="Popup" useWindow="true"
                                    windowEmbedStyle="inlineDocument" windowHeight="300"
                                    windowWidth="400"/>
                </af:panelFormLayout>
              </f:facet>
              <f:facet name="second">
                <!-- id="af_one_column_header_stretched_with_splitter"   -->
              </f:facet>
            </af:panelSplitter>
          </af:form>
        </af:document>
      </f:view>Popup Page
    <f:view>
        <af:document id="d1">
          <af:form id="f1">
              <af:panelSplitter orientation="vertical" splitterPosition="50" id="ps1">
                <f:facet name="first">
                  <af:commandButton text="Return1" id="cb1" action="Return" partialSubmit="true"/>
                </f:facet>
                <f:facet name="second"/>
              </af:panelSplitter>
          </af:form>
        </af:document>
      </f:view>

    That is the problem actually. When I run the link directly it works fine. But I need to launch the ADF application from a non-ADF app which is not hosted on WLS.
    The scenario above was just to simplify the problem...
    Is there any security settings etc that may cause this ?
    Thanks

  • Make Task Flow Inline Popup to close on "esc" button

    Hello, I am using JDeveloper 11.1.2.3.0
    I have created a task flow (with jsf pages not jsff) which I call on button click. I have chosen to display it as Inline Popup and everything works fine. It is just that it does not act like a real af:popup.
    When I press "esc" button the popup does not get closed. Does anyone know how to do this?
    Thank you

    I did not create a popup. I have defined a task flow as inline popup. The task flow contains one page and one return operation. It opens very well and I can get out of there by clicking on a button inside the page of the taskflow that calls the return operation. I need in this case to call the return operation when I pres 'esc'. This because from what I am understanding I must call the return operation to get out of there. Any idea?

  • ADFc: No view port found when using both Browser dialog and TF inline-popup

    Hi,
    Using JDev 11.1.1.2.
    We have a table with data and two commandlinks. One navigates to a task-flow-call configured to "run as dialog" in a modal inline-popup. This opens a modal inline-popup that can be used to modify the data.
    The second command link navigates to view (using the dialog: syntax) that opens a second browser window, displaying a jspx that retrieves an image from a servlet.
    Both dialogs can be opened and closed multiple times if I use only one of them in a session, but once I have opened the browser dialog popup, opening the inline-popup gives an exception (see below).
    The inline-popup actually shows, but instead of the taskflow inside it it shows "The website cannot display the page".
    From debugging the source code, I see that the StateInstanceIdFromRequest (ControllerState:288) when opening the inline-popup is the ctrl-state from the main browser window address bar, r01nnp3js_9.
    Then when the taskflow inside the inline-popup is opened, the StateInstanceIdFromRequest is r01nnp3js_13. If I open and close the inline-popup multiple times, this instanceid stays the same.
    Until I open the browser dialog window with the second commandlink, the StateInstanceIdFromRequest for the view inside this dialog window is r01nnp3js_31, matching the ctrl-state from the dialog window address bar.
    After closing the browser dialog window and clicking the first commandlink, the inline-popup shows but the StateInstanceIdFromRequest for the taskflow inside it is no longer r01nnp3js_13, but r01nnp3js_31!!
    This is the InstanceID from the browser window that was closed!! This is incorrect and I think that the wrong StateInstance is looked up (ControllerState:304).
    This results in an NPE (ControllerState:330) because the CurrentViewPort (looked up from mAllViewPorts with the wrong currentViewPortContextId) is null.
    This is the stacktrace:<ControllerState><getViewPort> ADFc: No view port found with ID 'r01nnp3js_32'.
    <ControllerState><getViewPort> ADFc: No view port found with ID 'r01nnp3js_32'.
    08-jun 10:53:16 DEBUG     2/avravr001 (MnSessionContextFilter) ----- REQUEST START ----
    08-jun 10:54:31 DEBUG     2/avravr001 (MnSessionContextFilter) ----- UNCAUGHT UNCHECKED EXCEPTION DURING REQUEST: NullPointerException, null ----
    08-jun 10:54:31 DEBUG     2/avravr001 (MnSessionContextFilter) ----- REQUEST END ----
    <8-jun-2010 10:54:31 uur CEST> <Error> <HTTP> <BEA-101017> <[ServletContext@12329770[app:KlantbeeldPME module:KlantbeeldPME path:/KlantbeeldPME spec-version:2.5 version:V2.0], request: weblogic.servlet.internal.ServletRequestImpl@f0f81e[
    GET /KlantbeeldPME/faces/adf.dialog-request?_adf.ctrl-state=yg04i5vly_47&_rtrnId=1275987194538&__ADFvDlg__=true&_afrLoop=2956086037750&_afrWindowMode=0&_afrWindowId=_adfvdlg HTTP/1.1
    Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
    Referer: http://127.0.0.1:7101/KlantbeeldPME/faces/adf.dialog-request?_adf.ctrl-state=yg04i5vly_47&_rtrnId=1275987194538&__ADFvDlg__=true
    Accept-Language: nl
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Accept-Encoding: gzip, deflate
    Connection: Keep-Alive
    Cookie: JSESSIONID=H5k3MTDDTCpbCqjPhf1pWyJ2tsl3JBC3PTDXpQVzh8Fx74BJdLk6!1966224151
    ]] Root cause of ServletException.
    java.lang.NullPointerException
         at oracle.adfinternal.controller.state.ControllerState.synchronizeStatePart1(ControllerState.java:330)
         at oracle.adfinternal.controller.application.SyncNavigationStateListener.beforePhase(SyncNavigationStateListener.java:101)
         at oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.beforePhase(ADFLifecycleImpl.java:551)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchBeforeEvent(LifecycleImpl.java:100)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.dispatchBeforePagePhaseEvent(LifecycleImpl.java:147)
         Truncated. see log file for complete stacktrace
    >
    <8-jun-2010 10:54:31 uur CEST> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at 8-jun-2010 10:54:31 uur CEST. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = 8-jun-2010 10:54:31 uur CEST SERVER = DefaultServer MESSAGE = [ServletContext@12329770[app:KlantbeeldPME module:KlantbeeldPME path:/KlantbeeldPME spec-version:2.5 version:V2.0], request: weblogic.servlet.internal.ServletRequestImpl@f0f81e[
    GET /KlantbeeldPME/faces/adf.dialog-request?_adf.ctrl-state=yg04i5vly_47&_rtrnId=1275987194538&__ADFvDlg__=true&_afrLoop=2956086037750&_afrWindowMode=0&_afrWindowId=_adfvdlg HTTP/1.1
    Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
    Referer: http://127.0.0.1:7101/KlantbeeldPME/faces/adf.dialog-request?_adf.ctrl-state=yg04i5vly_47&_rtrnId=1275987194538&__ADFvDlg__=true
    Accept-Language: nl
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Accept-Encoding: gzip, deflate
    Connection: Keep-Alive
    Cookie: JSESSIONID=H5k3MTDDTCpbCqjPhf1pWyJ2tsl3JBC3PTDXpQVzh8Fx74BJdLk6!1966224151
    ]] Root cause of ServletException.
    java.lang.NullPointerException
         at oracle.adfinternal.controller.state.ControllerState.synchronizeStatePart1(ControllerState.java:330)
         at oracle.adfinternal.controller.application.SyncNavigationStateListener.beforePhase(SyncNavigationStateListener.java:101)
         at oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.beforePhase(ADFLifecycleImpl.java:551)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchBeforeEvent(LifecycleImpl.java:100)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.dispatchBeforePagePhaseEvent(LifecycleImpl.java:147)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.dispatchBeforePagePhaseEvent(ADFPhaseListener.java:112)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.beforePhase(ADFPhaseListener.java:59)
         at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.beforePhase(ADFLifecyclePhaseListener.java:44)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:258)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)What are my options here? How can I influence the ctrl-state of an inline-popup? Can a browser dialog window be disposed somehow and would that matter?
    oracle.adfinternal.controller.state.ControllerState is an adfinternal class, what is the best way to hook into this and fix it?
    Thanks and regards,
    Gerben

    Thanks Frank. I'm not sure how to do that, but I'll create a SR on the SID of my customer and refer to this thread.
    regards,
    Gerben

  • Null Pointer Exception while reading inbox

    Hi Experts
    I am getting the Null Pointer Exception when I execute the following code. Can anybody please suggest where i am going wrong.
      public void readInbox( )
        //@@begin readInbox()
         while (! wdContext.nodeEmail().isEmpty()) {
              wdContext.nodeEmail().removeElement(wdContext.nodeEmail().getElementAt(0) );
         wdContext.nodeEmail().invalidate();   
         Message[] message = new Message[1000];
         IPublicEmailInteractiveFormComp.IEmailElement newEmailNodeElement;
         //Set properties
         // @TODO Enter your email server address here by replacing the text in angle brackets.
         String host = "otemail.otegroup.com";
         // @TODO Enter your email account here by replacing the text in angle brackets.
         String username = "[email protected]";
         // @TODO Enter your email account password here by replacing the text in angle brackets.
         String password = "password";
         Properties props = new Properties();     
         props.put("mail.smtp.host", host);
         //Set Session
         Session session = Session.getInstance(props, null);
         //Set the store
         try {
              Store store = session.getStore("imap");
              store.connect(host,username,password);
              //Get folder
              Folder folder = store.getFolder("INBOX");
              folder.open(Folder.READ_ONLY);
              //Get Mails
              message = folder.getMessages();
              //Fill table with mails
              for (int i = 0; i < message.length; i++)
                   if (message<i>.isSet(Flags.Flag.SEEN) == false)
                        if (message<i>.getSubject().equals("Travel Request Form"))
                             newEmailNodeElement = wdContext.createEmailElement();                 
                             newEmailNodeElement.setFrom(message<i>.getFrom()[0].toString());
                             newEmailNodeElement.setSubject(message<i>.getSubject());
                             newEmailNodeElement.setSentDate(message<i>.getSentDate().toString());
                             //Check for right Attachment
                             Object content = message<i>.getContent();
                             if ( content != null  && content instanceof Multipart)
                                  for (int j = 0 , n = ((Multipart)content).getCount(); j < n; j++)
                                       Part part = ((Multipart)content).getBodyPart(j);
                                       String disposition = part.getDisposition();
                                       if ( disposition != null && (disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE)))
                                            if (part.getFileName().equals("TravelRequest.pdf"))
                                                 newEmailNodeElement.setAttachment(true);
                                                 newEmailNodeElement.setContentType(part.getContentType().toString());
                                                 InputStream is = part.getInputStream();
                                                 ByteArrayOutputStream bo = new ByteArrayOutputStream();                                                                                
                                                 int c;
                                                 while ((c = is.read()) > -1) bo.write(c);
                                                 byte[] pdfSource = bo.toByteArray();
                                                 newEmailNodeElement.setPdfSource(pdfSource);
                                                 break;     
                                            else
                                                 newEmailNodeElement.setAttachment(false);     
                             wdContext.nodeEmail().addElement(newEmailNodeElement);
              //Close connection
              folder.close(true);
              store.close();          
         catch (MessagingException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
         catch (IOException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
         catch (NullPointerException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
        //@@end
    Regards
    Abdullah

    The error was caused when the subject used to return null

  • Oracle 10g JDev IDE 9.0.5.2 Null Pointer Exception while debugging

    Hi,
    In windows XP m/c, I am facing following Null Pointer
    Exception while debugging basic Java application through
    10g JDev 9.0.5.2, and it failed in debugging that application...
    May I know, How to get it out of this problem..., am
    suspecting Is it related to any of my windows XP configuration?
    Here's the stack trace shown in the 10g JDev console while
    debugging simple java application..,
    java.lang.NullPointerException
    at javax.swing.border.EmptyBorder.<init>(EmptyBorder.java:54)
    at com.sun.java.swing.plaf.windows.WindowsTableHeaderUI$XPDefaultRendere
    r.getTableCellRendererComponent(WindowsTableHeaderUI.java:63)
    at oracle.jdevimpl.runner.debug.ThreadsPanel$3.getTableCellRendererCompo
    nent(ThreadsPanel.java:306)
    at javax.swing.plaf.basic.BasicTableHeaderUI.getHeaderRenderer(BasicTabl
    eHeaderUI.java:394)
    at javax.swing.plaf.basic.BasicTableHeaderUI.getHeaderHeight(BasicTableH
    eaderUI.java:428)
    at javax.swing.plaf.basic.BasicTableHeaderUI.createHeaderSize(BasicTable
    HeaderUI.java:454)
    at javax.swing.plaf.basic.BasicTableHeaderUI.getPreferredSize(BasicTable
    HeaderUI.java:485)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1275)
    at oracle.jdevimpl.runner.debug.ThreadsPanel.threadsPanelSettingsChanged
    (ThreadsPanel.java:538)
    at oracle.jdevimpl.runner.debug.ThreadsWindow$AllThreadsPanel.threadsWin
    dowSettingsChanged(ThreadsWindow.java:408)
    at oracle.jdevimpl.runner.debug.ThreadsWindow.threadsWindowSettingsChang
    ed(ThreadsWindow.java:138)
    at oracle.jdevimpl.runner.debug.ThreadsWindow.<init>(ThreadsWindow.java:
    112)
    at oracle.jdevimpl.runner.debug.JDebugger.getThreadsWindow(JDebugger.jav
    a:3048)
    at oracle.jdevimpl.runner.debug.DebuggingProcess.selected(DebuggingProce
    ss.java:565)
    at oracle.ideimpl.runner.RunManager.viewSelectionChanged(RunManager.java
    :467)
    at oracle.ide.addin.AbstractView.fireViewSelectionChanged(AbstractView.j
    ava:484)
    at oracle.ideri.navigator.DefaultNavigatorWindow.fireViewSelectionChange
    d(DefaultNavigatorWindow.java:791)
    at oracle.ideri.navigator.DefaultNavigatorWindow$3.viewSelectionChanged(
    DefaultNavigatorWindow.java:1218)
    at oracle.ide.addin.AbstractView.fireViewSelectionChanged(AbstractView.j
    ava:484)
    at oracle.ideimpl.explorer.BaseTreeExplorer.actionPerformed(BaseTreeExpl
    orer.java:2077)
    at javax.swing.Timer.fireActionPerformed(Timer.java:271)
    at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh

    John,
    You mentioned "I closed the IDE so that the TopLink project would pick up the changes..."
    1. We need to find out why you needed to close the IDE? Was TopLink mapping editor not picking up your changes?
    2. I am sure you did not modified .java outside of Jdev, but in case if you did, let me know.
    3. After removing a superclass attribute, did you save all changes?
    4. We tried various combinations, but were unable to reproduce the project reopen issue that you mentioned was fixed by changing the ClassDescriptor.xml. It would be extremely helpful if you could either send us (anuj dot k dot jain at oracle dot com) a project that can reproduce this issue, or outline the exact steps.

  • JTabbedPane with close Icons

    Ok, so I was trying to get a JTabbedPane with 'X' icons on each tab. Searched this site, and found no answers, but loads of questions on how to do it. I've done it now, and here's my code.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    * A JTabbedPane which has a close ('X') icon on each tab.
    * To add a tab, use the method addTab(String, Component)
    * To have an extra icon on each tab (e.g. like in JBuilder, showing the file type) use
    * the method addTab(String, Component, Icon). Only clicking the 'X' closes the tab.
    public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListener {
      public JTabbedPaneWithCloseIcons() {
        super();
        addMouseListener(this);
      public void addTab(String title, Component component) {
        this.addTab(title, component, null);
      public void addTab(String title, Component component, Icon extraIcon) {
        super.addTab(title, new CloseTabIcon(extraIcon), component);
      public void mouseClicked(MouseEvent e) {
        int tabNumber=getUI().tabForCoordinate(this, e.getX(), e.getY());
        if (tabNumber < 0) return;
        Rectangle rect=((CloseTabIcon)getIconAt(tabNumber)).getBounds();
        if (rect.contains(e.getX(), e.getY())) {
          //the tab is being closed
          this.removeTabAt(tabNumber);
      public void mouseEntered(MouseEvent e) {}
      public void mouseExited(MouseEvent e) {}
      public void mousePressed(MouseEvent e) {}
      public void mouseReleased(MouseEvent e) {}
    * The class which generates the 'X' icon for the tabs. The constructor
    * accepts an icon which is extra to the 'X' icon, so you can have tabs
    * like in JBuilder. This value is null if no extra icon is required.
    class CloseTabIcon implements Icon {
      private int x_pos;
      private int y_pos;
      private int width;
      private int height;
      private Icon fileIcon;
      public CloseTabIcon(Icon fileIcon) {
        this.fileIcon=fileIcon;
        width=16;
        height=16;
      public void paintIcon(Component c, Graphics g, int x, int y) {
        this.x_pos=x;
        this.y_pos=y;
        Color col=g.getColor();
        g.setColor(Color.black);
        int y_p=y+2;
        g.drawLine(x+1, y_p, x+12, y_p);
        g.drawLine(x+1, y_p+13, x+12, y_p+13);
        g.drawLine(x, y_p+1, x, y_p+12);
        g.drawLine(x+13, y_p+1, x+13, y_p+12);
        g.drawLine(x+3, y_p+3, x+10, y_p+10);
        g.drawLine(x+3, y_p+4, x+9, y_p+10);
        g.drawLine(x+4, y_p+3, x+10, y_p+9);
        g.drawLine(x+10, y_p+3, x+3, y_p+10);
        g.drawLine(x+10, y_p+4, x+4, y_p+10);
        g.drawLine(x+9, y_p+3, x+3, y_p+9);
        g.setColor(col);
        if (fileIcon != null) {
          fileIcon.paintIcon(c, g, x+width, y_p);
      public int getIconWidth() {
        return width + (fileIcon != null? fileIcon.getIconWidth() : 0);
      public int getIconHeight() {
        return height;
      public Rectangle getBounds() {
        return new Rectangle(x_pos, y_pos, width, height);
    }You can also specify an extra icon to put on each tab. Read my comments on how to do it.

    With the following code you'll be able to have use SCROLL_TAB_LAYOUT and WRAP_TAB_LAYOUT. With setCloseIcons() you'll be able to set images for the close-icons.
    The TabbedPane:
    import javax.swing.Icon;
    import javax.swing.JComponent;
    import javax.swing.JTabbedPane;
    import javax.swing.JViewport;
    import javax.swing.SwingUtilities;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import javax.swing.event.EventListenerList;
    import javax.swing.plaf.basic.BasicTabbedPaneUI;
    import javax.swing.plaf.metal.MetalTabbedPaneUI;
    * A JTabbedPane which has a close ('X') icon on each tab.
    * To add a tab, use the method addTab(String, Component)
    * To have an extra icon on each tab (e.g. like in JBuilder, showing the file
    * type) use the method addTab(String, Component, Icon). Only clicking the 'X'
    * closes the tab.
    public class CloseableTabbedPane extends JTabbedPane implements MouseListener,
      MouseMotionListener {
       * The <code>EventListenerList</code>.
      private EventListenerList listenerList = null;
       * The viewport of the scrolled tabs.
      private JViewport headerViewport = null;
       * The normal closeicon.
      private Icon normalCloseIcon = null;
       * The closeicon when the mouse is over.
      private Icon hooverCloseIcon = null;
       * The closeicon when the mouse is pressed.
      private Icon pressedCloseIcon = null;
       * Creates a new instance of <code>CloseableTabbedPane</code>
      public CloseableTabbedPane() {
        super();
        init(SwingUtilities.LEFT);
       * Creates a new instance of <code>CloseableTabbedPane</code>
       * @param horizontalTextPosition the horizontal position of the text (e.g.
       * SwingUtilities.TRAILING or SwingUtilities.LEFT)
      public CloseableTabbedPane(int horizontalTextPosition) {
        super();
        init(horizontalTextPosition);
       * Initializes the <code>CloseableTabbedPane</code>
       * @param horizontalTextPosition the horizontal position of the text (e.g.
       * SwingUtilities.TRAILING or SwingUtilities.LEFT)
      private void init(int horizontalTextPosition) {
        listenerList = new EventListenerList();
        addMouseListener(this);
        addMouseMotionListener(this);
        if (getUI() instanceof MetalTabbedPaneUI)
          setUI(new CloseableMetalTabbedPaneUI(horizontalTextPosition));
        else
          setUI(new CloseableTabbedPaneUI(horizontalTextPosition));
       * Allows setting own closeicons.
       * @param normal the normal closeicon
       * @param hoover the closeicon when the mouse is over
       * @param pressed the closeicon when the mouse is pressed
      public void setCloseIcons(Icon normal, Icon hoover, Icon pressed) {
        normalCloseIcon = normal;
        hooverCloseIcon = hoover;
        pressedCloseIcon = pressed;
       * Adds a <code>Component</code> represented by a title and no icon.
       * @param title the title to be displayed in this tab
       * @param component the component to be displayed when this tab is clicked
      public void addTab(String title, Component component) {
        addTab(title, component, null);
       * Adds a <code>Component</code> represented by a title and an icon.
       * @param title the title to be displayed in this tab
       * @param component the component to be displayed when this tab is clicked
       * @param extraIcon the icon to be displayed in this tab
      public void addTab(String title, Component component, Icon extraIcon) {
        boolean doPaintCloseIcon = true;
        try {
          Object prop = null;
          if ((prop = ((JComponent) component).
                        getClientProperty("isClosable")) != null) {
            doPaintCloseIcon = (Boolean) prop;
        } catch (Exception ignored) {/*Could probably be a ClassCastException*/}
        super.addTab(title,
                     doPaintCloseIcon ? new CloseTabIcon(extraIcon) : null,
                     component);
        if (headerViewport == null) {
          for (Component c : getComponents()) {
            if ("TabbedPane.scrollableViewport".equals(c.getName()))
              headerViewport = (JViewport) c;
       * Invoked when the mouse button has been clicked (pressed and released) on
       * a component.
       * @param e the <code>MouseEvent</code>
      public void mouseClicked(MouseEvent e) {
        processMouseEvents(e);
       * Invoked when the mouse enters a component.
       * @param e the <code>MouseEvent</code>
      public void mouseEntered(MouseEvent e) { }
       * Invoked when the mouse exits a component.
       * @param e the <code>MouseEvent</code>
      public void mouseExited(MouseEvent e) {
        for (int i=0; i<getTabCount(); i++) {
          CloseTabIcon icon = (CloseTabIcon) getIconAt(i);
          if (icon != null)
            icon.mouseover = false;
        repaint();
       * Invoked when a mouse button has been pressed on a component.
       * @param e the <code>MouseEvent</code>
      public void mousePressed(MouseEvent e) {
        processMouseEvents(e);
       * Invoked when a mouse button has been released on a component.
       * @param e the <code>MouseEvent</code>
      public void mouseReleased(MouseEvent e) { }
       * Invoked when a mouse button is pressed on a component and then dragged.
       * <code>MOUSE_DRAGGED</code> events will continue to be delivered to the
       * component where the drag originated until the mouse button is released
       * (regardless of whether the mouse position is within the bounds of the
       * component).<br/>
       * <br/>
       * Due to platform-dependent Drag&Drop implementations,
       * <code>MOUSE_DRAGGED</code> events may not be delivered during a native
       * Drag&Drop operation.
       * @param e the <code>MouseEvent</code>
      public void mouseDragged(MouseEvent e) {
        processMouseEvents(e);
       * Invoked when the mouse cursor has been moved onto a component but no
       * buttons have been pushed.
       * @param e the <code>MouseEvent</code>
      public void mouseMoved(MouseEvent e) {
        processMouseEvents(e);
       * Processes all caught <code>MouseEvent</code>s.
       * @param e the <code>MouseEvent</code>
      private void processMouseEvents(MouseEvent e) {
        int tabNumber = getUI().tabForCoordinate(this, e.getX(), e.getY());
        if (tabNumber < 0) return;
        CloseTabIcon icon = (CloseTabIcon) getIconAt(tabNumber);
        if (icon != null) {
          Rectangle rect= icon.getBounds();
          Point pos = headerViewport == null ?
                      new Point() : headerViewport.getViewPosition();
          Rectangle drawRect = new Rectangle(
            rect.x - pos.x, rect.y - pos.y, rect.width, rect.height);
          if (e.getID() == e.MOUSE_PRESSED) {
            icon.mousepressed = e.getModifiers() == e.BUTTON1_MASK;
            repaint(drawRect);
          } else if (e.getID() == e.MOUSE_MOVED || e.getID() == e.MOUSE_DRAGGED ||
                     e.getID() == e.MOUSE_CLICKED) {
            pos.x += e.getX();
            pos.y += e.getY();
            if (rect.contains(pos)) {
              if (e.getID() == e.MOUSE_CLICKED) {
                int selIndex = getSelectedIndex();
                if (fireCloseTab(selIndex)) {
                  if (selIndex > 0) {
                    // to prevent uncatchable null-pointers
                    Rectangle rec = getUI().getTabBounds(this, selIndex - 1);
                    MouseEvent event = new MouseEvent((Component) e.getSource(),
                                                      e.getID() + 1,
                                                      System.currentTimeMillis(),
                                                      e.getModifiers(),
                                                      rec.x,
                                                      rec.y,
                                                      e.getClickCount(),
                                                      e.isPopupTrigger(),
                                                      e.getButton());
                    dispatchEvent(event);
                  //the tab is being closed
                  //removeTabAt(tabNumber);
                  remove(selIndex);
                } else {
                  icon.mouseover = false;
                  icon.mousepressed = false;
                  repaint(drawRect);
              } else {
                icon.mouseover = true;
                icon.mousepressed = e.getModifiers() == e.BUTTON1_MASK;
            } else {
              icon.mouseover = false;
            repaint(drawRect);
       * Adds an <code>CloseableTabbedPaneListener</code> to the tabbedpane.
       * @param l the <code>CloseableTabbedPaneListener</code> to be added
      public void addCloseableTabbedPaneListener(CloseableTabbedPaneListener l) {
        listenerList.add(CloseableTabbedPaneListener.class, l);
       * Removes an <code>CloseableTabbedPaneListener</code> from the tabbedpane.
       * @param l the listener to be removed
      public void removeCloseableTabbedPaneListener(CloseableTabbedPaneListener l) {
        listenerList.remove(CloseableTabbedPaneListener.class, l);
       * Returns an array of all the <code>SearchListener</code>s added to this
       * <code>SearchPane</code> with addSearchListener().
       * @return all of the <code>SearchListener</code>s added or an empty array if
       * no listeners have been added
      public CloseableTabbedPaneListener[] getCloseableTabbedPaneListener() {
        return listenerList.getListeners(CloseableTabbedPaneListener.class);
       * Notifies all listeners that have registered interest for notification on
       * this event type.
       * @param tabIndexToClose the index of the tab which should be closed
       * @return true if the tab can be closed, false otherwise
      protected boolean fireCloseTab(int tabIndexToClose) {
        boolean closeit = true;
        // Guaranteed to return a non-null array
        Object[] listeners = listenerList.getListenerList();
        for (Object i : listeners) {
          if (i instanceof CloseableTabbedPaneListener) {
            if (!((CloseableTabbedPaneListener) i).closeTab(tabIndexToClose)) {
              closeit = false;
              break;
        return closeit;
       * The class which generates the 'X' icon for the tabs. The constructor
       * accepts an icon which is extra to the 'X' icon, so you can have tabs
       * like in JBuilder. This value is null if no extra icon is required.
      class CloseTabIcon implements Icon {
         * the x position of the icon
        private int x_pos;
         * the y position of the icon
        private int y_pos;
         * the width the icon
        private int width;
         * the height the icon
        private int height;
         * the additional fileicon
        private Icon fileIcon;
         * true whether the mouse is over this icon, false otherwise
        private boolean mouseover = false;
         * true whether the mouse is pressed on this icon, false otherwise
        private boolean mousepressed = false;
         * Creates a new instance of <code>CloseTabIcon</code>
         * @param fileIcon the additional fileicon, if there is one set
        public CloseTabIcon(Icon fileIcon) {
          this.fileIcon = fileIcon;
          width  = 16;
          height = 16;
         * Draw the icon at the specified location. Icon implementations may use the
         * Component argument to get properties useful for painting, e.g. the
         * foreground or background color.
         * @param c the component which the icon belongs to
         * @param g the graphic object to draw on
         * @param x the upper left point of the icon in the x direction
         * @param y the upper left point of the icon in the y direction
        public void paintIcon(Component c, Graphics g, int x, int y) {
          boolean doPaintCloseIcon = true;
          try {
            // JComponent.putClientProperty("isClosable", new Boolean(false));
            JTabbedPane tabbedpane = (JTabbedPane) c;
            int tabNumber = tabbedpane.getUI().tabForCoordinate(tabbedpane, x, y);
            JComponent curPanel = (JComponent) tabbedpane.getComponentAt(tabNumber);
            Object prop = null;
            if ((prop = curPanel.getClientProperty("isClosable")) != null) {
              doPaintCloseIcon = (Boolean) prop;
          } catch (Exception ignored) {/*Could probably be a ClassCastException*/}
          if (doPaintCloseIcon) {
            x_pos = x;
            y_pos = y;
            int y_p = y + 1;
            if (normalCloseIcon != null && !mouseover) {
              normalCloseIcon.paintIcon(c, g, x, y_p);
            } else if (hooverCloseIcon != null && mouseover && !mousepressed) {
              hooverCloseIcon.paintIcon(c, g, x, y_p);
            } else if (pressedCloseIcon != null && mousepressed) {
              pressedCloseIcon.paintIcon(c, g, x, y_p);
            } else {
              y_p++;
              Color col = g.getColor();
              if (mousepressed && mouseover) {
                g.setColor(Color.WHITE);
                g.fillRect(x+1, y_p, 12, 13);
              g.setColor(Color.black);
              g.drawLine(x+1, y_p, x+12, y_p);
              g.drawLine(x+1, y_p+13, x+12, y_p+13);
              g.drawLine(x, y_p+1, x, y_p+12);
              g.drawLine(x+13, y_p+1, x+13, y_p+12);
              g.drawLine(x+3, y_p+3, x+10, y_p+10);
              if (mouseover)
                g.setColor(Color.GRAY);
              g.drawLine(x+3, y_p+4, x+9, y_p+10);
              g.drawLine(x+4, y_p+3, x+10, y_p+9);
              g.drawLine(x+10, y_p+3, x+3, y_p+10);
              g.drawLine(x+10, y_p+4, x+4, y_p+10);
              g.drawLine(x+9, y_p+3, x+3, y_p+9);
              g.setColor(col);
              if (fileIcon != null) {
                fileIcon.paintIcon(c, g, x+width, y_p);
         * Returns the icon's width.
         * @return an int specifying the fixed width of the icon.
        public int getIconWidth() {
          return width + (fileIcon != null ? fileIcon.getIconWidth() : 0);
         * Returns the icon's height.
         * @return an int specifying the fixed height of the icon.
        public int getIconHeight() {
          return height;
         * Gets the bounds of this icon in the form of a <code>Rectangle<code>
         * object. The bounds specify this icon's width, height, and location
         * relative to its parent.
         * @return a rectangle indicating this icon's bounds
        public Rectangle getBounds() {
          return new Rectangle(x_pos, y_pos, width, height);
       * A specific <code>BasicTabbedPaneUI</code>.
      class CloseableTabbedPaneUI extends BasicTabbedPaneUI {
        * the horizontal position of the text
        private int horizontalTextPosition = SwingUtilities.LEFT;
         * Creates a new instance of <code>CloseableTabbedPaneUI</code>
        public CloseableTabbedPaneUI() {
         * Creates a new instance of <code>CloseableTabbedPaneUI</code>
         * @param horizontalTextPosition the horizontal position of the text (e.g.
         * SwingUtilities.TRAILING or SwingUtilities.LEFT)
        public CloseableTabbedPaneUI(int horizontalTextPosition) {
          this.horizontalTextPosition = horizontalTextPosition;
         * Layouts the label
         * @param tabPlacement the placement of the tabs
         * @param metrics the font metrics
         * @param tabIndex the index of the tab
         * @param title the title of the tab
         * @param icon the icon of the tab
         * @param tabRect the tab boundaries
         * @param iconRect the icon boundaries
         * @param textRect the text boundaries
         * @param isSelected true whether the tab is selected, false otherwise
        protected void layoutLabel(int tabPlacement, FontMetrics metrics,
                                   int tabIndex, String title, Icon icon,
                                   Rectangle tabRect, Rectangle iconRect,
                                   Rectangle textRect, boolean isSelected) {
          textRect.x = textRect.y = iconRect.x = iconRect.y = 0;
          javax.swing.text.View v = getTextViewForTab(tabIndex);
          if (v != null) {
            tabPane.putClientProperty("html", v);
          SwingUtilities.layoutCompoundLabel((JComponent) tabPane,
                                             metrics, title, icon,
                                             SwingUtilities.CENTER,
                                             SwingUtilities.CENTER,
                                             SwingUtilities.CENTER,
                                             //SwingUtilities.TRAILING,
                                             horizontalTextPosition,
                                             tabRect,
                                             iconRect,
                                             textRect,
                                             textIconGap + 2);
          tabPane.putClientProperty("html", null);
          int xNudge = getTabLabelShiftX(tabPlacement, tabIndex, isSelected);
          int yNudge = getTabLabelShiftY(tabPlacement, tabIndex, isSelected);
          iconRect.x += xNudge;
          iconRect.y += yNudge;
          textRect.x += xNudge;
          textRect.y += yNudge;
       * A specific <code>MetalTabbedPaneUI</code>.
      class CloseableMetalTabbedPaneUI extends MetalTabbedPaneUI {
        * the horizontal position of the text
        private int horizontalTextPosition = SwingUtilities.LEFT;
         * Creates a new instance of <code>CloseableMetalTabbedPaneUI</code>
        public CloseableMetalTabbedPaneUI() {
         * Creates a new instance of <code>CloseableMetalTabbedPaneUI</code>
         * @param horizontalTextPosition the horizontal position of the text (e.g.
         * SwingUtilities.TRAILING or SwingUtilities.LEFT)
        public CloseableMetalTabbedPaneUI(int horizontalTextPosition) {
          this.horizontalTextPosition = horizontalTextPosition;
         * Layouts the label
         * @param tabPlacement the placement of the tabs
         * @param metrics the font metrics
         * @param tabIndex the index of the tab
         * @param title the title of the tab
         * @param icon the icon of the tab
         * @param tabRect the tab boundaries
         * @param iconRect the icon boundaries
         * @param textRect the text boundaries
         * @param isSelected true whether the tab is selected, false otherwise
        protected void layoutLabel(int tabPlacement, FontMetrics metrics,
                                   int tabIndex, String title, Icon icon,
                                   Rectangle tabRect, Rectangle iconRect,
                                   Rectangle textRect, boolean isSelected) {
          textRect.x = textRect.y = iconRect.x = iconRect.y = 0;
          javax.swing.text.View v = getTextViewForTab(tabIndex);
          if (v != null) {
            tabPane.putClientProperty("html", v);
          SwingUtilities.layoutCompoundLabel((JComponent) tabPane,
                                             metrics, title, icon,
                                             SwingUtilities.CENTER,
                                             SwingUtilities.CENTER,
                                             SwingUtilities.CENTER,
                                             //SwingUtilities.TRAILING,
                                             horizontalTextPosition,
                                             tabRect,
                                             iconRect,
                                             textRect,
                                             textIconGap + 2);
          tabPane.putClientProperty("html", null);
          int xNudge = getTabLabelShiftX(tabPlacement, tabIndex, isSelected);
          int yNudge = getTabLabelShiftY(tabPlacement, tabIndex, isSelected);
          iconRect.x += xNudge;
          iconRect.y += yNudge;
          textRect.x += xNudge;
          textRect.y += yNudge;
    }The Listener:
    import java.util.EventListener;
    * The listener that's notified when an tab should be closed in the
    * <code>CloseableTabbedPane</code>.
    public interface CloseableTabbedPaneListener extends EventListener {
       * Informs all <code>CloseableTabbedPaneListener</code>s when a tab should be
       * closed
       * @param tabIndexToClose the index of the tab which should be closed
       * @return true if the tab can be closed, false otherwise
      boolean closeTab(int tabIndexToClose);
    }

  • Help need on Validations in inline-popup task flow

    Hi,
    I create a adf application, which refer ready only table and in toolbar, there are some button, which used to insert and edit records. For insert and edit i used a edit.jspx page which come as a inline poup in taskflow. In inline popup i used a button called submit, which used for two purposes.
    1) To validate two fields(ex:- effectiveto should be greather than effectivefrom)
    2) To close inline popup.
    i have done the validaitons using a managedbean and facesconfig.xml validators. My problem is can i do this both requirements by pressing only submitt button, i mean if validation are passed then automatically close the popup.
    Really appreciate if anyone can help me on this issue.
    Yaham.

    Hi,
    use the button "action" or "action listener" property to close the popup. Validation is processed after the apply request phase in the JSF lifecycle and thus comes before actions to be executed, which will be in invoke application phase.
    Frank

Maybe you are looking for

  • I cannot to download from the mac app store (There was an error in the App Store. Please try again later. (20))

    I cannot to download from the mac app store (There was an error in the App Store. Please try again later. (20)) I traied to remove cookies and still don't working.

  • Config Settings - ProductPreviewSize & ProductThumbSize

    I know that in the Config Settings I can set the ProductPreviewSize and ProductThumbSize for some of the different pages, but I have two questions about these properties. 1)  What if I want to have different image sizes on my productdetail and pictur

  • Can we run export_monitor.sh multiple times?

    Hi! We use export_monitor.sh  to export a DB. It processed many packages and finished, but several packages have "export package: ERROR". If I do some change in the DDLORA.TPL,  may I run export_monitor.sh again? I hope it will ONLY processs those ER

  • ADDT multi image upload leads to Fake Record error???

    Rather than using a Wizard to create a multi image upload (which wasn't work!), I created an insert record page, and then created an "upload & resize image" file action on each of three fields: Thumb ItemImage LargeImage I designated these fields as

  • Workflow ECC 6.0 error

    Hi all, we have created a custom workflow and the workflow called in F110 tcode. in F110 we add on button for triggering workflow. in 4.7 it's working fine. but in ECC 6.0 we have got an error. ERROR : 1. The calling of the object method for the work