How to get event source in phaselistener

Hello:
Is there a way to get the event source in the phaselistener ? I need to get the acion / action listener method name that will be executed for the current request in the phaselistener. Any pointers will be really helpful.
thanks and regards,
-- Kannan

Try:
JSF<h:commandButton action="#{myBean.actionMethodName}" value="submit" />PhaseListenerpublic void beforePhase(PhaseEvent event) {
    if (event.getPhaseId() == PhaseId.INVOKE_APPLICATION) {
        FacesContext context = event.getFacesContext();
        Set componentIds = context.getExternalContext().getRequestParameterMap().keySet();
        String action = null;
        for (Iterator componentId = componentIds.iterator(); componentId.hasNext();) {
            UIComponent component = context.getViewRoot().findComponent((String) componentId.next());
            if (component instanceof UICommand) {
                action = ((UICommand) component).getAction().getExpressionString();
                break;
        // action = #{myBean.actionMethodName}
}or:
JSF<h:commandButton action="#{myBean.actionMethodName}" value="submit">
    <f:attribute name="method" value="actionMethodName" />
</h:commandButton>PhaseListenerpublic void beforePhase(PhaseEvent event) {
    if (event.getPhaseId() == PhaseId.INVOKE_APPLICATION) {
        FacesContext context = event.getFacesContext();
        Set componentIds = context.getExternalContext().getRequestParameterMap().keySet();
        String method = null;
        for (Iterator componentId = componentIds.iterator(); componentId.hasNext();) {
            UIComponent component = context.getViewRoot().findComponent((String) componentId.next());
            if (component instanceof UICommand) {
                method = (String) component.getAttributes().get("method");
                break;
        // method = actionMethodName
}

Similar Messages

  • How to get event source from value property changed handler?

    I am relatively new to JavaFX, so perhaps this is an easy question to answer. I am creating in Java code several (e.g., 5) ChoiceBox instances. I add a handler for when the value of the ChoiceBox changes. My code:
    ChoiceBox<String> rpmSelector = new ChoiceBox<>();
    ObservableList<String> rpmSelectorItems = FXCollections.observableArrayList();
    rpmSelectorItems.add(ALL_RPM);
    for (Double engSpeed : engSpeeds) {
        rpmSelectorItems.add(String.format("%.0f", engSpeed.doubleValue()));
    rpmSelector.setItems(rpmSelectorItems);
    rpmSelector.getSelectionModel().selectFirst();
    rpmSelector.valueProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> obsValue,
                String oldValue, String newValue) {
           // How can I get the ChoiceBox that was the source of this event?
    });My question is: in the "changed" method, how do I determine which of the ChoiceBox instances had its value changed?
    Thanks!
    Chris
    Edited by: 976245 on May 15, 2013 1:05 PM
    Edited by: 976245 on May 15, 2013 1:05 PM

         My question is: in the "changed" method, how do I determine which of the ChoiceBox instances had its value changed?You have only one ChoiceBox control. Probably you want to get the selected item. If it is the case you can get it through selectedItemProperty(),
    selectedIndexProperty(), and valueProperty()
            rpmSelector.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
                public void changed(ObservableValue<? extends String> ov, String old_val, String new_val) {
                    System.out.println("Selected item is: " + new_val);
            rpmSelector.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> observableValue, Number oldv, Number newv) {
                    System.out.println("Selected index is: " + newv.intValue());
            rpmSelector.valueProperty().addListener(new ChangeListener<String>() {
                public void changed(ObservableValue<? extends String> ov, String old_val, String new_val) {
                    System.out.println("Selected   value: " + new_val);
            });

  • I imported different trips to different catalogs on different external hard drives.  Later renamed external HDs.  I want to combine catalogs and have my source (NEF) files all together on one drive.  I'm not really sure how to get those source files back

    I imported different trips to different catalogs on different external hard drives.  Later renamed external HDs.  I want to combine catalogs and have my source (NEF) files all together on one drive.  I’m not really sure how to get those source files back and get rid of the extra long path to where the source files are now located. If I re-link files to their current catalog (many different paths to files in same catalog) can I merge (import catalogs) into one master catalog?  Will the new (Master catalog) have the correct link to the source file?  If not, how or can this be done?
    I have tried to explain my situation as clearly as I can.  Do you understand my situation?
    This maybe something you don’t have time to help me with.  If not can you suggest somewhere I can get an answer?  I really need help.  PLEEEZZZ HELP ME.
    Bruce Schuerman
    Norman, OK
    405_514-4875 (call collect)
    [email protected]

    Is there any solution (other than buying
    I really think 'buying' is the best solution on this one.  Ideally, you would have at least five internal hard drives.
    System
    Projects
    Cache/Scratch
    Media
    Exports
    Use externals and network drive only for backup.

  • How to get the source code of Java Concurrent Program?

    Hi,
    How to get the source code of Java Concurrent Program?
    Example
    Programe Name:Format Payment Instructions
    Executable:Format Payment Instructions
    Execution File Name:FDExtractAndFormatting
    Execution File Path:oracle.apps.iby.scheduler
    Thanks in advance,
    Senthil

    Go on Unix box at $JAVA_TOP/oracle/apps/iby/scheduler
    You will get class file FDExtractAndFormatting.
    Decompile it to get source code.
    Thanks, Avaneesh

  • How to get the source code of a PRT application in the portal

    Hi!
    Does anybody know how to get the source code of a PRT application in the portal?
    Thanks in advance,
    Celso

    Celso,
    If its Java-based code have a look at the properties of an iView that belongs to the application in question and copy the value of the Code Link parameter e.g. 'com.sap.pct.hcm.rc_vacancyrequestov.default'.
    Search the Portal installation directory under /j233/cluster/server/ for a .par.bak file of the same name, removing .default from the codelink parameter
    e.g. com.sap.pct.hcm.rc_vacancyrequestov.par.bak
    Copt this locally and import into Netweaver Developer Studio. You will have to decompilte the class files with a decompiler such as DJ Decompiler or Cavaj (search with Google).
    Cheers,
    Steve

  • How to get the source code of an HTML page in Text file Through J2EE

    How to get the source code of an HTML page in Text file Through J2EE?

    Huh? If you want something like your browser's "view source" command, simply use a URLConnection and read in the data from the URL in question. If the HTML page is instead locally on your machine, use a FileInputStream. There's no magic invovled either way.
    - Saish

  • How to get the source code of an HTML page in Text file Through java?

    How to get the source code of an HTML page in Text file Through java?
    I am coding an application.one module of that application is given below:
    The first part of the application is to connect our application to the existing HTML form.
    This module would make a connection with the HTML page. The HTML page contains the coding for the Form with various elements. The form may be a simple form with one or two fields or a complex one like the form for registering for a new Bank Account or new email account.
    The module will first connect through the HTML page and will fetch the HTML code into a Text File so that the code can be further processed.
    Could any body provide coding hint for that

    You're welcome. How about awarding them duke stars?
    edit: cheers!

  • Where to  find the pcui_gp  components ,How to get the source code of those

    Hi All,
    Can anybody tell the exact location wher the pcui_gp components will be stored if they are  not appearing.
    And another question is how to get the source code of the pcui_gp for customization.
    anybody working on these compoents please help me.
    answers will be rewarded.
    thanks and regards,
    anand

    Hi Arun,
    I am unable to see the pcui_gp components in the DTR ,I require this in order to get the source code of one of its component.
    Can you please tell me the step by step procedure getting those pcui_gp components from J2ee engine to the  dtr or  NWDI.
    If there are any documents on pcui_gp components exclusively please do forward to my mail id [email protected]
    Thansk and Regards,
    Anand.

  • How to get the source of a strange posted pic into my camera roll?

    I got a strange pic put into my camera roll, this pic is most likely put by an app which has an access to my photo gallery, all I want to know is how to get the source which put this image into my camera roll, I have a punch of apps that have a photo access grant and really don't know to disable all of these apps because of only one of them.
    p.s: the apps with photo access in my device (ProCam, CameraArtFXFree, Photo Editior-, Instagram, Poster++, Photo Vault, Facebook, Tango, Viber, Y! Messenger, Ipadio, Line, WhatsApp) And the only opened apps when this photo pushed to my Camera Roll were (Viber, Tango, Line, Whatsapp).
    Thanks in advance.

    >
    Nitesh Kumar wrote:
    > Hi,
    >
    > FM to get the program source code: RPY_PROGRAM_READ
    >
    > By using this FM you can get the program name(say report_name) and then you can use
    >
    > READ REPORT report_name INTO itab
    >
    > Thanks
    > Nitesh
    u dont need the last statement the FM itself returns an itab with code in it.

  • How to get event when app is minimized.

    How to get event when app is minimized in only windows app, not phone version.

    Hi,
    Suspending Event will be called when a windows store app is minimized. It will not hit the Suspending Event when minimised while debugging, So you need to trigger it manually from the VisualStudio Toolbar.
    Also Read
    Application Lifecycle for windows apps
    Pradeep AJ

  • How to get event when any library object added to indesign doc?

    I want to do some operation when any library object is added to doc. So please tell me how to get event when any library object is added to the doc. better provide some code snippet.

    Daves61,
    I need to clarify what kind of event you're interested in.
    1. When you click once on page/spead widget in the Pages panel and only widget becomes selected. The layout window remains unchanged. OR
    2. When you doubleclick on page/spread widget the selected master spread appears in the layout window.
    In the first case you work with Pages panel.
    Have a look to file PageTransitionsPanelObserver.cpp from SDK. 
    PageTransitionsPanelObserver::LazyUpdate()
    In the second case you work with Layout window.

  • How to get event.target/event.currentTarget for HTML-5 canvas for click handler

    Hi,
    I hope everyone is doing great.
    I belong to Actionscript background and just started on Flash CC HTML-5 canvas.
    How to get event.target or event.currentTarget in Flash CC for HTML-5 canvas for click event.
    Like we used to do it in AS 3.0
    btn.addEventListener(MouseEvent.CLICK , go);
    function go(evt:MouseEvent){
       trace(" evt - "+evt.currentTarget); // It will let us know the clicked target
    For  HTML-5
    btn.addEventListener('click' , go.bind(this));
    function go(evt){
       console.log(" evt - "+evt.????t); // what is the correct syntax here?
    Thanks,

    Hey guys found the answer from stackoverflow
    it is - evt.target

  • How to get event press ESC when plugin's GUI is flashUI

    Hi all
    I implement my plugin use GUI is FlashUI (CSExentersion suite).
    when I pressed ESC. My GUI close imidately.
    I want to check whe n ESC press. But I can't get event pressed key for ESC
    I think that my GUI close from Illustrator. But I don't know how to get event press ESC.
    Thank for your help.

    Put a trace() to print the keyCode into the stage's keydown handler and run your extension in debug mode of flash builder, you can check whether ESC is pressed or not.
    However, I don't know how to prevent extension from closing neither.

  • How to get event.columIndex on dragstart (before the actual drag)

    Hi there,
    I would like to know how to get event.columnIndex (ListEvent) when a drag starts within a datagrid.
    I need the index to get the value from a selected cell in a datagrid.
    It works with the itemClick handler (but then I have to click before dragging) on the datagrid but the DragEvent does not have a columIndex for de underlaying datagrid.
    Please advice and thanks.
    Grtz

    The dragStart event is a subclass of a MouseEvent that can be used in
    mouseEventToItemRenderer

  • How will get the source code of all the tables in a given schema using SQL?

    Hi All,
    How can we get the source code of all the tables in a given schema using SQL?
    Thanks in Adv.
    Junu

    Try something like...
    set heading off
    set pagesize 0
    col meta_data for a96 word_wrapped
    set long 100000
    SELECT DBMS_METADATA.GET_DDL(object_type, object_name, owner) ||';' AS meta_data
    FROM dba_objects
    WHERE owner = '<SCHEMA NAME>'
      AND object_type not in (<list of stuff you do not want>);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • No Color at all!

    Installed the latest version of the Final Cut Suite on my MacBook Pro, but Color wouldn't install at all. Not a trace of it. Anyone knows why? Thanx in advance. Fabrizio.

  • Mail crashes w/IMAP account access; EXC_BAD_ACCESS; KERN_PROTECTION_FAILURE

    My Mail app crashes with error (see below) when trying to access an IMAP account. I installed Adobe Creative Suite 2, that caused Mail and Safari to both fail. I uninstalled CS2 but that didn't help. I tried a different user account, and both Safari

  • DispCache appears to be corrupt. getDispFile() returned null

    Hi all, I am deploying web services in production mode on Solaris 8 and Win2K. I get identical errors when I invoke the web service from a Java client: "DispCache appears to be corrupt. getDispFile() returned null" The complete stack trace is posted

  • Memory Full Error in Crystal Reports Viewer

    Environment: Windows 7 64 Bit Crystal Reports for Visual Studio Version 13.0.13.1597 SQL Server Database Connecting with OLE BD (ADO) I am previewing a report in the Crystal Reports Viewer and it instantly returns an error pop-up "Memory Full".  When

  • What phone is compatible with Mac?

    Sorry, but really did not know where to put this. My girlfriend wants a new phone...well she has to get one as we cant find any apps to run on the Mac that will enable her to copy her pictures from it to the Mac. Tried Missing Sync, but the phone (No