ActionListener,action  called for all buttons.

hi,
I have developed my own toolbar in that i have my own buttons as input type='image' I have attached action and actionListener for that tag.
Problem...
If i give action or actionListener to one button it is invoked for all the buttons but i did't speacified for other buttons. Where the problem lies??
plz help me i am stuck in my work.
here's my jsp.
<av:toolbar enabled="true" id="tbar" rendered="true" bar="lower">
                    <av:tbItem enabled="true" type="delete" actionListener="#{registar.countryChanged}" action="third_page"></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="edit" actionListener="#{registar.countryChanged}" action="second_page"></avaya:tbItem>                                             
                    <av:tbItem enabled="true" type="convert" actionListener="#{registar.countryChanged}" action="third_page"></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="print" actionListener="#{registar.countryChanged}" action="third_page"></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="view" actionListener="#{registar.countryChanged}"action="second_page"></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="seprator" ></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="sched" action="third_page"></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="move" action="third_page"></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="copy" action="second_page"></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="design" actionListener="#{registar.countryChanged}"action="third_page"></avaya:tbItem>                         
                    <av:tbItem enabled="true" type="ddbtn" actionListener="#{registar.countryChanged}" value="#{toolbarBean.list}" action="third_page"></avaya:tbItem>                                                                                                                             
               </av:toolbar>     
Here see some where i have given action ,actionListener somewhere not but both of the attributes are invoked on every button.
Message was edited by:
prashantak

You are on the right track.
Implement a diaolgListener for the dialog. It'll be called when you click the ok button of the dialog. delete the record from the listener. If the user clicks the cancel button, the dialog just closes without giving you any event. This is OKif you just want to cancel the deletion of the record (no rollback needed, just abort the action). If you need more control over the process use a panelWindow inside a popup. There you can use the normal action listeners for buttons.
Timo

