Popup + before phase listener + commandlink issue

All,
I have a before phase listener configured on a page to open a popup and it works pretty well i.e. the popup gets opened when the page is loaded. Now i want to show the same popup when the user clicks on the commandLink. So i configured the commandLink to have a showPopupbehaviour as its child. The issue is when i click on the command link the popup is not getting opened. However if i remove the call to the before phase listener (), the popup is getting invoked from the command link.
Please advice whats wrong in this case ? Ideally both should be working independently.
I tried setting the immediate and auto submit also but no effect.
thnks
Jdev 11.1.1.5

Hi,
using af:showPopupBehavior issues a request to the server, which then also is handled by your phase listener. So you need to add some logic to your phase listener to not process its action when the command button is pressed. You can e.g. set the command button to partialSubmit = true and then check if the request is a partial request AdfContext.getCurrentInstance().isPartialRequest(facesContext) This way the phase listener opens the popup when a page loades but no longer after.
Frank

Similar Messages

  • ADF Faces: Phase listener

    hi folks,
    In phase listener can we get which is a last action fired .I
    have command links in page with action associated with it ,in phase listener i want to know which action is fired that is which commandlink is clicked
    Thanks
    Pravin

    ok! i know for  initial requests  (when a user requesting the page for the first time ) the "JavaServer Faces implementation creates an empty view during restore View phase and the life cycle advances to the render response phase".
    so i think it is impossible to change Uicomponent state in phase listener !!!!   but how can i change Uicomponent attribute before page send to user's browser ?!!

  • Ajax component, phase listener and findComponent help

    Hello,
    I have a component that issues an Ajax Request. This request is collected by a phase-listener and then processed, however I am having difficulties finding the component that I want to re-render.
    Is there a common approach for getting hold of components from a PhaseListener ? My scenario is:
    When the user clicks and drags inside my component, I want to register the X-axis drag with a ValueChangeListener. (The component has a valueChangeListener="" attribute).
    I am able to get the X-axis drag amount sent via Axis and into the PhaseListener, but at this point I am stuck. I now need to get hold of my component, and tell it how much to move the X-axis.
    Any help is very much appreciated!

    ok! i know for  initial requests  (when a user requesting the page for the first time ) the "JavaServer Faces implementation creates an empty view during restore View phase and the life cycle advances to the render response phase".
    so i think it is impossible to change Uicomponent state in phase listener !!!!   but how can i change Uicomponent attribute before page send to user's browser ?!!

  • Hi how to use phase listener in jsf

    hi
    i have a scenariao were the data have to fetched form database before the page gets loaded . so i came abt phase listeners . so can anybody give some example for phase listener.....
    thanks

    This is just basic Java knowledge, but anyway ..public class SomeClass {
        static {
            // static initialization block, this is executed only once per runtime, before the first instantiation.
            // Initialization block, this is executed before the constructor on every instantiation.
        public SomeClass() {
            // the constructor, this is executed on every instantiation.
    }

  • InitMethod() Before Phase method in View calling many times:

    Hi Everyone,
    i have dragged one table as read only table with single row selection checked.
    One Go button is there in the page.
    The code in the go button is taking the curretn selecting the current row and printing the values.
    The code in the initMethod() is executing the VO.
    The issue is when the page loads the initMethod() (Before phase in View) is calling multiple times even after the page loads.
    Continuously its calling that method.
    How to make it to call it only once when the page loads?
    Any suggestions will be really useful.
    Thanks.

    Hi Jabr,
    Thanks for ur response.
    i dont know that how to do that.
    i have written initmethod()(in before phase) for showing the table values(executing VO) before the page loads such that we can see the table with valus when the pae is loaded.
    Thanks.

  • Error when creating Before Phase method

    Hi,
    I am using Jdeveloper 11.1.1.3.0. I wanted to create Phase Event method. I did by going to the view and opened the editor for Before Phase. Created a new Bean and the method. I gave application scope.
    Once it is created, I get the error saying the reference method_name not found.
    I didn't receive this error in earlier version. Can anyone guide me on this?
    Thanks
    SR

    Hi,
    not sure why this happens but what is the reason to put this into application scope. Is your phase listener keeping state ? Note that if you define it on the f:view component then it is used for this page only. So it can be in request scope
    Frank

  • Phase Listener buries exceptions

    This is a JSF question sort of...
    Can anybody hazard a guess why my JSF Phase Listener does not show exceptions when one gets thrown in a method within this PhaseListener?
    I am using ADF/BC and JSF/ADF Faces within JDeveloper 10.1.3.4 and deploying to iAS 10.1.3.4.
    I have not tried the same thing in an ADFPhaseListener...chiefly because I wanted a beforePhase() and an afterPhase() method to override, and Source-->Override Methods did not show these methods as being overrideable...so I just used the normal JSF Phase Listener.
    My theory is that PhaseListener is perhaps accessed by many sessions?? So it has no way to know to where its stack traces should be directed. So I guess I should use logging with some sort of general catch clause for each method...any ideas will be entertained.
    Thanks in advance.

    Here's exactly what it says:
    The beforePhase() method is called before the standard processing for a particular phase is
    performed, while the afterPhase() method is called after the standard processing has been
    completed. The JSF implementation must guarantee that, if beforePhase() has been
    called on a particular instance, then afterPhase() will also be called, regardless of any
    Exceptions that may have been thrown during the actual execution of the lifecycle phase. For
    example, let’s say there are three PhaseListeners attached to the lifecycle: A, B, and C, in
    that order. A.beforePhase() is called, and executes successfully. B.beforePhase()
    is called and throws an exception. Any exceptions thrown during the beforePhase()
    listeners must be caught, logged, and swallowed. In this example, C.beforePhase()
    must not be called. Then the actual lifecycle phase executes. Any exceptions thrown during
    the execution of the actual phase must not be swallowed. When the lifecycle phase exits, due
    to an exeception or normal termination, the afterPhase() listeners must be called in
    reverse order from the beforePhase() listeners in the following manner.
    C.afterPhase() must not be called, since C.beforePhase() was not called.
    B.afterPhase() must not be called, since B.beforePhase() did not execute
    successfully. A.afterPhase() must be called. Any exceptions thrown during the afterPhase()
    listeners must be caught, logged, and swallowedJohn

  • Use of JSF Phase Listener?

    There are many many examples of how to 'access' the six phases of the JSF Life Cycle.
    I have a simple page that has two input text fields and one command button.
    I would like to be able to access the contents of the text fields on the page in Phase 2 (APPLY REQUEST VALUES), or other phases. After quite a bit of time I am posting this in the hopes that someone could point me in the correct direction to do this or perhaps someone has a simple example.
    Thanks - Casey

    Code for phase listener, backing bean and output are at the bottom of this note.
    The text field has a Id property of lname. I assume you are referring about using findComponent() against the backing bean that has a corresponding property (RichInputText) for the text field?
    When I run the app I am getting a null for the objReference for the backing bean (line 16 in the output) - see output which then causes a NullPointerException.
    Suggestions on how to get the reference to the backing bean, or the component that will contain the data for the input text field?
    Thanks again - Casey
    The code I am using in the Phase Listener class is:*
    +public class MyPhaseListener implements PhaseListener {+
    +public MyPhaseListener() {+
    +}+
    +public void beforePhase(PhaseEvent pe) {+
    if (pe.getPhaseId() == PhaseId.RESTORE_VIEW)
    System.out.println("Processing new  Request!");
    System.out.println("before - " pe.getPhaseId().toString());+
    +if (pe.getPhaseId().toString().equals("APPLY_REQUEST_VALUES 2")) {+
    System.out.println("lkjhlkjhlkjhlkjh");
    +}+
    +if (pe.getPhaseId().toString().equals("APPLY_REQUEST_VALUES 2")) {+
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory =
    facesContext.getApplication().getExpressionFactory();
    ValueExpression exp =
    expressionFactory.createValueExpression(elContext,
    +"#{BackingBean}",+
    BackingBean.class);
    BackingBean nameData = (BackingBean)exp.getValue(elContext);
    System.out.println(nameData);
    System.out.println(nameData.getLname().findComponent("lname"));
    +}+
    +}+
    +public void afterPhase(PhaseEvent pe) {+
    System.out.println("after - " pe.getPhaseId().toString());+
    if (pe.getPhaseId() == PhaseId.RENDER_RESPONSE)
    System.out.println("Done with Request!\n");
    +}+
    +public PhaseId getPhaseId() {+
    return PhaseId.ANY_PHASE;
    +}+
    +}+
    The code for the backing bean is:*
    package view;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    +public class BackingBean {+
    private RichInputText lname;
    +public BackingBean() {+
    +}+
    +public void setLname(RichInputText lname) {+
    System.out.println("In setLName");
    this.lname = lname;
    +}+
    +public RichInputText getLname() {+
    System.out.println("In getLName");
    return lname;
    +}+
    +}+
    Output from System.out.println statements:*
    Processing new  Request!
    before - RESTORE_VIEW 1
    after - RESTORE_VIEW 1
    before - RENDER_RESPONSE 6
    In getLName
    In setLName
    after - RENDER_RESPONSE 6
    Done with Request!
    Processing new  Request!
    before - RESTORE_VIEW 1
    In setLName
    after - RESTORE_VIEW 1
    before - APPLY_REQUEST_VALUES 2
    lkjhlkjhlkjhlkjh
    null
    after - APPLY_REQUEST_VALUES 2
    +<Jul 13, 2009 8:27:14 AM CDT> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@857c75 - appName: 'Application8', name: 'Application8-ViewController-context-root', context-path: '/Application8-ViewController-context-root', spec-version: '2.5', request: weblogic.servlet.internal.ServletRequestImpl@1c70722[+
    +POST /Application8-ViewController-context-root/faces/untitled1.jspx?_adf.ctrl-state=793257214_3 HTTP/1.1+
    +Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/x-shockwave-flash, */*+
    +Referer: http://127.0.0.1:7101/Application8-ViewController-context-root/faces/untitled1.jspx?_adf.ctrl-state=793257214_3+
    +Accept-Language: en-us,de;q=0.5+
    +Content-Type: application/x-www-form-urlencoded+
    +UA-CPU: x86+
    +Accept-Encoding: gzip, deflate+
    +User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)+
    +Content-Length: 269+
    +Connection: Keep-Alive+
    +Cache-Control: no-cache+
    +Cookie: JSESSIONID=wBr1Kb2GrCDpnhkNNgQyTvJvSjlnWHyvnq9gNWT92kvsFYlGC1Jl!1059440035+
    +]] Root cause of ServletException.+
    java.lang.NullPointerException
    +     at view.MyPhaseListener.beforePhase(MyPhaseListener.java:42)+
    +     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:228)+
    +     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)+
    +     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)+
    +     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)+
    +     Truncated. see log file for complete stacktrace+

  • ADF:How to use NavigationHandler in Phase-Listener with adfc-config.xml

    Hi,
    in our application a user should be navigated to the login-page, when he tries to navigate directly to a page where he has no right for or if the session is expired.
    Our navigation is complete in the adfc-config.xml. So I created a phase-listener, which is called by the adf-settings.xml.
    Inside the phase-listener I'm checking the rights. If the user doesn't have the needed rights, he should be linked to the login page. But how can I do that?
    Some days ago our navigation has been complete in the faces-config.xml. But now we moved the navigation to the adfc-config.xml, because we are sure that it's better. E.g. for using the dialog framework.
    In the face-config.xml we had also the call of the phase-listener. There we did the forwarding like this and it worked:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, null, "login_page");But now I think I have to use the ADFContext somehow, or?
    So how can I do that with the adfc-config.xml?
    Thanks a lot for your help,
    Bastian
    I'm using JDeveloper 11g Release 1 (11.1.1.3.0)

    Hello Frank,
    thanks for your answer, but it doesn't really help me, because I'm a newbie, sorry.
    Does your answer mean, that I should leave the call of the phase-listener in the faces-config and then I would also have access to the login-page, which is in the adfc-config?
    Or does it mean, that I call now my phase-listener by adf-settings but don't have to change the phase-listener itself and can still use my code (FacesContext...)? But that's not working. I get no error but he is also not redirecting.
    Maybe my problem starts on an earlier point.
    Is it better to create all pages in the adfc-config or faces-config? (Maybe you have a good reference for reading about such a basic discussion)
    I thought adfc-config would be the better one. But there I'm not able to redirect to another page (login) if somebody calls a special page without rights for example.
    So my second basic question would be about the relation of adfc-config, faces-config and ADFContext and FacesContext.
    Because I think it's not a short answer I hope you could give me also for this a reference so that I can read these basics myself.
    Thanks a lot for helping a newbie becoming better :-)
    Bastian

  • How do I set a Phase Listener to only run for a specific page?

    How do I set a Phase Listener to only run for a specific page?
    I understand that a Phase Listener runs for ever page in the application, however I want a phase listener to only run for one page at the beginning of the application.
    I discovered I can't use a Filter, because the JSF Application instance always returns null.
    Thus, I thought a Phase Listener would be a good approach.
    Thoughts?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I have moved forward with checking the requested URI...
    (shivers)
    Thanks,
    --Todd                                                                                                                                                                                   

  • Phase Listener in Subsystem deployed as BTF in Master - jdev 11.1.2.3

    Hello:
    We are using Subsystems with BTF's that are deployed as ADFLibs. These Subsystem ADFLibs are imported into a Master app and the BTF's are used as a region in the Master.
    I tried to create Phase Listener that displays System.out.println msgs in the Subsystem that was then used as a region in the Master app.
    But no messages from the Phase Listener appear on the console. What am I missing? Would the Phase Listeners have to be in the Master app?
    What if I wanted the Phase Listener of just the subsystem? Is this possible?
    Below is the code for adf-settings.xml and java class that implements PagePhaseListener:
    <?xml version="1.0" encoding="UTF-8" ?>
    <adf-config xmlns="http://xmlns.oracle.com/adf/config">
    <adfc-controller-config xmlns="http://xmlns.oracle.com/adf/controller/config">
    <lifecycle>
    <phase-listener>
    <listener-id>myListener</listener-id>
    <class>com.xxxx.labs.madison.ptnr.phase.listener.MyPagePhaseListener</class>
    </phase-listener>
    </lifecycle>
    </adfc-controller-config>
    </adf-config>
    package com.xxxx.labs.madison.ptnr.phase.listener;
    import javax.faces.application.FacesMessage;
    import javax.faces.context.FacesContext;
    import oracle.adf.controller.v2.lifecycle.Lifecycle;
    import oracle.adf.controller.v2.lifecycle.PagePhaseEvent;
    import oracle.adf.controller.v2.lifecycle.PagePhaseListener;
    public class MyPagePhaseListener implements PagePhaseListener {
    public MyPagePhaseListener() {
    super();
    public void afterPhase(PagePhaseEvent pagePhaseEvent) {
    System.out.println("inside afterPhase="+pagePhaseEvent.getPhaseId());
    System.out.println("getDebugValue="+pagePhaseEvent.getDebugValue());
    if (pagePhaseEvent.getPhaseId() == Lifecycle.PREPARE_RENDER_ID) {
    System.out.println("Lifecycle.PREPARE_RENDER_ID="+pagePhaseEvent.getDebugValue());
    FacesContext fctx = FacesContext.getCurrentInstance();
    String viewId = fctx.getViewRoot().getViewId();
    FacesMessage message = new FacesMessage("Hello Page no " + viewId);
    fctx.addMessage(null, message);
    public void beforePhase(PagePhaseEvent pagePhaseEvent) {
    System.out.println("inside beforePhase="+pagePhaseEvent.getPhaseId());
    System.out.println("getDebugValue="+pagePhaseEvent.getDebugValue());
    }

    First, ensure the phase listener is working in the subsystem app.
    Second, after the master app consumes the child app (as adflib), define the phase listener in the web.xml (within the masterapp).
    face-config and taskflow config files are combined but i dont think its the same case for web.xml.

  • Trouble with Phase Listener?

    I am having a problem getting my page beans' "init", "preprocess" and "prerender" methods to fire. My page beans are inherited from "com.sun.jsfcl.app.AbstractPageBean" which do have these methods defined. From what I've found, it appears that my problem is a lack of a "phase-listener" in my faces-config.xml file. How should this be configured? If I put in:
    <lifecycle>
    <phase-listener>com.sun.jsfcl.app.AbstractPageBean</phase-listener>
    </lifecycle>
    I get an error that the phase listener can't be instantiated (which makes sense, it is abstract). How do I configure my application so that the "init", "preprocess" and "prerender" methods fire?
    Thanks,
    Lonnie

    I have absolutely no idea what you're talking about. This is not JSF specific.
    Maybe you're using some additional JSF component library which offers this stuff. I guess that it is Woodstock again. In any way, you should consult the documentation which come along with the component library for answers on this kind of questions.

  • EXEcutable only starting DLL when calling a popup before.

    Hello,
    1. I have created a DLL in Labview 8.2 with one VI/function.
    2. Then i call this DLL/function in a new VI
    3. Then i created an EXE-file of this VI (which calls a DLL)
    Attached a screenshot of the code.
    As you can see it contains a sequence-structure where in the first part i open a message-popup and in the second-part i call the DLL.
    When i run it like this then it works without problems.
    The funny thing is:
    When i remove the message-popup and create a new EXE-file and run it then nothing happens!
    Only the Run-arrow changes to running-mode (and stays there until i close it with taskmanager) but the outputs dont-change (they stay "0").
    (The VI in the DLL that i call is very simple. The Inputvalue "11" is added and multiplied. This two results are returned. So nothing special.)
    Whats wrong here? Seems like Labview can´t make the DLL-call starting in the second exe-file (without an popup before).
    Is this a kind of a bug?
    Thanks for your help and ideas
    Attachments:
    screen.jpg ‏26 KB

    Hmm, i´m getting a red error-message after cklicking on "install LabVIEW 8.2.1 now." in your link.
    Whats going wrong here?
    --> See attached screenshot
    Attachments:
    error.jpg ‏54 KB

  • What are the steps to define a phase listener in JSF 1.1?

    Hello everyone...
    Implementing a page listener in JSF 1.2 (the one that comes with JDeveloper 11g) is very straight forward, you implement the methods getPhaseID, beforePhase,afterPhase, and then add the class into the JSF configuration file. It works like charm.
    However, doing the same thing with JDeveloper 10.1.3.4 (it comes with JSF 1.1) never works... so I was wondering... Am I missing something? What are the correct steps to do it?
    thanks in advance.

    Dear Mr. John...
    thanks for your kind reply... however, I already was able to implement the Phase Listener successfully in JDeveloper 11g with JSF 1.2 specs. And it works just fine...
    what am I asking is that I am doing exactly the same steps under JDeveloper 10.1.3.4 under JSF 1.1 specs, but it does not work at all... so what is the problem? any idea?
    best regards

  • How to get an event programmatically from a phase listener

    Hi all,
    does anyone know how I can get the component which generated the postback from a phase listener? I need this information because, in my application, I need to log into the database all the buttons and/or options the user clicked.
    Thanks in advance,
    Monique

    Best what you can do is to get all map keys of the ExternalContext#getRequestParameterMap(), those are client ID's of the input elements involved in the form submit, then use UIViewRoot#findComponent() to get the component by client ID and finally determine if it is an instance of UICommand.

Maybe you are looking for