Missing Action Event from Custom Component

Hi JSF Gurus,
I have two custom components, both extends UICommand and have their
own renderers. I use them on two seperate pages, say component1 on
page1 and component2 on page2. And page2 is include inside page2.
I registered an action listener on component2. When the composite page
is rendered, I clicked on component2. However, the registered action
listener was not invoked. Inside the debugging (I'm using IntelliJ
IDEA 5.0) I set a breakpoint inside the decode method of Renderer2
(renderer for component2). I do see the componen2 actually as an
actionLister method binding being set to correct value. I do queue the
new action event to component2 at the end of the decode method. But
the action listerner never invoke.
Any idea what did I miss?
Thanks,
Edmond

Hi Yuki,
Yeah, after I turn on detail JSF debugging as instructed by the book Core JavaServer Faces, I figured out I had a validation error. That solves the mystery.
Thanks,
Edmond

Similar Messages

  • Listening to event from custom component

    I have a main.mxml file, and 2 custom components: component1.mxml and component2.mxml
    I want to dispatch an event from component1 and handle it in component 2.
    I'm able to do this by handling the event first in the main.mxml then passing it on.
    But is there a way not to involve main.mxml, and to directly listen to the event from component 1 and handle it in component 2?
    I need to listen the event in actionscript, not mxml.

    You can dig in to custom event handlers
    Best Regards,
    Yogesh

  • Dispatching & listening for custom events from custom component [Flex 4.1]

    I'm giving this a try for the first time and I'm not sure I have the recipe correct!
    I have a custom component - it contains a data grid where I want to double click a row and dispatch an event that a row has been chosen.
    I created a custom event
    package oss
        import flash.events.Event;
        public class PersonChosenEvent extends Event
            public function PersonChosenEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
                super(type, bubbles, cancelable);
            // Define static constant.
            public static const PERSON_CHOSEN:String = "personChosen";
            // Define a public variable to hold the state of the enable property.
            public var isEnabled:Boolean;
            // Override the inherited clone() method.
            override public function clone():Event {
                return new PersonChosenEvent(type);
    Then I try to dispatch the event within the component when the datagrid is doubleclicked:
    import oss.PersonChosenEvent
    dispatchEvent(new PersonChosenEvent(PersonChosenEvent.PERSON_CHOSEN, true, false));
    And in the parent application containing the component I do on creationComplete
    addEventListener(PersonChosenEvent.PERSON_CHOSEN,addPersonToList);
    The event does not seem to fire though. And if I try to evaluate the "new PersonChosenEvent(..." code it tells me "no such variable".
    What am I doing wrong?
    (It was so easy in VisualAge for Java, what have we done in the last 10 years?? )
    Martin

    I've done this kind of thing routinely, when I want to add information to the event.  I never code the "clone" method at all.
    Be sure that you are listening to the event on a parent of the dispatching component.
    You can also have the dispatching component listen for the event too, and use trace() to get a debug message.
    I doubt if it has anything to to with "bubbles" since the default is true.
    Sample code
    In a child (BorderContainer)
    dispatchEvent(new ActivationEvent(ActivationEvent.CREATION_COMPLETE,null,window));
    In the container parent (BorderContainer)
    activation.addEventListener(ActivationEvent.CREATION_COMPLETE,activationEvent);
    package components.events
        import components.containers.SemanticWindow;
        import components.triples.SemanticActivation;
        import flash.events.Event;
        public class ActivationEvent extends Event
            public static const LOADED:String = "ActivationEvent: loaded";
            public static const CREATION_COMPLETE:String = "ActivationEvent: creation complete";
            public static const RELOADED:String = "ActivationEvent: reloaded";
            public static const LEFT_SIDE:String = "ActivationEvent: left side";
            public static const RIGHT_SIDE:String = "ActivationEvent: right side";
            private var _activation:SemanticActivation;
            private var _window:SemanticWindow;
            public function ActivationEvent(type:String, activation:SemanticActivation, window:SemanticWindow)
                super(type);
                _activation = activation;
                _window = window
            public function get activation():SemanticActivation {
                return _activation;
            public function get window():SemanticWindow{
                return _window;

  • Navigating from Custom Component to Standard Compoent(IUICCON). Getting Exception "Define Component Usage 'Random Component Usage of Standard component'"

    Hi Everyone,
    We have a requirement to
    Navigate from Custom Component to the Standard Component(IUICCON – Contract
    management) on the basis of some conditions.
    We tried navigating with Manual
    as well Dynamic Navigation. The Navigation is happening properly and the Navigation is completed and we are on the Contract
    Management Screen(Standard component View).
    On the Contract Management
    screen (standard Component view), when we click on New Contract Button; it throws dump stating “Define
    Component Usage IUICOBJ”. After debugging we identified that the issue was with the Parent class/ component is getting changed, because of which the usage was not found.
    Appreciate your help.
    Thanks in Advance.
    Regards,
    Bhavikjp.

    Hi Bhavik,
    Check which is the active enhancement set at the runtime in the component_loading BADI.
    If it is anything other than your enhancement set,Set it to your enhancement set .
    Check if the parameter WCF_IGNORE_ENHANCEMT in Tcode SU01 is set to 'A' for the User.
    Regards JP.

  • Listening in main application for event coming from custom component

    I have a custom component that im using for a login.  i watch videos and tutorials on how to pass variables between custom components and application. the problem im having is that must tutorials or explanation have you put the event on the custom component and then it refers to some function within the main app.
    Is there a way to just listen on the main app when that event kicks off? ive been trying for hours and i know there has to be something im missing it cant be that hard. any help i would really appreciate.
    Thanks
    Miguel

    Sounds like you're asking about addEventListener():
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
                        comp.addEventListener("test", testHandler);
                   private function testHandler(e:Event):void {
                        trace(e);
              ]]>
         </fx:Script>
         <local:TestComponent id="comp"/>
    Add an event listener on your custom component (first string is the 'type' of the event).

  • Capture event from custom.pll?

    Hi friends,
    I've been reading in Developers Guide about events capture (p.787) in custom.pll but I've not found anything about capture the event (or something similar) whe we close a descriptive flexfield window....
    Is there any way to know from custom.pll when a window is closed? The purpose is to make diferents actions when the focus return to the original form.
    Thanks.
    Jose.

    Does the WHEN-FORM-NAVIGATE event fire when closing one form and returning to another? However I am pretty sure that this fires when switching between forms without closing one of them as well.

  • Error when calling bpm service from custom component

    Hi all,
    I have built a custom component in order to fetch task related data by calling a bpm service inside the method of my custom service.
    This is the error trace i got in audit info.
    "not loading page MSG_PAGE because it is up to date with timestamp 1324331008000
    Script stack dump (user: abc, request: IdcService=CUSTOM_SERVICE&dDocName=ABC018005)
    No resource include or function stack for error. "
    What does this error signify?
    In the service definition of my custom service, I am using MSG_PAGE as my template. Is it related to this why i am facing the error? how do i get to know for a particular  functionality i should use a particular template?
    Please provide your inputs asap.
    Thanks in advance.

    HI jiri,
    Please have a look at the stacktrace and provide me a solution as in how to overcome the error.
    I had included Report.trace in order to check the flow of the program and found that the problem arises when i establish the connection.
    Caused by: java.lang.IllegalArgumentException: interface bpmpackage.TaskQueryService is not visible from class loader
             at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
             at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
             at weblogic.wsee.jaxws.spi.ClientInstance.createProxyInstance(ClientInstance.java:143)
             at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.getPort(WLSProvider.java:855)
             at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:344)
             at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.getPort(WLSProvider.java:792)
             at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
             at javax.xml.ws.Service.getPort(Service.java:92)
             at bpmpackage.TaskQueryService_Service.getTaskQueryServicePort(TaskQueryService_Service.java:97)
             at package.BPMConnection.getService(BPMConnection.java:58)
             at package.classname.fetchTasks(classname.java:239)
             at package.classname.InboundServiceMethod(classname.java:311)
             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 intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
             at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:324)
             at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)
    Thanks in advance.

  • Generate action events from objects

    Is there a way to have an object generate an event for a component just as if that component had received the event from the user?
    i.e. I have a JPanel that has a MouseListener added to it. Can I have a separate object (or actually just having the JPanel do it itself would be fine) create a MouseEvent and fire it to the MouseListener so that the code in the MouseAdapter's MouseClicked method gets run?
    Thanks,
    Matt

    I think Component.dispatchEvent() is what you are looking for.

  • Calling from custom component

    I need to call a switch the viewstack panel from a child of
    it which is a custom login component in separate mxml file after
    authorising, can anyone explain how to do it flex AS3?

    Just listen to the event in the parent itself... and when
    dispatching the event make sure you set bubbles to true.

  • Action Events from sub-components?

    I have a main Swing GUI JFrame, in this frame I have a JLayeredPane (should have named it JLayeredPain). I have a button to switch the layers (only 2 layers, one is a text area, one is a new class which I wrote) On startup the Textarea shows. I click "Switch" and the new class object ( extends JPanel) shows in the JLayeredPane. In the new object I have a JButton "Back". I would like "Back" to cause the main GUI to switch the layers back to the TextArea. I need to somehow pass the ActionEvent from the secondary class From the "Back" button to the Main GUI to call jLayer.moveToFront(TextArea). Hmmm, but I don't know how to do this... Any thoughts would be helpful.

    Use JTabbedPane instead. JLayeredPane is only useful if you have to stack a bunch of transparent layers like Adobe Illustrator does.
    JLayeredPane isn't real good at dynamically changing event listeners. In theory, JLayeredPane should direct events to the topmost layer. In practice, I could never get it to direct events to anything other than the first added component that had any listeners. Changing the order of the layers had no effect. In the end, I added an extra transparent JPanel on top with listeners to trap the events and perform the corresponding action on the correct layer. I'll be this is exactly how Adobe Illustrator is implemented.

  • Missing prpoerty in new custom component

    Hi ,
    I try a custom label component. When I add it into the form, some default properties are missing e.g. text.
    Any idea ?
    Do I missing something in the taglib ?
    Thanks
    Wilson

    Hi Wilson,
    Please take a look at the thread below:
    http://swforum.sun.com/jive/thread.jspa?threadID=48814
    This might be of help to you
    Thanks
    RK.

  • Can JSF get Action Events from Applet  or  td

    following is a example of click different part of Command to get different effect.
    I wish get same effect as click on applet; In fact , I wish get the clicked point value (x and y ) relative to Component.
    Is this possible?
    Please help me to realization it. thanks!
    <html>
       <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
       <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
       <f:view>
          <head>                 
             <link href="styles.css" rel="stylesheet" type="text/css"/>
             <f:loadBundle basename="com.corejsf.messages" var="msgs"/>
             <title>
                <h:outputText value="#{msgs.indexWindowTitle}"/>
             </title>
          </head>
          <body>
             <h:form>
                <h:commandButton image="mountrushmore.jpg"
                   actionListener="#{rushmore.listen}"
                   action="#{rushmore.act}"/>
             </h:form>
          </body>
       </f:view>
    </html>
    package com.corejsf;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.util.Map;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    public class Rushmore {
       private String outcome = null;
       private Rectangle washingtonRect = new Rectangle(70, 30, 40, 40);
       private Rectangle jeffersonRect = new Rectangle(115, 45, 40, 40);
       private Rectangle rooseveltRect = new Rectangle(135, 65, 40, 40);
       private Rectangle lincolnRect = new Rectangle(175, 62, 40, 40);
       public void listen(ActionEvent e) {
          FacesContext context = FacesContext.getCurrentInstance();
          String clientId = e.getComponent().getClientId(context);
          Map requestParams = context.getExternalContext().getRequestParameterMap();
          int x = new Integer((String) requestParams.get(clientId + ".x"))
                .intValue();
          int y = new Integer((String) requestParams.get(clientId + ".y"))
                .intValue();
          outcome = null;
          if (washingtonRect.contains(new Point(x, y)))
             outcome = "washington";
          if (jeffersonRect.contains(new Point(x, y)))
             outcome = "jefferson";
          if (rooseveltRect.contains(new Point(x, y)))
             outcome = "roosevelt";
          if (lincolnRect.contains(new Point(x, y)))
             outcome = "lincoln";
       public String act() {
          return outcome;
    }

    final JList list = new JList(dataModel);
    MouseListener mouseListener = new MouseAdapter() {
         public void mouseClicked(MouseEvent e) {
             if (e.getClickCount() == 2) {
                 int index = list.locationToIndex(e.getPoint());
                 System.out.println("Double clicked on Item " + index);
    list.addMouseListener(mouseListener);

  • Capture event from mxml component

    I have an accordian control in my main mxml application. Each
    item in the control is a custom mxml component that I created that
    consists of a label and some text. When the label is clicked, I
    need to fire off a message to the containing application with a
    string value. I'm not sure how to do this. Here's what I have right
    now. I'm not sure if I'm going down the right track but if I am,
    how do I pass the string argument with the event and then capture
    this event and the argument in the main application?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="200">
    <mx:Script>
    <![CDATA[
    private var _title:String = "";
    private var _desc:String = "";
    [Inspectable(defaultValue=true)]
    public function set Title(title:String):void{
    _title = title;
    public function set Description(desc:String):void{
    _desc = desc;
    private function SetMovie(url:String):void{
    dispatchEvent(new Event("MovieTitle"));
    [Bindable(event="MovieTitle")]
    ]]>
    </mx:Script>
    <mx:VBox>
    <mx:Label id="lblTitle" text="{_title}" width="190"
    click="SetMovie('testmovie.flv');/>
    <mx:Text id="txtDescription" text="{_desc}"
    width="190"/>
    </mx:VBox>
    </mx:Canvas>

    You have several issues, and several options here. First, a
    custom event can pass any data you want, and is not very hard to
    create.
    However, there is a still easier way. All of the Event
    objects have a "target" and "currentTarget" property which give you
    a reference to the object that dispatched the event.
    So, in your component, implement a public property, say like
    this:
    public function get Title():String{
    return _title;
    then in a handler function you can do:
    private function onMovieTitle(event:Event):void {
    var sMovieTitle:String = event.currentTarget.Title; //watch
    out for reserved words, though
    There are two ways to listen for an event. One easy way is to
    use a bubbling event. Some folks advise against bubbling event
    because of potential event name collisions, but this may not be a
    concern for you. It has not yet concerned me enough to make me
    avoid using bubbling.
    The other way is to declare handler on the component itself.
    Also, if you use a metadata tag, you can assign the handler on the
    mxml tag, instead of using addEventListener():
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="200">
    <mx:Metadata>
    [Event(name="MovieTitle", type="flash.events.Event")]
    </mx:Metadata>
    <mx:Script>
    Then, in you main app:
    <myComp id="mc1" ... MovieTitle="onMovieTitle" ...
    Without the metadata, you would do
    mc1.addEventListener("MovieTitle",onMovieTitle)
    Using a bubbling event:
    change the dispatchEvent to this:
    dispatchEvent(new Event("MovieTitle",true)); //the 'true'
    makes it bubble
    Then, in the main app, listen ON the main app(this):
    this.addEventListener("MovieTitle",onMovieTitle);
    Tracy

  • Calling Action listener in Custom component

    Hello,
    I am currently developing my own component containing an hyper-link and I am stuck with the Renderer. What should I put in the href of my "a" tag (<a href="???">) in order to call an Action listener ? I would like my renderer to do something similar to <h:commandLink actionListener="#{myBean.myActionListener}".
    Could you help me?
    Gerald.</a>

    Hello,
    Did you achieve this??? I'm also planing to put very similar to your thought. If you have a solution on your requirement, pls mail me to [email protected]
    Thanks in Advance.
    regards,
    Ram

  • Action event from jComboBox1 to setModel for jComboBox2

    I am an extreme newbie. Sorry if the answer to this is obvious. I have 1 combo box(paperType) that has 2 items. Depending on which item is selected on jComboBox1, i want it to set the model for jComboBox2(weightBox). Using NetBeans IDE 6.5.1 - it is telling me that "_setModel(javax.swing.ComboBoxModel) in javax.swing.JComboBox cannot be applied to (java.lang.String[]_)". Here is the code I am trying to use:
    private void paperTypeActionPerformed(java.awt.event.ActionEvent evt) {                                         
    final String papType = (String)paperType.getSelectedItem();
    {String[]texwgtString = { "50", "60", "70", "80", "100" };
    {String[] covwgtString = {"65", "80", "100", "120"};
    if(papType == "Text/Book"){
    weightBox.setModel(texwgtString) ;
    else weightBox.setModel(covwgtString);
    What am I doing wrong? Again, I am still way new at this.
    Thanks, Dave

    To post code, use the code tags -- [code]Your Code[/code] will display asYour CodeOr use the code button above the editing area and paste your code between the {code}{code} tags it generates.
    Read the API for JComboBox. What is the Type of the parameter to setModel? And what is the Type of your variable reference texwgtString?
    Apart from that, you also have misplaced braces in the code you posted.
    db

Maybe you are looking for

  • Can I have 2 HD DVRs in the same room, and control them separately?

    New FIOS TV being installed in two weeks, making the switch from Dish Network.  If I have two DVRs in the ame room, and two remotes, can the remotes be set up to work with each DVR separately, or will one remote cause both DVRs to respond?  WIth my D

  • Firefox beta 35 not ready for prime time.

    I have spent the entire weekend trying to get the Firefox beta 35 to work. What I have found is that *all* extensions fail to work with the exception of Places Maintenance. I can not download any extension Firefox is so famous for. The error is somet

  • Inheritance not working..

    Hi! I would like to clean my code.. There are several connection classes, which all have the same methods. so, inheritance is the choice. for e.g., all my classes start with and use "initWithDelegate". now, my new parent connection class holds this m

  • Problem whit audio in sony ericsson k300

    Hello from colombia. I have this problem. I have an application that executes a file wav, in the emulator of java works perfectly nevertheless when proving it in the cellular east is speechless. i try whit a mp3 file but the application fails (MediaE

  • How to shutdown startup 11g OEM/GRID from Command Line

    Please describe how to shutdown and startup OEM/GRID 11g from command line and how to startup all of its services. Thanks in advance!