Calling an actionListener in a method

Im trying to call the method ticktack()
Everytime startButtonHandler is performed it must go immediately to the ticktack() method
my problem is it has an error "illegal start of expression"
My question is: what's the proper way of calling or coding a method that has an actionListener?
private class startButtonHandler implements ActionListener
              public void actionPerformed(ActionEvent e)
                   try{
                   Clock myClock = new Clock();
                   Date myDate = new Date();
                   int hrSt =  myDate.getHours();
                   int minSt = myDate.getMinutes();
                   int secSt = myDate.getSeconds();
                   //System.out.println(" "+hrSt+" "+minSt+" "+secSt);
                   String strHr = Integer.toString(hrSt);
                   String strMin = Integer.toString(minSt);
                   String strSt = Integer.toString(secSt);
                   hrTF.setText(strHr);
                   minTF.setText(strMin);
                   secTF.setText(strSt);
                   myClock.setTmpHrSt(hrDur);
                   myClock.setTmpMinSt(minDur);
                    myClock.setTmpSecSt(secDur);
                    int hrTimeElapsed = myClock.addHr();
                   int minTimeElapsed = myClock.addMin();
                   int secTimeElapsed = myClock.addSec();
                   String strHrTimeElapsed = Integer.toString(hrTimeElapsed);
                   String strMinTimeElapsed = Integer.toString(minTimeElapsed);
                   String strSecTimeElapsed = Integer.toString(secTimeElapsed);
                   hrTimeElapsedTF.setText(strHrTimeElapsed);
                   minTimeElapsedTF.setText(strMinTimeElapsed);
                   secTimeElapsedTF.setText(strSecTimeElapsed);
                   ticktack();
}//end try
                   catch(Exception error)
                        System.out.println("Error "+error.getMessage());
              } //end actionPerformed
         } //end ButtonHandlerThis is my ticktack() method
I think this is a wrong way to call a method that has an actionListener
public void ticktack()
                   Clock myClock = new Clock();
                   Date myDate = new Date();     
          private class tickButtonHandler implements ActionListener //this is where the error happens
               public void actionPerformed(ActionEvent e)
                    int sec = now.getSeconds();
                    int hr = now.getHours();
                    int min = now.getMinutes();
                    String strsec = Integer.toString(sec);
                    String strhr = Integer.toString(hr);
                    String strmin = Integer.toString(min);
                    secStopTF.setText(strsec);
                    hrStopTF.setText(strhr);
                    minStopTF.setText(strmin);
                    Timer t = new Timer(DELAY, tickBH);
                      t.start();
                    startB.setEnabled(false);
         }

Why so angry, Angry?
I think the real question is WTF are you doing declaring a class within a method? What where you hoping to achieve? Eaves-dropping voodo? Does it even compile?
And BTW... that code is terribly verbose, isn't it?
                   int hrSt =  myDate.getHours();
                   int minSt = myDate.getMinutes();
                   int secSt = myDate.getSeconds();
                   //System.out.println(" "+hrSt+" "+minSt+" "+secSt);
                   String strHr = Integer.toString(hrSt);
                   String strMin = Integer.toString(minSt);
                   String strSt = Integer.toString(secSt);
                   hrTF.setText(strHr);
                   minTF.setText(strMin);
                   secTF.setText(strSt);verses
  txtHour.setText(Integer.toString(myDate.getHours()));
  txtMinute.setText(Integer.toString(myDate.getMinutes()));
  txtSeconds.setText(Integer.toString(myDate.getSeconds()));Or are you being paid by the line?... Do they still do that? I thought it fell out of use, for obvious reasons ;-)
Maybe angryWannabeProgrammer would be more appropriate?
Yes I'm dissin ya'... All in fun, of course.
Cheers. Keith.

