Using Click Functions Inside ItemRenderers Causing "Undefined Method" error

I have a tilelist which has an item renderer and the item renderer has a small button in it which intentionally should remove the specific item once the button is clicked making each item removable from the tilelist by clicking the little button on each item within the tilelist. However when I try to apply my removeProduct() function, which I've already defined, to the button I get the error "Call to a possibly undefined method" but this function can be applied to other buttons fine so I know it has been defined correctly. It just seems to throw this error when I try to apply it to the button inside the itemrenderer of my tilelist. Anyone else had this problem? Is it to do with it being within a item renderer?
Here's my code for the function:-
public function removeProduct():void { 
var item:Object = cartTilelist.selectedItem; 
var idx:int = shoppingCartAC.getItemIndex(item);shoppingCartAC.removeItemAt(idx);

forst create custom Event:
public class MyItemEvent extends Event
        public static const MY_ITEM_REMOVE:String = "MyItemEventRemove";
        private var _myItemClicked:Object;
        public function get myItem() : Object{
            return this._myItemClicked;
        public function MyItemEvent(type:String,itemParam:Object, bubbles:Boolean=true, cancelable:Boolean=false)
            super(type, bubbles, cancelable);
            this._myItemClicked = itemParam;
        override public function clone():Event{
            return new MyItemEvent(this.type,this._myItemClicked,this.bubbles,this.cancelable); // bubbling support inside
inside you Item renderer create util function (you dont have to, but its cleaner) :
private function removeItem() : void {
                this.dispatchEvent(new MyItemEvent (MyItemEvent .MY_ITEM_REMOVE,this.data,true,true));
and then third step (again inside Item renderer)  asign that function as click event handler to button:
<mx:LinkButton id="removeButton" label="X" fontSize="8"  paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" cornerRadius="6" color="#FF0000" click="removeItem()"  x="1" y="-2"/>
now wherever you have your  tilelist add listiner to it following way , (or any other way you find it fit )
yourTileListComponent.addEventListener(MyItemEvent .MY_ITEM_REMOVE,
                     function(e:MyItemEvent):void
                        trace(this + "ItemTo Remove is: " + e.myItem);

Similar Messages

  • How to use analytical functions inside a mapping

    Hello everybody. Here Isend you a trick that we are using for two years.
    If you want to use a function (for instance :ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...)) inside a mapping you must create an expression with in the INGRP1 the fields you are going to use in the window function and in the OUTGRP1 the function you want. Create an Out -attribute with the expressión and link it to a distinct operator (using a "distinct" you encapsulte the sql and you will be able to use the function inside a filter - in the where clause.). The distinct can eliminate some register (depends on the function). If you validate the expression an error will appear (don't worry about that, the mapping will be ok).
    But there is a limitation, you will not be able tou sum over, min over, max over (it detect that they are aggregator functions). Other limitation: the debugger doesn't run with this kind of functions.
    Please publish this information on "The Warehouse Builder Utility Exchange". Mi email is [email protected] (if you need more information)

    It is possible to add SUM, MIN, MAX functions also to OWB releases prior to Paris - You have to put them in double quotes - write "MIN" "MAX" "SUM" etc. The rest of the rules (adding cut-off operator after the expression - as DISTINCT, or UNION ALL) is analogical to with ROW_NUMBER()
    That means You can create mapping with following functionality:
    SELECT
    sum (salary) over (partition by DEPARTMENT) department_salary,
    salary,
    employee_id,
    employee_name
    FROM employees_salaries
    writing it this way in OWB:
    SELECT
    "SUM" (salary) over (partition by DEPARTMENT) department_salary,
    salary,
    employee_id,
    employee_name
    FROM employees_salaries
    Regards,
    Martin

  • Problem in using aggregate functions inside case statement

    Hi All,
    I am facing problem while using aggregate functions inside case statement.
    CASE WHEN PSTYPE='S' THEN MAX(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ELSE SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) END,
    how can I achieve above requirement ? Con anyone help me.
    Thanks and Regards
    DG

    Hi All,
    Below is my query:
            SELECT
            CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT
            ELSE POS.PACCT || '-' || DECODE(POS.SYSTEMCODE,'GMI1','1', 'GMI2','2', 'GMI3','4', 'GMI4','3', '0') ||POS.PFIRM|| NVL(POS.POFFIC,'000') END,
            CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-')
            ELSE POS.PFIRM||POS.POFFIC||POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-') END,POS.SYSTEMCODE,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,POS.PEXCH||DECODE(POS.PSUBEX,'<NULL>',''),
            POS.PCURSY,
            CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) END ,
            NVL(POS.PSUBTY,'F') ,POS.PSTRIK,*SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ,SUM(DECODE(POS.PBS,2,ABS(POS.PPRTQ),0))* ,
            POS.PCLOSE,SUM(POS.PMKVAL) ,
            TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
            POS.UBS_ID,POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER ,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,TO_CHAR(POS.BUSINESS_DATE,'YYYYMMDD'),
            POS.SOURCE_GMI_LIB,
            --DECODE(POS.SYSTEMCODE,'GMI1','euro','GMI2','namr','GMI3','aust','GMI4','asia','POWERBASE','aust','SINACOR','namr',POS.SYSTEMCODE),
            DECODE(p_reportid,'RVPOS_SING','euro','RVPOS_AUSTDOM','aust','RVPOS_AUSTEOD','euro','RVPOS_GLBLAPAC','asia','POS_RV_SN','namr','POS_PB','aust',POS.SYSTEMCODE),
            POS.RIC,
            CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
            DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
            CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
            CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
            NVL(C.SSECID,POS.PCUSIP),
            NULL,
            POS.PYSTMV,
            POS.PMINIT,
            POS.PEXPDT,
            CASE WHEN POS.PSUBTY='S' THEN  SUBSTR(C.ZDATA2,77,1) ELSE NULL END,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL
            FROM POSITIONS_WRK POS LEFT OUTER JOIN
            (SELECT * FROM CDS_PRODUCTS CP INNER JOIN FUTURE_MASTER FM ON
            (CP.STRXCH=FM.ZEXCH AND CP.SFC=FM.ZFC AND CP.BUSINESS_DATE = FM.BUSINESS_DATE )) C ON POS.PCUSIP = C.SCUSIP
            AND NVL(POS.PCUSP2,'X') = NVL(C.SCUSP2,'X')
            WHERE
            POS.PEXCH NOT IN ('A1','A2','A3','B1','B3','C2','D1','H1','K1','L1','M1','M3','P1','S1')
            AND (POS.PSBCUS IS NOT NULL OR POS.PCTYM IS NOT NULL OR POS.PSTYPE ='S')
            AND POS.BUSINESS_DATE = run_date_char
            GROUP BY
            POS.UBS_ID,POS.SYSTEMCODE,POS.RECIPIENTCODE,POS.BUSINESS_DATE,POS.PACCT,POS.PFIRM,POS.POFFIC,POS.PCUSIP,POS.PBS,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,
            POS.PEXCH,POS.PSUBEX,POS.PCURSY,
            CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2)  || SUBSTR(POS.PCTYM,1,4) END,
            NVL(POS.PSUBTY,'F') ,POS.PSTRIK,POS.PCLOSE,TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
            POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,POS.PSUBTY,POS.SOURCE_GMI_LIB,RIC,
            CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
            DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
            CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
            CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
            NVL(C.SSECID,POS.PCUSIP),
            POS.PYSTMV,
            POS.PMINIT,
            POS.PEXPDT,
            CASE WHEN PSUBTY = 'S'  THEN  SUBSTR(C.ZDATA2,77,1) ELSE NULL END;Now, could you plz help me in replacing the bold text in the query with the requirement.
    Thanks and Rgds
    DG
    Edited by: BluShadow on 16-May-2011 09:39
    added {noformat}{noformat} tags.  Please read: {message:id=9360002} for details on how to post code/data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Can I use table function inside Dynamic query ?

    Dear Gurus,
    I have following code
    DECLARE
    TYPE CRITERIA_LIST_TABLE AS TABLE OF VARCHAR2(20);
    OtherNoList CRITERIA_LIST_TABLE; /* CRITERIA_LIST_TABLE is index by table*/
    QUERY_STRING VARCHAR2(4000);
    BEGIN
    OtherNoList := CRITERIA_LIST_TABLE();
    SELECT DISTINCT REGEXP_SUBSTR('1,5,6,4', '[^\,]+',1, LEVEL ) BULK COLLECT INTO OtherNoList
    FROM DUAL
    CONNECT BY LEVEL <= REGEXP_COUNT('1,5,6,4', '\,') + 1 ;
    QUERY_STRING := 'INSERT INTO TAB1 (C1,C2) '||
    'SELECT C1,'||
    'C2 '||
    'FROM TAB1 ,'||
    'TABLE( '||
              'CAST (OtherNoList AS CRITERIA_LIST_TABLE) '||
                   ') OTHRNOS '||
    'WHERE TAB1.C1 = OTHRNOS.COLUMN_VALUE ';
    DBMS_OUTPUT.PUT_LINE('Query String is '||QUERY_STRING);
    EXECUTE IMMEDIATE QUERY_STRING;
    END;
    Can I use Table function inside dynamic query.
    Thanking in advance
    Sanjeev

    Try:
    DECLARE
    TYPE CRITERIA_LIST_TABLE AS TABLE OF VARCHAR2(20);
    OtherNoList CRITERIA_LIST_TABLE; /* CRITERIA_LIST_TABLE is index by table*/
    QUERY_STRING VARCHAR2(4000);
    BEGIN
    OtherNoList := CRITERIA_LIST_TABLE();
    SELECT DISTINCT REGEXP_SUBSTR('1,5,6,4', '[^\,]+',1, LEVEL ) BULK COLLECT INTO OtherNoList
    FROM DUAL
    CONNECT BY LEVEL <= REGEXP_COUNT('1,5,6,4', '\,') + 1 ;
    QUERY_STRING := 'INSERT INTO TAB1 (C1,C2) '||
    'SELECT C1,'||
    'C2 '||
    'FROM TAB1 ,'||
    'TABLE( '||
    'CAST (:OtherNoList AS CRITERIA_LIST_TABLE) '||
    ') OTHRNOS '||
    'WHERE TAB1.C1 = OTHRNOS.COLUMN_VALUE ';
    DBMS_OUTPUT.PUT_LINE('Query String is '||QUERY_STRING);
    EXECUTE IMMEDIATE QUERY_STRING using OtherNoList;
    END;p.s. not tested
    Amiel Davis

  • I have problems for to use Start function inside a case structure.

    I am doing data acquisition using the Config, Start and Read functions, all them inside a while loop. I want to use Config function only when certain conditions occur, so I put the function inside a case and no problem. But when I put the start function inside the same case, the acquisition is not good. Please view my attachment. My application is client-server type.
    Attachments:
    scope_server(config_start).vi ‏160 KB

    Boxer,
    I checked your example and have several easy but important suggestions for you:
    1.- First, make sure that the first time you initialize the VI, the AI Config and AI Start are executed, because based on the debug I made, your program doesn't do it, and this is very important.
    2.- Add an AI Clear after the acquisition is done, so that you release the resources. This is a good programming technique, and may help you solve your issue.
    3.- Add an Error Cluster, so that you know if an error occurred at some point of the acquisition. This will help you track the issue.
    4.- What do you mean by "the acquisition is not good". What does it happen? What does it do? Do you get an error? <- This is the reason of step 3.
    5.- Finally, if you have doubts
    programming AI, check one of the shipping examples of LV. They can give you a much clearer idea.
    Hope this helps,
    L Aguila
    Applications Engineeer
    National Instruments

  • Not able to use a function inside a sql in a form, Why ??

    Here SERIAL_NUM is a function, this sql work fine in TOAD and SQLPLUS but inside the form iam getting error saying "function serial_num cannot be used in a sql" Why is it like that ?? Is there anyother way to execute this sql ?
    cursor c1 is
    SELECT msn.ATTRIBUTE7 Order_No,
    SERIAL_NUM(i.SERIAL_NUMBER) Serial_No,
    msn.ATTRIBUTE5 Firmware,
    msn.ATTRIBUTE15 Site_Pref
    FROM atrd.INSTALLER_INFO i,
    mtl_serial_numbers msn
    where SERIAL_NUM(i.SERIAL_NUMBER)=msn.SERIAL_NUMBER

    Here is the process I did. My oim version is 9.1.0.2
    1) Created java program in IBM RAD and compiled it.
    2) Created jar file using jar -cvfm class-files command.
    3) Copied the jar file to javatasks folder.
    4) Tried to use this jar in adapter then got "Failed because null" and sometimes "Server could not load class" messages. most of the time i am getting "failed because null" message.
    Compiled using javac command also without using this tool and created still no luck....

  • Is it possible to use Click Function in Dropdownbox?

    Hello everybody,
    I have a question on dropdownbox GUI element:
    is it possible to use the attribute of DropDownBox to realize the 'Click ' function?That means when one value from DropdownBox being selected,some action will be done.
    I checked the attributes of dropdownbox,and found maybe the following ones will help
    onselect                    = ?
    selection                   = ?
    onclientselect              = ?
    are they correct?or which kind of attributes are
    corresponding to?
    Thanks in advance!
    Liying
    Message was edited by: Liying Wang

    Hi Liying,
    Welcome to SDN!!
    See, the highlighted part in the code, that will genrate a server side event for you upon selection:
    <htmlb:dropdownListBox id           = "DDLB1"
                      table             = "<%= projectid_tab %>"
                     <b> onSelect          = "DDLB1Event"</b>                 
                      selection         = "<%= tab1sel %>"
                      nameOfValueColumn = "name"
                      nameOfKeyColumn   = "value" />
    Now we can catch the event in event handler as:
    DATA: event TYPE REF TO if_htmlb_data,
            ddlb_event TYPE REF TO cl_htmlb_event_selection.
    DATA: data TYPE REF TO cl_htmlb_dropdownlistbox.
    event = cl_htmlb_manager=>get_event( request ).
    case event->event_id.
       when 'DDLB1'.
         ddlb_event ?= event.
         IF ddlb_event->id EQ 'DDLB1' .
           tab1sel = ddlb_event->selection .
         ELSEIF ddlb_event->id EQ 'DDLB2' .
           tab2sel = ddlb_event->selection .
         ENDIF .
      endcase.
    Hope this helps,
    Regards,
    Ravikiran.
    PS:Consider rewarding points for helpful replies.

  • Can use aggregate functions inside cursor

    Hi
    Can i use aggergate functiions inside cursors because i was getting the below error message when try to execute the below procedure.
    I need following thins to implement procedure ,When pass 100 through parameter ,that will check the total count on the table if matches delete the records from table .
    create or replace procedure p12(p_count number) is
    cnt number :=0;
    tot number :=0;
    cursor c1 is select count(1),c2,rowid from t1 where
    group by c2,rowid;
    begin
    for y in c1
    loop
    delete from t1 where row_id=y.rowid;
    cnt:=y.cnt+1;
    tot:=y.tot+1;
    if mod(y.cnt,100)=0
    then
    dbms_output.put_line(y.tot||'total records deleted');
    end if;
    end loop;
    end;
    4/14 PL/SQL: SQL Statement ignored
    4/55 PL/SQL: ORA-00936: missing expression
    Thanksinadvance
    MR

    I was still getting the error
    create or replace procedure p12(p_count number) is
    cnt number :=0;
    tot number :=0;
    cursor c1 is select count(1),c2,rowid from t1
    where c2=100
    group by c2,rowid;
    begin
    for y in c1
    loop
    delete from t1 where rowid=y.rowid;
    cnt:=y.cnt+1;
    tot:=y.tot+1;
    if mod(y.cnt,100)=0
    then
    dbms_output.put_line(y.tot||'total records');
    end if;
    end loop;
    end;
    LINE/COL ERROR
    11/1 PL/SQL: Statement ignored
    11/8 PLS-00302: component 'CNT' must be declared
    12/1 PL/SQL: Statement ignored
    12/8 PLS-00302: component 'TOT' must be declared
    13/1 PL/SQL: Statement ignored

  • Undefined method error in custom package even with proper import

    I edited the title of this thread to be a little more descriptive about the help I need.
    The background: I have a multi-file Flash application that allows users to navigate through multiple pages (similar to a website). I realized yesterday that with each mouse click, I'm loading a page into memory, but not unloading it. After navigating through several pages, my memory really starts to take a hit. So, I want to define a custom package that loads each page and unloads the previous page.
    I've gotten as far as defining the pageLoad function, but I keep getting an error that doesn't make sense to me (unless I'm importing the wrong flash packages).
    When I test the Flash, I consistently get the following error:
    dtutils.as – 1180: Call to a possibly undefined method addChild. – addChild(pageLoader);
    Everything I have found indicates that to import the addChild method, I need to import flash.display.Sprite, which I'm doing, but I am still getting the error.
    You'll have to forgive me as I'm not extremely familiar with objects or actionscript. I'm more of a hacker, but I grasp things quickly and can build on what I've already learned. This might be obvious to others, but I can't find anything that indicates that I'm doing anything wrong with my code, so any help you can give is greatly appreciated!!
    My package code:
    package com.clientname.demo
        import flash.display.Sprite;
        import flash.display.Loader;
        import flash.events.MouseEvent;
        import flash.net.URLRequest;
        public class dtutils
            //Properties
            public var pageLoader:Loader = new Loader();
            public var pagePath:URLRequest;
            //Constructor
            public function loadPage(url:String)
                pagePath = new URLRequest(url);
                pageLoader.load(pagePath);
                addChild(pageLoader);
    I've also attempted to replace the four import lines in my package with the following 3 import lines, but I still get the same error message:
    import flash.display.*;
    import flash.events.*;
    import flash.net.*;
    The code I'm using to import my package and call the function in my flash file is:
    import com.clientname.demo.dtutils;
    dtutils.loadPage("../filepath/filename.swf");
    I appreciate any help anyone can give me.

    Thanks for the feedback. Being fairly new with actionscript (and an object approach, in general), and not being a real developer, I often struggle with naming conventions. Didn't even realize there was a specific convention for what is considered a utility and what isn't. However, I appreciate your feedback and will rename my package so that it isn't confusing to any other real developers that may need to do something with this code in the future.
    Thanks!

  • 1180: Call to a possibly undefined method error for DEFINED method

    Hi,
    I have Document Class  main.Core  that in package main
    In the first frame of the .fla I have:
    stop();
    startGame();
    public function startGame():void {
           world = new World();
            world.startWorld();
    World is class in package world.
    I use import world.World;
    When I am tryng to export I get the error:
    1180: Call to a possibly undefined method startWorld.
    Can someone tell me why?
    Thanks.

    what's the following show:
    package world {
    import flash.display.MovieClip;
         public class World extends MovieClip {
              public function World():void {
    trace(this);         
              public function startWorld():void {
                   trace("b");

  • "call to a possibly undefined method" error.

    I've been working my way through the tutorials in Gary Rosenzweig's "Flash Game University" book. Working on the "paddle ball" game tutorial, I changed the name of the file from "PaddleBall.fla" to "MyPaddleBall.fla", and changed the name of the .as file and the class definition accordingly. After I do this, I get the above error when calling the initialization function ("startPaddleBall()") The target for the .as file is set correctly. I tried using the original file to test it; it compiles fine as long as it's called "PaddleBall", but as soon as I change the name to "MyPaddleBall" (or anything else), it breaks. I commented out all the other code and replaced it with a trace statement inside the startPaddleBall() function to see if there was something else causing the problem, but I got the same result. When all the other functionality is stripped out, the file still works, but only when called "PaddleBall".
    Any help would be appreciated, thanks.
    -- Mark

    Thanks, in fact I did that. It's also one reason why I commented / stripped out all the other code.
    Here is the code in the .as file as it stands right now in its entirety:
    package {
    import flash.display.*;
    import flash.events.*;
    public class PaddleBall extends MovieClip {
    public function startMyPaddleBall() {
    trace("Started");
    This code, combined with the file PaddleBall.fla (containing the function call "startMyPaddleBall()") works. When I change it to "public class MyPaddleBall" and also change the names of the .fla and .as files to MyPaddleBall, it breaks.

  • Strange behaviour: "undefined method" error

    Hello!
    I am trying to build a simple webpage.
    I created a class UserData with some functions, two of them are getUsername and getLastname. I created a HTML form, with the fields username and lastname (written exactly like this), a JSP (signup2.jsp) with the following code:
    <jsp:useBean id="user" class="phil.UserData" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <jsp:forward page="signup3.jsp"/>and another JSP (signup3.jsp) with the following code:
    <jsp:useBean id="user" class="phil.UserData" scope="session"/>
    Lastname:
    <%=user.getLastname()%>Ok. My problem is: when i submit the form, the signup3.jsp raise me a strange error:
    "The method getLastname() is undefined for the type UserData". If I replace <%=user.getLastname()%> with <%=user.getUsername()%> ... well... it works!! It shows me the username I submitted.
    So basically, my script "sees" a function within a class, but it raises an error when trying to call another function in the same class.
    The listing of this "famous" class is:
    package phil;
    public class UserData {
        public String username;
        public String firstname;
        public void setUsername(String value){
             username = value;
        public void setFirstname(String value){
             firstname = value;
        public String getUsername() {
             return username;
        public String getFirstname() {
             return firstname;
    }Anyone has any idea what this error is? I was clear enough? I don't even know how to explain it better....
    I am using Windows XP, Apache with Tomcat 5.5.0, JRE 1.5.0u4 and JDK J2SE 1.5.0u4
    Thanks!

    "The method getLastname() is undefined for the type UserData"
    If I replace <%=user.getLastname()%> with <%=user.getUsername()%> it worksOk, In your class I can see methods
    public String getUsername() {
    public String getFirstname() { I don't see any method
    public String getLastname() { Add that method to your UserData class and try again.

  • Question about undefined method error

    method in CalculatorMethods.java
    public static Date setStartDate(int leaveYr,String feb,String apr,String may)throws java.text.ParseException
    return startDate;
    }     advancedOptions.jsp
    startDate = CalculatorMethods.setStartDate(leaveYr,startMonthFeb,startMonthApr,startMonthMay);now i get this error
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 38 in the jsp file: /al/jsp/advancedOptions.jsp
    Generated servlet error:
    The method setStartDate(int, String, String, String) is undefined for the type CalculatorMethods
    An error occurred at line: 38 in the jsp file: /al/jsp/advancedOptions.jsp
    Generated servlet error:
    The method setEndDate(int, String, String, String) is undefined for the type CalculatorMethods
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    ok, im an idiot, but i suspected that anyway,
    eclispe wasent highlighting the Message class name, which i hadnt imported, therefore the method was not being reconised!
    Sorry :)
    Edited by: Sir_Dori on Nov 4, 2009 1:55 PM

  • Can I use Replace function in a decode??

    Hello,
    I am trying to use replace function inside a Decode Function,
    Here is how I am doing it:
    select
    SUBSTR (
    DECODE (
    IH.DRVD_ALT_MAIL_ADDR_PRIM_FLAG,
    'N',
    REPLACE (
    ih.subs_addr_1
    || ' '
    || ih.subs_addr_2
    || ' '
    || ih.subs_city
    || ','
    || ih.subs_state_code
    || ' '
    || ih.subs_zip_code,
    'Y',
    REPLACE (
    IH.PRINT_ALT_MAIL_ADDR_LINE_1
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_2
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_3
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_4
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_5
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_6,
    ) 1,
    50
    address from x
    Can anyone please tell me what am I doing wrong here, It always gives me an error about missing a right parenthesis.
    Thanks in advance.

    Hi Jimmy,
    Looks like you are missing the first comma in the SUBSTR function
    SELECT SUBSTR (
             DECODE (
               ih.drvd_alt_mail_addr_prim_flag,
               'N', REPLACE (
                         ih.subs_addr_1
                      || ' '
                      || ih.subs_addr_2
                      || ' '
                      || ih.subs_city
                      || ','
                      || ih.subs_state_code
                      || ' '
                      || ih.subs_zip_code,
               'Y', REPLACE (
                         ih.print_alt_mail_addr_line_1
                      || ' '
                      || ih.print_alt_mail_addr_line_2
                      || ' '
                      || ih.print_alt_mail_addr_line_3
                      || ' '
                      || ih.print_alt_mail_addr_line_4
                      || ' '
                      || ih.print_alt_mail_addr_line_5
                      || ' '
                      || ih.print_alt_mail_addr_line_6,
             ), -- HERE
             1,
             50
             address
    FROM   xRegards
    Peter

  • To use Boolean function in DECODE or CASE statement

    Hi all
    I have a scenario where i need to use a boolean function inside DECODE statement. When i tried this way iam getting "ORA-06553: PLS-382: expression is of wrong type".
    I doubt whether i can use boolean function inside DECODE or not?
    My query will be like this:
    select decode(my_fuction( ),'TRUE',1,'FALSE',0) from dual;
    Any help is highly appreciated.
    Thanks
    Sriram

    Overloaded functions must differ by more than their
    return type . At the time that the overloaded
    function is called, the compiler doesn't know what type
    of data that function will return. The compiler cannot,
    therefore, determine which version of the function to
    use if all the parameters are the same.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Default csv format

    IN Apex the default format for csv file type is 'Microsoft Office Excel Comma Separated Values File. IS there a way to change it to CSV (Comma delimited) (*.csv) The first one is the only option showing in Apex, the second option is what you get if y

  • The upper part of the page is not opaque, and the desktop shows through. Thus, the menu bar is hard to read. How to remedy this?

    The area behind the menu bar and the line above it, all the way across to the minimize, maximize and close icons is not opaque and the desktop and desktop icons show through. There is nothing I can find in Firefox Help to change this. Also, it would

  • Airport express, green light but not working.

    while streaming music to airport express, it suddenly stops. Green light on AE, but connection with wireless net is gone. iPad airport express app tells that the AE was in a network and isn't anymore. Only way to get it back working is power off/on.

  • [IS-Oil] Problems creating Delivary OIGI_DEL_CONF_CREATE

    Hi, I have a Program executed in background, which produces a Shipments Documents TD Delivery Confirmation. I use Fuction Modules『 OIGI_DEL_CONF_CREATE 』and T-CODE『OIH1』BDC   - both from Industry-Solution Oil-and_Gas (IS-Oil). 1. What kind of in case

  • Run Safari 4 and 5 on the same Mac

    Hello, Does anyone know if Safari 4 and 5 can run on the same Mac running OS X version 10.6.5? I am testing for functionality of web sites that we are developing under different browsers. Thank you, Angelo