Similar Messages

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • Decode not called for all UIComponents in tree

    Many of the faces .jsp pages I have been working with in EA2 have not been updating their models properly.
    The symptom I have observed is that the decode method is not called for all of the UIComponents on the page.
    I think I have tracked this down to a bug in the class com.sun.faces.tree.TreeNavigatorImpl. This class appears to be used internally by some of the .jsf code to navigate the component tree.
    Studying various stack traces, it looks like the method TreeNavigatorImpl.getNextStart() is supposed to provide a preorder traversal of the component tree. Starting from the root of the tree, each call is expected to return the next node. Experimental evidence suggests that it is not doing that properly, and it fails to visit all the nodes in the tree.
    For example, if my component tree looks like this (this is a representation of the tree; not an example of a .jsp page):
    <node id = "/">
       <node id = "page">
          <node id = "carStoreForm">
             <node id = "ba0">
                 <node id = "ba1">
                     <node id = "ba3"/>
                     <node id = "br4"/>
                 </node>
             </node>
             <node id = "bold1"/>
             <node id = "more1"/>
          </node>
       </node>
    </node>A preorder traversal of these nodes should visit nodes:
    '/page'
    '/page/carStoreForm'
    '/page/carStoreForm/ba0'
    '/page/carStoreForm/ba0/ba1'
    '/page/carStoreForm/ba0/ba1/ba3'
    '/page/carStoreForm/ba0/ba1/br4'
    '/page/carStoreForm/bold1'
    '/page/carStoreForm/more1'
    However, when I write test code that calls TreeNavigatorImpl.getNextStart() directly, only the following nodes are returned:
    '/page'
    '/page/carStoreForm'
    '/page/carStoreForm/ba0'
    '/page/carStoreForm/ba0/ba1'
    '/page/carStoreForm/ba0/ba1/ba3'
    '/page/carStoreForm/ba0/ba1/br4'
    It looks to me like the method loses track of the state of the traversal, and prematurely returns null before all the nodes are visited. (It is failing to return the "bold1" and "more1" nodes.)
    This is all extremely speculative. Without jsf source or doc for any of the tree classes, it is difficult to know what is supposed to be going on. And, of course, I may just have a bug in my code.

    Okay, rather than wait for Max to respond, I decompiled the TreeNavigatorImpl class myself and studied the source code. The
    problem arises in the getNextStart() method. If the method returns
    a null value, then presumably the class has successfully traversed
    the entire tree in preorder. Unfortunately, there was a slight
    logic error that would halt traversal after you got to the last node
    of the last subtree at the beginning of your travels.
    The following code should correct this situation (let me know if I've
    introduced any new problems into the mix...). I tested this out using the simple example that Max describes above. The test code appears at the end of my revised method:
    public UIComponent getNextStart() {
    UIComponent cur = null;
    if (startTraversalDone) {
    return cur;
    if (startStack.empty()) {
    cur = root;
    Iterator iter = cur.getChildren();
    if (iter.hasNext()) {
    startStack.push(iter);
    else {
    while (!startStack.empty()) {
         Iterator iter = (Iterator) startStack.peek();
         if (iter != null && iter.hasNext()) {
         cur = (UIComponent) iter.next();
         Iterator childIter = cur.getChildren();
         if (childIter != null && childIter.hasNext()) {
         startStack.push(childIter);
         else {
         if (!iter.hasNext()) {
         startStack.pop();
         break;
    else {
         startStack.pop();
    if (startStack.empty()) {
    startTraversalDone = true;
    if (cur != null) {
    endStack.push(cur);
    return cur;
         public static void main(String[] args) {
              MyComp root = new MyComp("root");
              // build tree....
              MyComp page = new MyComp("page");
              root.addChild(page);
              MyComp csf = new MyComp("csf");
              page.addChild(csf);
              MyComp ba0 = new MyComp("ba0");
              csf.addChild(ba0);
              csf.addChild(new MyComp("bold1"));
              csf.addChild(new MyComp("more1"));
              MyComp ba1 = new MyComp("ba1");
              ba0.addChild(ba1);
              ba1.addChild(new MyComp("ba3"));
              ba1.addChild(new MyComp("ba4"));
              MyTreeNavigator nav = new MyTreeNavigator(root);
              MyComp comp = null;
              while ((comp = (MyComp) nav.getNextStart()) != null) {
                   System.out.println(comp.getComponentId());
    public class MyComp extends UIComponentBase {
         public MyComp(String id) {
              this.setComponentId(id);
         public String getComponentType() {
              return "MyComp";

  • Event and obj type in one eventlistener function for all buttons

    Hi i have something like this
    button1.addEventListener(MouseEvent.ROLL_OVER, manageMouseOver, false, 0, true);
    button1.addEventListener(MouseEvent.ROLL_OUT, manageMouseOut, false, 0, true);
    function manageMouseOver(event:MouseEvent):void{
      TweenLite.to(button1, 1, {x:100, rotationX:360, ease:Back.easeOut});
    function manageMouseOut(event:MouseEvent):void{
      TweenLite.to(button1, 1, {x:14, rotationX:-360, ease:Back.easeOut});
    and i would like to get one sentence for all button. I would like to create reference obj to use that function for all of my 7 buttons.
    button1.addEventListener(MouseEvent.ROLL_OVER, manageMouseOver(button1), false, 0, true);
    button1.addEventListener(MouseEvent.ROLL_OUT, manageMouseOut(button1), false, 0, true);
    function manageMouseOver(event:MouseEvent, obj:Object):void{
      TweenLite.to(obj, 1, {x:100, rotationX:360, ease:Back.easeOut});
    function manageMouseOut(event:MouseEvent, obj:Object):void{
      TweenLite.to(obj, 1, {x:14, rotationX:-360, ease:Back.easeOut});
    but this is not working. I know that is wrong but what i should do to do this right?

    in the listener function, use the event's currentTarget property to determine which object dispatched the event.

  • Can we keep one action file for all jsp files in struts?"

    I have 5-6 Jsp pages and all are inter connected.
    If any one make changes, these changes should be display in the database.
    In this case, I need only one Action class which can hold or manipulate all changes from all jsp pages. I am not sure "Can we keep one action file for all jsp files?"
    If yes, then how can we configure struts-config.xml file.
    If no, then pls suggest me any altenative solution.

    hai
    go for DispatchAction class and then pass as parameters
    refer struts complete reference...
    it will solve ur problems..

  • Same action for all buttons

    I want to apply the same action to all buttons in a movieclip
    without
    putting AS in every button. I'm thinking that the prototype
    call might have
    some way to do it but I haven't found anything that helps in
    my searches.
    Thanks in advance for help.

    --Put the script on your button
    -- Convert the button to a movieClip
    -- Use instances of that movieClip where you want your
    buttons.
    KB
    "SSSup" <[email protected]> wrote in message
    news:ejt651$8qs$[email protected]..
    >I want to apply the same action to all buttons in a
    movieclip without
    >putting AS in every button. I'm thinking that the
    prototype call might have
    >some way to do it but I haven't found anything that helps
    in my searches.
    >Thanks in advance for help.
    >

  • Is there a way to have the same action listener for few buttons?

    guys, lets say i have button1, button2 and button3
    how do i add the same action listener for 3 of them. doing 3 different action listener is very tedius! my assignment have almots 100 buttons but I need their action listener to be the same.

    Hi,
    Your class needs an action listener, so add implements ActionListener to you class creation string.
    Then on each button set an action command;
    button1.setActionCommand(BUTTON1);Now add an listener;
    buttons1.addActionListener(this);Finally create a method to perform a task
    public void actionPerformed(ActionEvent e)
       if (e.getActionCommand().equals(BUTTON1))
           xxxx   
      }This should do the trick.
    adelebt

  • How to change default action "alarm" for all signatures ?

    My question belongs to a Cisco 1712 (128 MB, IOS 12.3T, SDM 2.5 installed):
    I'm trying to change the default action "alarm" to "alarm,reset,drop" for all signatures of my custom set.
    However doing so via SDM fails. First, it appears as being done correctly, but after compiling the signatures again, the default values are back there (in the same sense, I was unable to delete signatures, works just using the CLI).
    I followed the instructions at cisco.com:
    router(config)#ip ips signature-definition
    router(config-sigdef)#signature 6130 10
    router(config-sigdef-sig)#engine
    router(config-sigdef-sig-engine)#event-action produce-alert
    router(config-sigdef-sig-engine)#event-action deny-packet-inline
    router(config-sigdef-sig-engine)#event-action reset-tcp-connection
    router(config-sigdef-sig-engine)#exit
    However ip ips signature-definition is not understood by the router, so the procedure fails.
    Can you please assist me ?

    You can use IOS command-line interface (CLI) to change signature actions for one signature or a group of signatures based on signature categories. The following example shows how to change signature action to alert, drop and reset for signature 6130 with subsig ID of 10.
    router#configure terminal
    Enter configuration commands, one per line. End with CNTL/Z.
    router(config)#ip ips signature-definition
    router(config-sigdef)#signature 6130 10
    router(config-sigdef-sig)#engine
    router(config-sigdef-sig-engine)#event-action produce-alert
    router(config-sigdef-sig-engine)#event-action deny-packet-inline
    router(config-sigdef-sig-engine)#event-action reset-tcp-connection
    router(config-sigdef-sig-engine)#exit
    router(config-sigdef-sig)#exit
    router(config-sigdef)#exit
    Do you want to accept these changes? [confirm]y
    router(config)#

  • Dynamic-actions/expressions for Radio button in VC

    Hi,
    I would like to know whether dynamic actions for radio-buttons are possible in VC??
    I have a situation where, i have to display/hide an input-field according to the radio-button that i select.
    Is this possible in VC??
    Because, i do not find any place where i can write expressions for a radio-button so that it can take actions accordingly.

    Actually its possible.
    Here is the sample code for this.
    tables : kna1.
    parameters : chk1 radiobutton group g1 user-command abc,
                 chk2 radiobutton group g1.
    parameters : chk3 type kunnr.
    at selection-screen output.
    loop at screen.
      if chk1 = 'x' and screen-name = chk3.
          chk3-active = '0'.
      endif.
    endloop.
    In this way you can hide a input-field on the screen.

  • One RollOver function for all buttons?

    Is there a way to streamline AS3 code so that all buttons are controlled by one rollover function? The code below isn't working for me.
    function rollOverbtn(e:MouseEvent):void{
    e.target.gotoAndStop(2);
    trace("button HIT");
    function rollOffbtn(e:MouseEvent):void{
    e.target.gotoAndStop(1);
    btn1.addEventListener(MouseEvent.MOUSE_OVER, rollOverbtn);
    btn1.addEventListener(MouseEvent.MOUSE_OVER, rollOffbtn);
    The trace works which shows me that the function IS properly firing, but the rollOver effect is not hitting. I'm sure I'm doing this wrong as I am brand spaking new to AS3.

    You're welcome.  When you use MOUSE_etc events, and "target", the target can end up being a child within the object that has the event listener assigned.  currentTarget always points to the object with the listener assigned to it.

  • Calling action listener for a BUTTON component in java bean page

    Hi,
    I have made it like this.
    public void handleButtonPressed(ActionEvent event){
    System.out.println("success!!!!!");
    //code for calling actionlistener
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    Application application = fctx.getApplication();
    ExpressionFactory exprFactory = application.getExpressionFactory();
    MethodExpression methodExpr = null;
    methodExpr = exprFactory.createMethodExpression(elctx, "#{exbean.handleButtonPressed}",null,new Class[] { ActionEvent.class });
    MethodExpressionActionListener actionListener = null;
    actionListener = new MethodExpressionActionListener(methodExpr);
    button.addActionListener(actionListener);
    Even after making the listener Function as Void wHen i click the button i m getting the error saying."ARGUMENTS MISMATCH,ADF_FACES60097"??
    can you help me out?
    and in the msg log i m getting this
    "SkinFactoryImpl> <getSkin> Cannot find a skin that matches family portal and version v1.1. We will use the skin portal.desktop.
    <MethodExpressionActionListener> <processAction> Received 'javax.el.PropertyNotFoundException' when invoking action listener '#{exbean.handleButtonPressed}' for component 'null'
    <MethodExpressionActionListener> <processAction> javax.el.PropertyNotFoundException: Target Unreachable, identifier 'custombean' resolved to null"
    I Have tried with this giving Void TYPE as an argument
    methodExpr = exprFactory.createMethodExpression(elctx, "#{exbean.handleButtonPressed},Void.TYPE,new Class[] { ActionEvent.class });
    I M getting the same error.
    Edited by: chaya on Dec 22, 2011 2:47 PM

    yeah but i m creating button itself dynamically by java code....
    //code
    UIComponent button;
    button = findComponentInRoot("cb1");
    RichPanelGroupLayout pgl;
    pgl = (RichPanelGroupLayout)button.getParent();
    List<UIComponent> children;
    children = pgl.getChildren();
    RichPanelGroupLayout pgll;
    pgll = new RichPanelGroupLayout();
    RichInputText it;
    it = new RichInputText();
    it.setLabel("New textbox " + (children.size()));
    RichCommandButton but = new RichCommandButton();
    but.setPartialSubmit(true);
    but.setText("Delete");
    /*calling actionevent*/
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    Application application = fctx.getApplication();
    ExpressionFactory exprFactory = application.getExpressionFactory();
    MethodExpression methodExpr = null;
    methodExpr = exprFactory.createMethodExpression( elctx,"#{inbean.actionPerformed}",null, new Class[] {ActionEvent.class});
    MethodExpressionActionListener actionListener = null;
    actionListener = new MethodExpressionActionListener(methodExpr);
    but.addActionListener(actionListener);
    /*end of call*/
    children.add(pgll);
    children.add(it);
    children.add(but);
    AdfFacesContext.getCurrentInstance().addPartialTarget(pgl);
    //code to call method
    public void actionPerformed(ActionEvent event) {
    System.out.println("entered sec bean");
    return " ";}
    this way i m trying to create a button programatically and tryin to add actionlistener which is not working.
    the actionlistener is throwing error.... with the line
    methodExpr = exprFactory.createMethodExpression( elctx,"#{inbean.actionPerformed}",null, new Class[] {ActionEvent.class});

  • About Gradient Map in one action, call for help!!!

    Things I meant is to import EPS files into photoshop (already CMYK, 300dpi), then make into single black&white (things like c0 m0 y0 k48 etc.) by using Gradient Map, which to ensure there is empty in all the channels except black.
    I recorded this process in one action, for I got massive pics to solve out.
    But it came weird.
    After the action was done, the pic didn't became single black. Instead of that, there are still amounts in those 3 channels (things like c10 m7 y13 k34).
    It drives me crazy...Anyone can give a hand?
    Cheers.

    Here's a truly radical idea. Convert your email to IMAP (get a new email server) and keep everything stored on the mail server. That way each computer gets exactly the same thing. I use IMAP mail this way with four different computers. Never a hiccup, no downloading mail, no data stored on my computer except what I want stored on the computer, no syncing between the computers just to keep mail current on each one. In fact I can get on your computer, configure your Mail to use my email server and see everything as it would be on any of my computers. I could send mail from your machine, read replies, etc. When I get home and open my own Mail I'll see everything as if it had been done from my home computer.
    You can then use MobileMe to sync your mail rules and configuration changes if you want, which is what I do.

  • Ps Actions work for all but one person in office. Same Software... Alignment bug/settings?

    I have created two photoshop actions that convert a PDF into jpg pages, and then slices those pages into pre-sized pieces, and saves the pieces out individually. Two versions, for two differently sized PDFs.
    We use this in the office for creating a "book" visual from a tricky indesign file.
    Both actions work fine for me.
    Both actions work fine for coworker#1.
    However, when Coworker #2 uses either of these actions, the chopped up pieces to not align properly in photoshop, and instead leave blank sections where they should have been merged together. (align box A top. Align box A to Shape_gutter. the second step never happens.
    This 'error' occurs on both PDF Styles' actions for cowroker#2, so I'm assuming it has to be a setting? We are all running the same version of photoshop (Up to Date CC 2014), and testing on the same files.
    anyone have any insight?

    Everything is not exactly the same you state one is different. There is something different in the mix.  A broken file a bug in the install in the system there is a difference some place.  You see different results... Perhaps a different level of code are plug-ins involved other actions etc.
    Post the action let us look at it/them.

  • Unknown name caller for all contact recent call . but i have save their contact number . Help ASAP !

    Hello , i need guide to fix my problems. i have facing a problem , all my call from my contact become Unknown after i change new SIM card.
    What should i do to fix it ? Already Reset all settings and format my iPhone. already sync my iphone with iTunes . but , still same . please . Help me . i got problem when im working . i dont know who did call me . every call become ' Unknown ' .

    @ antoniofrombc...no responses to help with the issue... It's very weird I must say that this happening... No to mention iCloud never is syncing information.. So no contacts on my iPad either.. I see my old contacts from my laptop from my ok'd iPhone 2....

  • Two actions in the same button

    Hi. I have a button witch tells a movie clip, that is loaded
    on an empty movie clip on stage (handler) with attachMovie, to play
    frame 101 (it leaves the stage). How can I tell the same button, at
    the same action (onRelease) to attach another movie clip only when
    the other one is over (after I told it to play from frame 101) or
    when it´s at frame something?
    Anyone can help?
    I´m using as2.0

    Hi,
    Create action binding for your button and try to call both the services from this method binding.
    Example :
    <af:commandButton action="#{pageFlowScope.myBean.submitButtonMethodBinding} .../>
    In the managed bean :
    public class MyBean{
    public String submitButtionMethodBinding(){
    ---- calll first service ---
    --- call second service ---
    return "dontgoanywhere";
    }

Maybe you are looking for

  • Not Receiving Emails on my Tour9630

    Thursday I didn't get any emails from my external email accounts (Yahoo, Hotmail, Work) until 11:40PM Pacific then I got a whole days worth.  Since then I haven't received anything. My phone works, text messaging works, the brower works, I can see th

  • Lost all of my icons in left hand window.

    Here's one for you techies! Working away merrily the other night, when I decided that I needed a multiway power socket in my room. Trouble was, my G4 iMac (flat screen) was plugged into the power socket. Logged out, shut down, waited until the hard d

  • Exchange 2010 sp2 emc initialization error using "kerberos" authentication failed

    We use exchange 2010 SP2. We have 2 management stations, both w2k8 R2 SP1. I have one mangement station on which the emc and ems works ok. On the other management staiton (which is also in another ad site) the emc and ems don't work. I get the follow

  • Cant access iCloud mail, and it won't remember my password on iPhone

    Hello, I cant access icloud through my web browser, it keeps saying: ORIGIN server TYPE error BUILDNUMBER 1FCS29.34215 TIME Tue Nov 15 2011 11:23:32 GMT+0000 (GMT)        (1321356212070) HOST www.icloud.com USERAGENT Mozilla/5.0 (Macintosh; Intel Mac

  • Problem with my code!Please help:(

    Hi Here is the final code to read each byte at a time (using buffered input stream)from a remote sensed image and then store the values in 3 arrays . The image data (it is a remote-sensed image with 3 bands) are represented as a continuous byte strea