Similar Messages

  • Calling of actionListener on commandButton on refresh

    Hi,
    I am using one command button. On click , it is adding one record in tabel. It is creating some problem for me. It is working properly means it is adding proper data. But it went wrong, after adding a new row in table, if i do a refresh on that page it calls the actionListener method again. I can handle the duplicate data in the method. But i dont know why he is calling the actionListener on refresh of page ,
    My command button is
    <h:commandButton value="Add In Table" actionListener="#{User.addInTable}" />
    I want to use onClick tag. But it just call Java Script function. i want ot call the addInTable() written in User Bean.
    Thanks in Advance

    This is because you're resubmitting a POST request by invoking a refresh. Generally the user client (at least, Internet Explorer and FireFox) should warn you about this and ask for confirmation to resubmit the POST. Don't you get this warning?
    If you want to disable rePOSTing when refreshing the window, consider implementing a Post-Redirect-Get pattern. At the bottom of this article you can find an example: http://balusc.xs4all.nl/srv/dev-jep-prg.html

  • Error when calling a Webservice's public method in Forms10g

    Hi,
    I'm getting the following error when calling a webservice's public method, i'm using Forms10g 10.1.2.3
    java.rmi.RemoteException; nested exception is: HTTP transport error javax.xml.soap.SOAPException
    java.security.PrivilegedActionException javax.xml.soap.SOAPException
    Message send failed javax.net.ssl.SSLException SSL handshake failed X509CertChI have added the Jar containing the client proxy in both Classpaths(system variable and default.env), the jar has been made with jdk 1.4
    I also have tested the client proxy from jDeveloper and it's working there, but in Forms i'm getting this error.
    I guess my problem might be that i'm calling a webservice that is secured since the url starts with https
    what should i do to fix this ??
    Regards
    Carlos

    I understand, so i have a doubt, why the webservice works on jDeveloper ??Not just JDeveloper even soapUI and Neatbeans have a way of working without a client certificate installed.
    I do not know how they achieve it. I know that they work without a client DC.
    Cheers,
    PS: See this http://stackoverflow.com/questions/8887434/webservices-ssl-https, it offers a clue.
    The java programs run unhindered when one-way authentication is being used. These products ship with a digital certificate that is in the path of most popular CAs.
    Corollary, if the Web Server is configured for mutual authentication then you need to install and configure the client certificate in the tools.
    Edited by: Prabodh on Dec 5, 2012 8:36 PM

  • Calling session bean's business method through web dynpro component

    Hi All,
    Can anybody tell me how to call a session bean's methods through a web dynpro WITHOUT java-model or web service model ??
    I have following scenario:-
    1. Stateless Session bean having two business methods
    2. Web Dynpro component
    3.Now i want to call business methods without using any model. I have got following piece of code but I dont know how to go about it.
    4.Where do i have to set JNDI name for session bean? which interface will be looked for?
    5. Do I have to declare public part for EJB DC? If yes, how?
    //This is inside web dynpro component
    InitialContext   context = new InitialContext();
    o = context.lookup(JNDIName);
    TestSessionbeanHome homeRef = (TestSessionbeanHome) PortableRemoteObject.narrow( o,                                                                               
    TestSessionbeanHome.class);
    TestSessionbean beanRef = homeRef.create();
    <returnValue> = beanRef.<ejb method name>
    Please help to get a step-by-step approach to this case.
    Thanks and regards,
    Amey Mogare

    Hi,
    If  I comment out the part that is using session bean's business method, DC is building fine.
    And if I uncomment, then compiler is unabl eto resolve business method(s).
    And i would like to mention that my EJB + J2EE App DC is building properly, but it havent yet deployed properly as I am waiting for data-source-alias name prefix to be configured by ERP team. So will this be a reason why Web Dynpro DC is not able to resolve business methods ??
    Because Web Dynpro DC is able to resolved all interfaces of Session bean and entity bean. But when it comes to business method, its not able to resolve.
    Any more ideas why it is not happening?
    Pls help.
    Now i went through some forum posts regarding this and found that we also need to add EJB DC to Java Build Path for WebDynproDC>Properties>Java Build Path.
    I did this and now it is able to resolve business methods and DTOs as well. So to summarize I did following:-
    1. Added EJB DC (complete DC) as a Used DC to Web Dynpro DC with Buid-n-Deploy-n-Run time dependency
    2. Added Sharing reference of J2EE application DC to Web Dynpro DC -->Properties
    This reference I constructed as follows:-
    <vendorname>/<name of j2ee application as appearing under display name tag in application.xml (replacing '/' with '~')>
    So my Sharing Reference becomes:- <vendorname>/reqpstapscreqpstapja_reqid
    3. Added EJB DC to Java Build Path in Web Dynpro DC's properties
    4. Then I added following piece of code to get object of SessionBean class
    InitialContext context = new InitialContext();
    Object o = context.lookup("java:comp/env/ejb/SessionRequestIDBean");
    SessionRequestIDHome homeRef = (SessionRequestIDHome) PortableRemoteObject.narrow(o, SessionRequestIDHome.class);
    SessionRequestID beanRef = homeRef.create();
    beanRef.<business method>
    But After doing this I am facing another problem :-
    The build fails saying it is not able find the package for DTOs. But when I see the Component Controller's code it is not showing any red or yellow marks.
    Can anybody pls help me out here?
    Thanks and regards,
    Amey Mogare

  • Dynamic Call to Java Class or Method

    Hi All,
    I have a requirement to call a Class or a Method Within the same class dynamically based on the user choice. I will give an example with how I do it in pl sql.
    begin
    if (choice = 1) then
    execute immediate 'package.procedure1(params)';
    elsif (choice = 2) then
    execute immediate 'package.procedure2(params)';
    else
    execute immediate 'package.procedure3(params)';
    end if;
    end;
    From the Example above, I call a program based on user choice. How Can I do the same in Java?
    Thank you.
    Edited by: Eric S. on Jul 6, 2011 9:52 AM

    I have a requirement to call a Class or a MethodYou can call a method, but not the Class where as you can instantiate the Class.
    I will give an example with how I do it in pl sql.
    begin
    if (choice = 1) then
    execute immediate 'package.procedure1(params)';
    elsif (choice = 2) then
    execute immediate 'package.procedure2(params)';
    else
    execute immediate 'package.procedure3(params)';
    end if;
    end;
    From the Example above, I call a program based on user choice. How Can I do the same in Java?The similar way. Here it takes the following structure.
    ClassA object = new ClassA();
    if(choice==1) {
          object.callMethod1();
    } else if(choice==2) {
          object.callMethod2();
    } else if(choice==3) {
          object.callMethod3();
    } Also you can switch case instead of if else. It takes the following structure.
    ClassA object = new ClassA();
    switch(choice) {
    case 1:  object.callMethod1(); break;
    case 2:  object.callMethod2(); break;
    case 3:  object.callMethod3(); break;
    }I recommend you to go with the second one which using switch.

  • Call to a possibly undefined method setPropertyIsEnumerable?

    Hi,
      I am trying to accomplish using doubleClick events on dateChoosers. Below is the code that is working:
         <mx:VBox>
                  <mx:Label text="Simple DateChooser control."/>
                  <mx:DateChooser id="dateChooser1" doubleClickEnabled="true"
                      doubleClick="displayDate2()"
                      change="displayDate(DateChooser(event.target).selectedDate)"/>
                  <mx:Label id="selection"  color="blue" text="Date selected:"/>
              </mx:VBox>
      I tried putting in doubleClickEnabled as true in Actionscript, and then call the event, and this is the syntax I used:
         //enable the double Click Enabled Property
                        dch.setPropertyIsEnumerable("doubleClickEnabled",true);
                       dch.addEventListener("doubleClick", useDate2);
      This did not work, and I got this error instead: 1061: Call to a possibly undefined method setPropertyIsEnumerable through a reference with static type mx.controls:DateChooser.   
      I tried to find a suitable import statement to insert in my code, but I am not sure what to put there. Could anyone please give me a hint what to do here to get my code to accept the method?
    Thanks in advance.
    Alice

    Hi, Ryan:
      Thanks, I got that to work, but it seems like the doubleClick does not allow me to use it on the dateChooser. Here is the code:
        The MXML:
               <mx:VBox id="box2">
                <mx:DateChooser id="dch" doubleClickEnabled="true"
                      doubleClick="displayDate2()"
                      change="displayDate(DateChooser(event.target).selectedDate)"/>
             </mx:VBox>
        The same thing in Actionscript, but not working:
         dch = new DateChooser();
         dch.addEventListener("change", displayDate);
         dch.doubleClickEnabled = true;
        dch.addEventListener("doubleClick",displayDate2);
      //Got an error saying TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::MouseEvent@20112769 to     
      //mx.events.CalendarLayoutChangeEvent.
         box2.addChild(dch);
       Could you give me some pointers on what I have wrong here?
    Thanks for your help.
    Alice

  • Call to a possibly undefined method getClipboardContents through a reference with static type flashx.textLayout.edit:ISelectionManager.

    Hi Guys,
    As i am using the nigtly build of TLF 4.0.0.11073.
    I want to copy some text from the TLF, by copy operation. I am getting this type of Error.
    - Call to a possibly undefined method getClipboardContents through a reference with static type flashx.textLayout.edit:ISelectionManager.
    In the previous build, i dont use to get this type of error, but in this nightly builds i am getting this type of error.
    Can anyone help me to fix the same or any workaound.
    Thanks in advance.
    Krishna

    This functionality is still available, but it has moved. It's now in a TextClipboard class, in the same flashx.textLayout.edit package. So you should replace calls to getClipboardFormat() with TextClipboard.getContents().
    Hope this helps,
    - robin

  • Call to a possibly undefined method

    I am having a real problem with using two different Tile Lists in one movieClip I keep getting:
    call to a possibly undefined method trousers1
    call to a possibly undefined method trousers2
    call to a possibly undefined method trousers3
    call to a possibly undefined method trousers4
    call to a possibly undefined method trousers5
    package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import fl.controls.Slider;
    import fl.events.SliderEvent;
    import fl.controls.Label;
    import fl.controls.NumericStepper;
    import flash.events.Event;
    import fl.controls.TileList;
    import flash.display.DisplayObject;
    import fl.events.ListEvent;
    import flash.utils.getDefinitionByName;
    import flash.events.EventDispatcher;
    import fl.controls.SelectableList;
    public class Main extends MovieClip
       //Variables
       var startPage:StartPage;
       var tutorialPage:TutorialPage;
       var maleSizePage:MaleSizePage;
       var femaleSizePage:FemaleSizePage;
       var maleDragDropPage:MaleDragDropPage;
       var femaleDragDropPage:FemaleDragDropPage;
       var objTShirt:Object={};
       var objTrouser:Object={};
       //clothes variables
       var tshirt1:tShirt1;
       var tshirt2:tShirt2;
       var tshirt3:tShirt3;
       var tshirt4:tShirt4;
       var trousers1:Trousers1;
       var trousers2:Trousers2;
       var trousers3:Trousers3;
       var trousers4:Trousers4;
       var trousers5:Trousers5;
       var _isDragging:Boolean;
       public function Main()
        //Pages
        startPage = new StartPage;
        tutorialPage = new TutorialPage;
        maleSizePage = new MaleSizePage;
        femaleSizePage = new FemaleSizePage;
        maleDragDropPage = new MaleDragDropPage;
        femaleDragDropPage = new FemaleDragDropPage;
        objTShirt[0+"_"+0] = new tShirt1;
        objTShirt[1+"_"+0] = new tShirt2;
        objTShirt[2+"_"+0] = new tShirt3;
        objTShirt[3+"_"+0] = new tShirt4;
        objTrouser[0+"_"+0] = new trousers1;
        objTrouser[1+"_"+0] = new trousers2;
        objTrouser[2+"_"+0] = new trousers3;
        objTrouser[3+"_"+0] = new trousers4;
        objTrouser[4+"_"+0] = new trousers5;
        _isDragging = false;
        addChild(startPage);
        //Event Listeners Buttons
        startPage.startButton.addEventListener(MouseEvent.CLICK,startButtonClick);
        tutorialPage.continueButton.addEventListener(MouseEvent.CLICK,tutorialContinueButtonClick);
        maleSizePage.continueButton.addEventListener(MouseEvent.CLICK,maleSizeContinueButtonClick);
        femaleSizePage.continueButton.addEventListener(MouseEvent.CLICK,femaleSizeContinueButtonClick);
        //Size Page Event Listeners
        maleSizePage.heightSlider.addEventListener(SliderEvent.CHANGE,heightSlChange_M);
        maleSizePage.neckSlider.addEventListener(SliderEvent.CHANGE,neckSlChange_M);
        maleSizePage.chestSlider.addEventListener(SliderEvent.CHANGE,chestSlChange_M);
        maleSizePage.waistSlider.addEventListener(SliderEvent.CHANGE,waistSlChange_M);
        maleSizePage.armSlider.addEventListener(SliderEvent.CHANGE,armSlChange_M);
        maleSizePage.legSlider.addEventListener(SliderEvent.CHANGE,legSlChange_M);
        maleSizePage.heightValue.addEventListener(Event.CHANGE,heightVChange_M);
        maleSizePage.neckValue.addEventListener(Event.CHANGE,neckVChange_M);
        maleSizePage.chestValue.addEventListener(Event.CHANGE,chestVChange_M);
        maleSizePage.waistValue.addEventListener(Event.CHANGE,waistVChange_M);
        maleSizePage.armValue.addEventListener(Event.CHANGE,armVChange_M);
        maleSizePage.legValue.addEventListener(Event.CHANGE,legVChange_M);
        femaleSizePage.heightSlider.addEventListener(SliderEvent.CHANGE,heightSlChange_F);
        femaleSizePage.bustSlider.addEventListener(SliderEvent.CHANGE,bustSlChange_F);
        femaleSizePage.hipSlider.addEventListener(SliderEvent.CHANGE,hipSlChange_F);
        femaleSizePage.armSlider.addEventListener(SliderEvent.CHANGE,armSlChange_F);
        femaleSizePage.waistSlider.addEventListener(SliderEvent.CHANGE,waistSlChange_F);
        femaleSizePage.legSlider.addEventListener(SliderEvent.CHANGE,legSlChange_F);
        //Drag and Drop page Listeners
        maleDragDropPage.menuBar.stop();
        femaleDragDropPage.menuBar.stop();
        maleDragDropPage.menuBar.topsButton.addEventListener(MouseEvent.MOUSE_DOWN,topsMenuShow_M);
        maleDragDropPage.menuBar.trousersButton.addEventListener(MouseEvent.MOUSE_DOWN,trousersMenuShow_M);
        maleDragDropPage.menuBar.shoesButton.addEventListener(MouseEvent.MOUSE_DOWN,shoesMenuShow_M);
       //Event Button handlers
       function startButtonClick(event:MouseEvent):void
        addChild(tutorialPage);
       function tutorialContinueButtonClick(event:MouseEvent):void
        if (startPage.maleSelection.selected == true)
         addChild(maleSizePage);
         removeChild(startPage);
         removeChild(tutorialPage);
        if (startPage.femaleSelection.selected == true)
         addChild(femaleSizePage);
         removeChild(startPage);
         removeChild(tutorialPage);
       function maleSizeContinueButtonClick(event:MouseEvent):void
        addChild(maleDragDropPage)
        removeChild(maleSizePage)
       function femaleSizeContinueButtonClick(event:MouseEvent):void
        addChild(femaleDragDropPage)
        removeChild(femaleSizePage)
       // slider handlers
       function heightSlChange_M(event:SliderEvent):void
        maleSizePage.heightValue.value = maleSizePage.heightSlider.value;
        maleSizePage.maleCharacter.height = maleSizePage.heightSlider.value + 280;
       function neckSlChange_M(event:SliderEvent):void
        maleSizePage.neckValue.value = maleSizePage.neckSlider.value;
        maleSizePage.maleCharacter.neck.width = maleSizePage.neckSlider.value + 40;
       function chestSlChange_M(event:SliderEvent):void
        maleSizePage.chestValue.value = maleSizePage.chestSlider.value;
        maleSizePage.maleCharacter.chest.width = maleSizePage.chestSlider.value + 141;
       function waistSlChange_M(event:SliderEvent):void
        maleSizePage.waistValue.value = maleSizePage.waistSlider.value;
        maleSizePage.maleCharacter.waist.width = maleSizePage.waistSlider.value + 140;
       function armSlChange_M(event:SliderEvent):void
        maleSizePage.armValue.value = maleSizePage.armSlider.value;
        maleSizePage.maleCharacter.leftArm.height = maleSizePage.armSlider.value + 180;
        maleSizePage.maleCharacter.rightArm.height = maleSizePage.armSlider.value + 180;
       function legSlChange_M(event:SliderEvent):void
        maleSizePage.legValue.value = maleSizePage.legSlider.value;
        maleSizePage.maleCharacter.rightLeg.height = maleSizePage.legSlider.value + 250;
        maleSizePage.maleCharacter.leftLeg.height = maleSizePage.legSlider.value +250;
       function heightVChange_M(e:Event):void
        maleSizePage.heightSlider.value = maleSizePage.heightValue.value;
        maleSizePage.maleCharacter.height = maleSizePage.heightValue.value + 280;
       function neckVChange_M(e:Event):void
        maleSizePage.neckSlider.value = maleSizePage.neckValue.value;
        maleSizePage.maleCharacter.neck.width = maleSizePage.neckValue.value + 40;
       function chestVChange_M(e:Event):void
        maleSizePage.chestSlider.value = maleSizePage.chestValue.value;
        maleSizePage.maleCharacter.chest.width = maleSizePage.chestValue.value + 141;
       function waistVChange_M(e:Event):void
        maleSizePage.waistSlider.value = maleSizePage.waistValue.value;
        maleSizePage.maleCharacter.waist.width = maleSizePage.waistValue.value + 140
       function armVChange_M(e:Event):void
        maleSizePage.armSlider.value = maleSizePage.armValue.value;
        maleSizePage.maleCharacter.leftArm.height = maleSizePage.armValue.value + 180;
        maleSizePage.maleCharacter.rightArm.height = maleSizePage.armValue.value + 180;
       function legVChange_M(e:Event):void
        maleSizePage.legSlider.value = maleSizePage.legValue.value;
        maleSizePage.maleCharacter.leftLeg.height = maleSizePage.legValue.value + 240;
        maleSizePage.maleCharacter.rightLeg.height = maleSizePage.legValue.value + 240;
       function heightSlChange_F(e:Event):void
        femaleSizePage.heightValue.value = femaleSizePage.heightSlider.value;
        femaleSizePage.femaleCharacter.height = femaleSizePage.heightSlider.value + 250;
       function bustSlChange_F(e:Event):void
        femaleSizePage.bustValue.value = femaleSizePage.bustSlider.value;
        femaleSizePage.femaleCharacter.chest.width = femaleSizePage.bustSlider.value + 150;
       function waistSlChange_F(event:SliderEvent):void
        femaleSizePage.waistValue.value = femaleSizePage.waistSlider.value;
        femaleSizePage.femaleCharacter.waist.width = femaleSizePage.waistSlider.value + 140;
       function armSlChange_F(event:SliderEvent):void
        femaleSizePage.armValue.value = femaleSizePage.armSlider.value;
        femaleSizePage.femaleCharacter.leftArm.height = femaleSizePage.armSlider.value + 180;
        femaleSizePage.femaleCharacter.rightArm.height = femaleSizePage.armSlider.value + 180;
       function legSlChange_F(event:SliderEvent):void
        femaleSizePage.legValue.value = femaleSizePage.legSlider.value;
        femaleSizePage.femaleCharacter.rightLeg.height = femaleSizePage.legSlider.value + 250;
        femaleSizePage.femaleCharacter.leftLeg.height = femaleSizePage.legSlider.value +250;
       function hipSlChange_F(event:SliderEvent):void
        femaleSizePage.hipValue.value = femaleSizePage.hipSlider.value;
        femaleSizePage.femaleCharacter.hips.width = femaleSizePage.hipSlider.value + 160;
       function heightVChange_F(e:Event):void
        femaleSizePage.heightSlider.value = femaleSizePage.heightValue.value;
        femaleSizePage.femaleCharacter.height = femaleSizePage.heightValue.value + 280;
       function bustVChange_F(e:Event):void
        femaleSizePage.bustSlider.value = femaleSizePage.bustValue.value;
        femaleSizePage.femaleCharacter.chest.width = femaleSizePage.bustValue.value + 150;
       function hipsVChange_F(e:Event):void
        femaleSizePage.hipSlider.value = femaleSizePage.hipValue.value;
       function waistVChange_F(e:Event):void
        femaleSizePage.waistSlider.value = femaleSizePage.waistValue.value;
        femaleSizePage.femaleCharacter.waist.width = femaleSizePage.waistValue.value + 140;
       function armVChange_F(e:Event):void
        femaleSizePage.armSlider.value = femaleSizePage.armValue.value;
        femaleSizePage.femaleCharacter.leftArm.height = femaleSizePage.armValue.value + 180;
        femaleSizePage.femaleCharacter.rightArm.height = femaleSizePage.armValue.value + 180
       function legVChange_F(e:Event):void
        femaleSizePage.legSlider.value = femaleSizePage.legValue.value;
        femaleSizePage.femaleCharacter.rightLeg.height = femaleSizePage.legValue.value + 250;
        femaleSizePage.femaleCharacter.leftLeg.height = femaleSizePage.legValue.value +250;
       //Drag and Drop handlers
       function topsMenuShow_M(event:MouseEvent):void
        maleDragDropPage.menuBar.gotoAndStop(2);
        maleDragDropPage.menuBar.maleTops.addEventListener(ListEvent.ITEM_CLICK,addTshirt1_M)
       function trousersMenuShow_M(event:MouseEvent):void
        maleDragDropPage.menuBar.gotoAndStop(3);
        maleDragDropPage.menuBar.maleTrousers.addEventListener(ListEvent.ITEM_CLICK,addTrousers1_M)
       function shoesMenuShow_M(event:MouseEvent):void
        maleDragDropPage.menuBar.gotoAndStop(4);
       function addTshirt1_M(event:ListEvent):void
        trace(event.rowIndex,event.columnIndex)
        if (contains(objTShirt[0+"_"+0]))
         removeChild(objTShirt[0+"_"+0]);
        if (contains(objTShirt[1+"_"+0]))
         removeChild(objTShirt[1+"_"+0]);
        if (contains(objTShirt[2+"_"+0]))
         removeChild(objTShirt[2+"_"+0]);
        if (contains(objTShirt[3+"_"+0]))
         removeChild(objTShirt[3+"_"+0]);
        addChild(objTShirt[event.rowIndex+"_"+event.columnIndex] as DisplayObject).addEventListener(MouseEvent.MOUSE_DOWN,tShirtDragPickup);
       function tShirtDragPickup(event:Event):void
        var currentDragObject:MovieClip = event.currentTarget as MovieClip;
        currentDragObject.startDrag();
        setChildIndex(currentDragObject, numChildren-1);
        _isDragging = true;
        currentDragObject.addEventListener(MouseEvent.MOUSE_UP, tShirtDragDrop);
       function tShirtDragDrop(event:Event):void
        var currentDragObject:MovieClip = event.currentTarget as MovieClip;
        currentDragObject.stopDrag();
        _isDragging = false;
        currentDragObject.removeEventListener(MouseEvent.MOUSE_UP, tShirtDragDrop);
       function tShirtTarget(event:Event):void
        if (maleDragDropPage.objTShirt[0+"_"+0].hitTestObject(maleDragDropPage.maleCharacter.chest))
         if (! _isDragging)
          maleDragDropPage.objTShirt[0+"_"+0].x = maleDragDropPage.maleCharacter.chest.x;
          maleDragDropPage.objTShirt[0+"_"+0].y = maleDragDropPage.maleCharacter.chest.y;
        if (maleDragDropPage.objTShirt[1+"_"+0].hitTestObject(maleDragDropPage.maleCharacter.chest))
         if (! _isDragging)
          maleDragDropPage.objTShirt[1+"_"+0].x = maleDragDropPage.maleCharacter.chest.x;
          maleDragDropPage.objTShirt[1+"_"+0].y = maleDragDropPage.maleCharacter.chest.y;
        if (maleDragDropPage.objTShirt[2+"_"+0].hitTestObject(maleDragDropPage.maleCharacter.chest))
         if (! _isDragging)
          maleDragDropPage.objTShirt[2+"_"+0].x = maleDragDropPage.maleCharacter.chest.x;
          maleDragDropPage.objTShirt[2+"_"+0].y = maleDragDropPage.maleCharacter.chest.y;
        if (maleDragDropPage.objTShirt[3+"_"+0].hitTestObject(maleDragDropPage.maleCharacter.chest))
         if (! _isDragging)
          maleDragDropPage.objTShirt[3+"_"+0].x = maleDragDropPage.maleCharacter.chest.x;
          maleDragDropPage.objTShirt[3+"_"+0].y = maleDragDropPage.maleCharacter.chest.y;
       function addTrousers1_M(event:ListEvent):void
        trace(event.rowIndex,event.columnIndex)
        if (contains(objTrouser[0+"t"+0]))
         removeChild(objTrouser[0+"t"+0]);
        if (contains(objTrouser[1+"t"+0]))
         removeChild(objTrouser[1+"t"+0]);
        if (contains(objTrouser[2+"t"+0]))
         removeChild(objTrouser[2+"t"+0]);
        if (contains(objTrouser[3+"t"+0]))
         removeChild(objTrouser[3+"t"+0]);
        if (contains(objTrouser[4+"t"+0]))
         removeChild(objTrouser[4+"t"+0]);
        addChild(objTrouser[event.rowIndex+"t"+event.columnIndex] as DisplayObject).addEventListener(MouseEvent.MOUSE_DOWN,trouserDragPickup);
       function trouserDragPickup(event:Event):void
        var currentDragObject:MovieClip = event.currentTarget as MovieClip;
        currentDragObject.startDrag();
        setChildIndex(currentDragObject, numChildren-1);
        _isDragging = true;
        currentDragObject.addEventListener(MouseEvent.MOUSE_UP, trouserDragDrop);
       function trouserDragDrop(event:Event):void
        var currentDragObject:MovieClip = event.currentTarget as MovieClip;
        currentDragObject.stopDrag();
        _isDragging = false;
        currentDragObject.removeEventListener(MouseEvent.MOUSE_UP, trouserDragDrop);
       function trouserTarget(event:Event):void
        if (maleDragDropPage.objTrouser[0+"_"+0].hitTestObject(maleDragDropPage.maleCharacter.waist))
         if (! _isDragging)
          maleDragDropPage.objTrouser[0+"_"+0].x = maleDragDropPage.maleCharacter.waist.x;
          maleDragDropPage.objTrouser[0+"_"+0].y = maleDragDropPage.maleCharacter.waist.y;
        if (maleDragDropPage.objTrouser[1+"_"+0].hitTestObject(maleDragDropPage.maleCharacter.waist))
         if (! _isDragging)
          maleDragDropPage.objTrouser[1+"_"+0].x = maleDragDropPage.maleCharacter.waist.x;
          maleDragDropPage.objTrouser[1+"_"+0].y = maleDragDropPage.maleCharacter.waist.y;
        if (maleDragDropPage.objTrouser[2+"_"+0].hitTestObject(maleDragDropPage.maleCharacter.chest))
         if (! _isDragging)
          maleDragDropPage.objTrouser[2+"_"+0].x = maleDragDropPage.maleCharacter.chest.x;
          maleDragDropPage.objTrouser[2+"_"+0].y = maleDragDropPage.maleCharacter.chest.y;
        if (maleDragDropPage.objTShirt[3+"_"+0].hitTestObject(maleDragDropPage.maleCharacter.chest))
         if (! _isDragging)
          maleDragDropPage.objTrouser[3+"_"+0].x = maleDragDropPage.maleCharacter.chest.x;
          maleDragDropPage.objTrouser[3+"_"+0].y = maleDragDropPage.maleCharacter.chest.y;

    You are trying to assign undefined instances of class objects rather than define them...
        objTrouser[0+"_"+0] = new trousers1;
        objTrouser[1+"_"+0] = new trousers2;
        objTrouser[2+"_"+0] = new trousers3;
        objTrouser[3+"_"+0] = new trousers4;
        objTrouser[4+"_"+0] = new trousers5;
    should be
        objTrouser[0+"_"+0] = new Trousers1();
        objTrouser[1+"_"+0] = new Trousers2();
        objTrouser[2+"_"+0] = new Trousers3();
        objTrouser[3+"_"+0] = new Trousers4();
        objTrouser[4+"_"+0] = new Trousers5();
    and I didn't look deeper to see why you aren't creating the instances you declared (trousers1, etc) instead of objTrouser[0+"_"+0] etc.

  • Call to a possibly undefined method displays when using static function in Unit Test

    Hello!
    This has been driving me nuts. I am setting up unit tests for a static class which manages a collection of songs. This is how my unit test class looks:
    //START CODE
    package flexUnitTests {
              import com.myapp.managers.MusicManager;
              import flash.utils.Dictionary;
              import flexunit.framework.Assert;
              public class MyAppManagerTest {
                        [Before]
                        public function setUp():void {
                                  var songData:Dictionary = new Dictionary();
                                  songData["mn0012345"] = new Dictionary();
                                  songData["mn0012345"]["title"] = "All the Pretty Little Horses";
                                  songData["mn0012345"]["description"] = "by: American Traditional | Voice, Piano | 3 pages";
                                  MusicManager.setSongData(songData);
                        [Test]
                        public function test_getAuthorsBySKU():void {
                                  var expected:String = "American Traditional";
                                  var given:String = MusicManager.getAuthorsBySKU("mn0012345");
                                  Assert.assertEquals(expected, given);
    //END OF CODE
    You will notice two calls in red above. When I leave them in the code I see a variety of errors which look like this:
    "Call to a possibly undefined method '' through a reference with a static type com.myapp..."
    And
    "Access of possible undefined property '' through a reference with static type com.myapp..."
    Then, when I comment out the two lines in red above, these errors go away. Flash Builder seems really flakey to me. Often I notice that the error list varies, how can it just no longer be an error? Where did this new access error come from, in a no related part of the code, by adding or removing a function call to a static class which remains in the import statement.
    Note that the MusicManager contains no references to any of the UI mxml that is throwing these errors. It just simply loads data into a few globals and allows you to grab info.
    How is my usage of this function making foreign objects inaccessible?
    Please help!!! I am really hoping there is an answer but I have a bad feeling the answer is just that Flash Builder is flakey.

    I did some more work on the issue above. There are functions with in the MusicManager that call the UserManager to get a user's ID. When I comment out these calls then the access errors go away. Well the user manager has some calls back to mxml that tell the class that changes where made. My best guess is this is where it stems into the code that is randomly throwing errors. But, it compiles fine and runs fine on a device. Is there something with test cases which doesn't invoke the UI?

  • Call transaction in Direct input method

    Hi All
      how do i use call transaction in direct input  method.
    thanks all

    Hi,
    Direct input is different and Call transaction is different.
    In Direct input method,the data will be uploaded directly into the table.
    In call transaction you can change the data before uploading into dictionary table by using tcode
    Ex for Direct input method
    TABLES: kna1.
    DATA: BEGIN OF itab1 OCCURS 0,
          str(255),
          END OF itab1.
    DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
        filename                = 'D:\ABAP EVE\ffile1.txt'
        filetype                = 'ASC'
      TABLES
        data_tab                = itab1
      EXCEPTIONS
        conversion_error        = 1
        file_open_error         = 2
        file_read_error         = 3
        invalid_type            = 4
        no_batch                = 5
        unknown_error           = 6
        invalid_table_width     = 7
        gui_refuse_filetransfer = 8
        customer_error          = 9
        no_authority            = 10
        OTHERS                  = 11.
    IF sy-subrc <> 0.
      WRITE:/ 'sorry'.
    ELSE.
      LOOP AT itab1.
        SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.
        APPEND itab2.
      ENDLOOP.
      IF sy-subrc = 0.
        LOOP AT itab2.
          WRITE:/ itab2-kunnr,itab2-name1.
          INSERT INTO kna1 VALUES itab2.
        ENDLOOP.
        IF sy-subrc = 0.
          WRITE:/ 'inserted'.
        ELSE.
          WRITE:/ 'not inserted'.
        ENDIF.
      ELSE.
        WRITE:/ 'fail'.
      ENDIF.
    ENDIF.
    Flat file:
    10001,Sadney
    10003,Yogesh
    20005,Madan
    Ex for Call transaction
    DATA: BEGIN OF itab OCCURS 0,
          str(255),
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
          lifnr LIKE lfa1-lifnr,
          name1 LIKE lfa1-name1,
          ort01 LIKE lfa1-ort01,
          END OF itab1.
    DATA: jtab LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    DATA: ktab TYPE TABLE OF bdcmsgcoll,
          wa TYPE bdcmsgcoll.
    CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
        filename                = 'D:\ABAP EVE\ffile4.txt'
        filetype                = 'ASC'
      TABLES
        data_tab                = itab
      EXCEPTIONS
        conversion_error        = 1
        file_open_error         = 2
        file_read_error         = 3
        invalid_type            = 4
        no_batch                = 5
        unknown_error           = 6
        invalid_table_width     = 7
        gui_refuse_filetransfer = 8
        customer_error          = 9
        no_authority            = 10
        OTHERS                  = 11.
    IF sy-subrc <> 0.
      WRITE:/ 'no file exist'.
    ENDIF.
    LOOP AT itab.
      SPLIT itab-str AT ',' INTO itab1-lifnr itab1-name1 itab1-ort01.
      APPEND itab1.
    ENDLOOP.
    LOOP AT itab1.
      PERFORM prginfo USING 'SAPMZBDCCT' '123'.
      PERFORM fldinfo USING 'i01' itab1-lifnr.
      PERFORM fldinfo USING 'i02' itab1-name1.
      PERFORM fldinfo USING 'i03' itab1-ort01.
      CALL TRANSACTION 'ZCSBDCCT' USING jtab
                                        MODE 'N'
                                        MESSAGES INTO ktab.
    ENDLOOP.
    --- Display the Status messages ---
    LOOP AT ktab INTO wa WHERE msgtyp = 'E'.
      WRITE:/ wa.
    ENDLOOP.
    *&      Form  prginfo
          text
         -->PRGNAME    text
         -->SCRNUMBER  text
    FORM prginfo USING prgname scrnumber.
      CLEAR jtab.
      REFRESH jtab.
      jtab-program = prgname.
      jtab-dynpro = scrnumber.
      jtab-dynbegin = 'X'.
      APPEND jtab.
    ENDFORM.                    "prginfo
    *&      Form  fldinfo
          text
         -->FLDNM      text
         -->FLDVAL     text
    FORM fldinfo USING fldnm fldval.
      CLEAR jtab.
      jtab-fnam = fldnm.
      jtab-fval = fldval.
      APPEND jtab.
    ENDFORM.                    "fldinfo
    MPP CODE.
    TOP-INCLUDE.
    DATA: OK_CODE TYPE SY-UCOMM.
    DATA: I01(10),I02(20),I03(26).
    DATA: WA TYPE LFA1.
    PAI
    CASE OK_CODE.
       WHEN 'INSERT'.
         MOVE I01 TO WA-LIFNR.
         MOVE I02 TO WA-NAME1.
         MOVE I03 TO WA-ORT01.
         INSERT INTO LFA1 VALUES WA.
         IF SY-SUBRC = 0.
           MESSAGE I001(ZCSMSG).
         ELSE.
           MESSAGE I002(ZCSMSG).
         ENDIF.
       WHEN 'EXIT'.
         LEAVE PROGRAM.
    ENDCASE.
    Reward,if useful.
    Thanks,
    Chandu

  • Calling a css user created method from jspx page in ADF faces

    Hi all,
    Can anyone help me out to solve an issue calling a css user created method from a jspx page.
    Note: The css method is not the default css method. It needs to be called using 'styleClass' attribute in any tag.
    Thanks
    Neha

    Hi,
    I am not an expert in CSS so I don't know what a css method is. However, CSS can be applied to components via EL accessing a managed bean that returns the sytle text
    Frank

  • Calling view criteria in a method call

    Hello. I'm trying to execute a query with view criteria via a method call. Is this possible? I'm trying to keep my view objects generic and not have specific bind variables.
    Thanks!

    If you want to call the VC from a method you can do something like this.
    public void QueryEmp () {
    findViewObject("EmpView1").applyViewCriteria(findViewObject("EmpView1").getViewCriteriaManager().getViewCriteria("AllClerk"));
    findViewObject("EmpView1").executeQuery();
    That any use to you??

  • How can we call "SP.UI.Notify.addNotification" methods in sharepoint designer page(.aspx) load without any onclick control?

    Hello Friends,
    How can we call "SP.UI.Notify.addNotification" methods in sharepoint designer page(.aspx) load without any onclick control?
    Scenario: When i was open my page i need to show below script,But here i used button control.
    <script type="text/javascript" src="/_layouts/14/MicrosoftAjax.js"></script><script src="/_layouts/14/sp.runtime.js" type="text/javascript"></script>
    <script src="/_layouts/14/sp.js" type="text/javascript"></script><script type="text/javascript">
    var strNotificationID;
    function showNofication()
     strNotificationID = SP.UI.Notify.addNotification("<font color='#AA0000'>In Progress..</font> <img src='/_Layouts/Images/kpiprogressbar.gif' align='absmiddle'> ", false);
    </script>
    <div class="ms-toolpanefooter"><input class="UserButton" onclick="Javascript:showNofication();" type="button" value="Show Nofitication"/> </div>
    Thanks
    Reddy

    Hi  Reddy,
    You can use the window.onload method for achieving your demand as below:
    <script type="text/javascript">
    window.onload=function(){
    </script>
    Hope this helps!
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to get caller object reference from a method

    Hi,
    I am working a already existing Java Swing project, now I got a problem, in a method I need to get the caller object reference otherwise, I can't succeed this operation. So please tell me a way how to get the caller object reference from a method. that method would be static or regular method anything will do for me.
    Edited by: navaneeth.j on Jan 29, 2010 11:20 PM

    navaneeth.j wrote:
    Actually my doubt is, I have a method "addition" method, which is using by many classes so my requirement is in the addition method I want to write a code snippet which will identify and get the the caller object. Actually I tried Reflection.getcallerclass but there I am getting "CLASS" object not the actual object reference, but I want object reference.
    Actually we have a huge project which is writen plain JAVA, so in this project the authors written the Database connection package for single database transaction. so now we are using this project source code for JSF application in this web application the DB package has serve based on the dynamic db connection parameters, so if we want to change this package fully means need to solve the dependency problem in hundreds of classes, so my point is if I can access the caller object in the DB package when ever it gets called by any class from any where of the project. So actually I liked Reflection.getcallerclass, the way of implementation perfectly works for me but it is not giving caller object reference, if something gives the caller object then I can get the DB connection parameters then there is no need to pass the parameters in the hierarchy.You can add a parameter (of type Object) to your addition() method
    and everywhere you call the addition() method also pass this (which from the POW of the addition() method will be a reference to the calling class instance).
    There may be alternative solutions
    but none that require less effort.

  • 1180: Call to a possibly undefined method getDefinitionByName

    1180: Call to a possibly undefined method getDefinitionByName.   << i have this error
    i want to draw coins.
    so in library i have playerCoins100 and playerCoins200 movie clips with classes like name and base class: flash.display.MovieClip
    separated code:
    //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                   //show points in user bag
                   var classNames:Array = ["playerCoins100", "playerCoins200"];
                   var boxesList:Array = [];
                   var ClassRef:Class;
                   for (var i:int = 0; i < classNames.length ; i++)
                        ClassRef = Class(getDefinitionByName(classNames[i]));
                        boxesList[i] = new ClassRef();
                        addChild(boxesList[i]);
                   var currentBox:MovieClip;
                   var numCol:int = 3;
                   for (var columnIterator:int = 0; columnIterator < boxesList.length; columnIterator++)
                        var column:int = columnIterator % numCol;
                        var row:int = int(columnIterator / numCol);
                        currentBox = boxesList[columnIterator];
                        currentBox.x = currentBox.width * column;
                        currentBox.y = currentBox.height * row;
                   //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    any ideas?

    how i can put this array to point with coordinate x=200 and y=300 ?
    need create mc and put elements to this mc? or how?

Maybe you are looking for