How to return currentIndex from repeater

Greetings,
How can I return the currentIndex from a repeater on a button
click, as in:
<mx:Repeater id="Playlist" dataProvider="{MySongList}">
<mx:Label text="{Playlist.currentItem.TITLE}"/>
<mx:Button label="x"
click="Alert.show(String(Playlist.currentIndex));"/>
</mx:Repeater>
Thanks!!!

Hi BaileyBurger,
Does this sample code help
<?xml version="1.0"?>
<!-- Simple example to demonstrate the Repeater class.
-->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
[Bindable]
private var dp:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9];
]]>
</mx:Script>
<mx:Panel title="Repeater Example" width="75%"
height="75%"
paddingTop="10" paddingLeft="10" paddingRight="10"
paddingBottom="10">
<mx:Text width="100%" color="blue"
text="Use the Repeater class to create 9 Button controls in
a 3 by 3 Tile container."/>
<mx:Tile direction="horizontal" borderStyle="inset"
horizontalGap="10" verticalGap="15"
paddingLeft="10" paddingTop="10" paddingBottom="10"
paddingRight="10">
<mx:Repeater id="rp" dataProvider="{dp}">
<mx:Button height="49" width="50"
label="{String(rp.currentItem)}"
click="
Alert.show(String(event.currentTarget.getRepeaterItem()) + '
pressed')"/>
</mx:Repeater>
</mx:Tile>
</mx:Panel>
</mx:Application>

Similar Messages

  • How to return rows from tmp table created inside function??

    Hi,
    I'm trying to return rows from a cursor or table (created within
    the function). How do I specify the return type?

    Hi,
    Here is the code that examples to create a function that can
    return data from table.This is achieved using REFCURSOR concept.
    Hope this helps you.I'm giving all stuff in single PL/SQL
    block.You can break it and create a package and declare
    refcursor type and function in that as well.
    DECLARE
    -- Declare generic cursor type
    TYPE gencur_type IS REF CURSOR ;
    -- Declare generic cursor varaible
    gencur gencur_type;
    -- Declare record type
    TYPE rec_type IS RECORD(descr emp.ename%type) ;
    -- Declare record type variable
    rec rec_type;
    --This how you declare a local function that returns gencrtype
    data set
    --This function is called in main block
    FUNCTION call_refcur return gencur_type
    AS
              rr gencur_type;
    BEGIN
         OPEN rr FOR SELECT descr FROM emp;
         RETURN rr;
    END;-- end of local function
    -- Main block begins here
    BEGIN
    -- Call the local function so that gencur will have
    -- the data set returned by select statement
    gencur:= call_refcur;
    -- Open a loop to test the stuff
    LOOP
         FETCH gencur INTO rec;
         EXIT WHEN gencur%NOTFOUND;
         null;
         dbms_output.put_line(rec.ename);
    END LOOP;
    END;
    Regards,
    Sridhar

  • Oracle forms 9i - How to return back from a block?

    Some one please help me
    In a trigger, I have a code says go_block. How to return from the block and back to the trigger to continue executing the codes below the go_block statement? Please see example below, I want to come back from block CHECK_STUFF and continue execute the statements
    :Name.option := '1';
    if :name.option = '1' then
    Example:
    Block: Name
    Item: yes_no - Key-next-item trigger
    declare
    begin
    go_block('check_stuff');
    go_item('answer');
    :Name.option := '1';
    if :name.option = '1' then
    Thanks - Patty

    The code behind the GO_BLOCK is executed immediately after the GO_BLOCK, it doesn't stop at that point. So you have to split your code, like
    declare
    begin
    go_block('check_stuff');Then, create a procedure like
    PROCEDURE PR_RETURN_FROM_BLOCK IS
    BEGIN
    go_item('answer');
    :Name.option := '1';
    if :name.option = '1' then
    END;Then, when returning from the block (in whatever trigger you use), just call that procedure.

  • How to return cursor from procedure to jdbc

    plz help me through example of code as wl as procedure where.... return cursor from procedure to jdbc

    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS OFF
    GO
    CREATE procedure anil3 @count INT OUT,@opcode INT OUT,@total_tiff INT OUT
    as
    declare @query2 varchar(300),@tiff_count int,@query1 varchar(300)
    set @query1='declare move_cursor   cursor forward_only static for
    select count(opcode),opcode from TABLE1 group by opcode
    open move_cursor'
    exec(@query1)
    fetch next  from move_cursor into @count,@opcode
    set @opcode="'"+@opcode+"'"
    set @total_tiff=0
    while (@@fetch_status=0)
    begin
         set @query2='declare move_cursor2  cursor static for '+
         ' select count(tiff) from TABLE2  where opcode='+@opcode+
           ' open move_cursor2 '
         exec(@query2)
         fetch next  from move_cursor2 into @tiff_count
         while (@@fetch_status=0)
         begin
              set @total_tiff=@total_tiff+@tiff_count
              fetch next  from move_cursor2 into @tiff_count
         end
         close move_cursor2
         deallocate move_cursor2
    print  @total_tiff
    print @count
    print @opcode
    fetch next  from move_cursor into @count,@opcode
    end
    close move_cursor
    deallocate move_cursor
    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS ON
    GO******************************************************************************
    above this is sql server 2000 PL/SQL and i hv to get the value
    print @total_tiff
    print @count
    print @opcode
    through JDBC
    plz help me out how to return Cursor to JDBC and HOW toPRINT THESE THREE VALUE @total_tiff, @count, @opcode through JDBC
    get this values through JDBC

  • How to return fault from Async BPEL

    Hi,
    I have ESB that has input,output and fault, This ESB calls Async BPEL that takes only input. Now i want to return fault from BPEL to ESB. How do i do it?
    Please help.

    Hi,
    My use case is i am implementing AIA. So my enterprise layer is ESB and my ABCS provider is BPEL. As provider takes lot of time to complete the instance, to avoid timeout issue i just created Async BPEL with two ports one for input another for fault. I am able to send back my fault back to this call back port. But how i can receive the fault to the same ESB which called the BPEL?
    I am not able to implement it. I can not go for any workaround like creating one more BPEL and then make it as sync, put pick activity and receive the fault then send back to ESB.
    Thats the reason i am very specific. If you find some solution please let me know.

  • How to return fault from Async BPEL to ESB

    Hi,
    I have ESB that has input,output and fault, This ESB calls Async BPEL that takes only input. Now i want to return fault from BPEL to ESB. How do i do it?
    Please help.

    Hi,
    My use case is i am implementing AIA. So my enterprise layer is ESB and my ABCS provider is BPEL. As provider takes lot of time to complete the instance, to avoid timeout issue i just created Async BPEL with two ports one for input another for fault. I am able to send back my fault back to this call back port. But how i can receive the fault to the same ESB which called the BPEL?
    I am not able to implement it. I can not go for any workaround like creating one more BPEL and then make it as sync, put pick activity and receive the fault then send back to ESB.
    Thats the reason i am very specific. If you find some solution please let me know.

  • How to return data from Ejb as collection to Front End application.

    Hi,
    I am creating a J2ee application. Here i am accessing BAPIs using stateless session bean through JCO connection. Now the BAPI is returning a return Table and return Structure to the EJB.
    I have coded the following code in one of the Ejb Method as follows:
    JCO.Table returnTable = null;
    JCO.Structure returnStructure = null;
    JCO.ParameterList paramList = siteBAPI.getExportParameterList();
    JCO.ParameterList paramList2 = siteBAPI.getTableParameterList();
    returnTable = paramList2.getTable("SITE_SUBSITE_INSTL");
    returnStructure = paramList.getStructure("BAPIRET2");
    Now i want to sent this data( returnTable & returnStructure) to front end application where front end developer accessing this returned data using Jsp.
    My scenario is that , first i want to convert this returnTable & returnStructure in a single collection and then sent this collection to Front end.
    My aim is that , the front end the application should not receive the Data, using JCO.table Variable but as a single Collection.
    I am using NWDI-2004s sps10.
    i need urgent help on this issue and i would really appreciate if somebody can put the answer with some sample code on how to return the data as Collection.

    if you want to return a result, then you probably shouldn't be using a message bean. message beans for for asynchronous tasks. session beans for for synchronous tasks. thus it would make much more sense to have your jsp call the session bean directly.

  • How to return error from subscription function of an event

    I am creating a subscription function for an oracle shipped event, oracle.apps.eng.cm.changeObject.submit. The event fires fine, i can do my custom validations in this function. In case the validations fail, I need to return an error message.
    As per the guides and metalink documents, the way to do this is by returning 'ERROR' . But even though I return an ERROR, it does not error out. Whether I return SUCCESS or ERROR , the behaviour is the same.
    While creating the subscription function, for On Error , I selected, "Stop And Rollback ".
    Is it possible to return errors from the subscription functions.
    thanks
    Satya

    You shouldn't be passing ResultSet objects across the EJB layer.
    Instead you should be passing data back and forth.
    All of the data access code should be in one place in one class.
    That class should open the connection, run the query, process/store the results of the query and then close the connection.
    In this case you probably want to return a list of something to your jsp.
    So your EJB call should be more like
    public List<resultBean> check(String id){
      ResultSet rs = Statement.("select * from table1 where id=123");
      List resultList = new ArrayList();
      while (rs.next()){
        Bean myBean = new Bean();
        myBean.setProperty1(rs.getString("field1"));
        myBean.setProperty2(rs.getString("field2"));
        resultList.add(myBean);
      return resultList;
    }

  • How to return Collection from from entity bean to servlet?

    hi
    is it possible to return Collection from entity bean (Which is returns form CMR field ) to servlet ?
    thanks

    SERVLET
    public class test extends HttpServlet {
       @EJB
       private LocalBean lookupBean;
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
      for(Item i : lookupBean.getMyCollection() )
              out.println(i.getItemName());
            out.close();
    }BEAN INTERFACE
    public interface BeanLocal {
        Collection<Item> getMyCollection();  
    }BEAN IMPLEMENTATION
    @Stateless()
    public class Bean implements BeanLocal {
        @PersistenceContext()  
        private EntityManager em;      
         public Collection<Item> getMyCollection() {
            return em.createQuery("SELECT i from ITEM i").getResultList();
        }    and if you create an instance of your servlet you'll have to reinitialize LocalBean
    @EJB(name="myejbref", beanInterface=BeanLocal.class)
    private BeanLocal lookupBean;
    private BeanLocal getLookupBean() {
    if(lookupBean == null) {
    try {
    InitialContext ic = new InitialContext();
    lookupBean = (BeanLocal) ic.lookup("java:comp/env/myejbref");
    catch(Exception e){
    System.out.println(e.getMessage());
    return lookupBean;
    }

  • How to return values from a BSP page to Javascript

    Hi All,
    I want to call a BSP page which reads a single value from a table and returns that value I want the Javascript in the HTML code to get the value from the BSP page.
    Can you kindly let me know how I can return the value from the BSP page to JavaScript.
    Kindly please provide me a simple code of a BSP page and the Javascript
    Thanks
    Karen

    Hi,
    you need 3 elements to make the javascript code read the value in any field in the table: table´s name, line and column. This is how your code could look like:
    script language="javascript>
       var row = 0;
       function display(){
          row = row + 1;
          campo = 'tabla1_' + row + '_4';                 " <-- table, line, column
          valor = document.getElementById(campo).value;
    </script>
    ROW works as a counter. You have in variable valor the value of the field and can do with it what you want, perhaps display it with ALERT. I am reading the values from field 1 to n in column 4 in table TABLA1. Pay attention to the '_' in the concatenation of field´s name. The table in my BSP is very simple:
    <htmlb:tableView id                = "tabla1"
                           table             = "<%= mytable %>"
                           width             = "100%"
                           allRowsEditable   = "X"/>
    and somewhere I must call function display in my javascript code:
    <htmlb:button  id="boton" text="Texto aqui" onClientClick="display()" />
    So, give it a try.

  • How to return Values from Oracle Object Type to Java Class Object

    Hello,
    i have created an Oracle Object Types in the Database. Then i created Java classes with "jpub" of these types. Here is an example of the type.
    CREATE OR REPLACE TYPE person_type AS OBJECT
    ID NUMBER,
    vorname VARCHAR2(30),
    nachname VARCHAR2(30),
    geburtstag DATE,
    CONSTRUCTOR FUNCTION person_type RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_id NUMBER) RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_vorname VARCHAR2,
    p_nachname VARCHAR2,
    p_geburtstag DATE) RETURN SELF AS RESULT,
    MEMBER FUNCTION object_exists(p_id NUMBER) RETURN BOOLEAN,
    MEMBER PROCEDURE load_object(p_id NUMBER),
    MEMBER PROCEDURE save_object,
    MEMBER PROCEDURE insert_object,
    MEMBER PROCEDURE update_object,
    MEMBER PROCEDURE delete_object
    MEMBER PROCEDURE load_object(p_id NUMBER) IS
    BEGIN
    SELECT p.id, p.vorname, p.nachname, p.geburtstag
    INTO SELF.ID, SELF.vorname, self.nachname, SELF.geburtstag
    FROM person p
    WHERE p.id = p_id;
    END;
    My problem is, that if i use the member function "load_object" from my java app it doesnt return the selected values to the java class and i dont know why. I use the java class like this:
    PersonObjectType p = new PersonObjectType();
    p.load_object(4);
    There is a reocrd in the database with id = 4 and the function will execute successful. But if i try to use "p.getVorname()" i always get "NULL". Can someone tell me how to do that?
    Thanks a lot.
    Edited by: NTbc on 13.07.2010 15:36
    Edited by: NTbc on 13.07.2010 15:36

    CallableStatement =
    "DECLARE
    a person_type;
    BEGIN
    a.load_object(4);
    ? := a;
    END;"
    And register as an out parameter.
    Edited by: michael76 on 14.07.2010 05:01

  • 2 Threads issues. How to return data from a thread located in other class

    I have 2 questions.
    This is the context. From main I start one thread that does a little job then starts another thread and waits for it to end to continue.
    1) The last started thread needs to return a string to the Thread started from main. How can I accomplish that, because I read that I cannot use
    synchronized methods outside different classes (and the threads belongs to different classes).
    2) From the main thread I start the Second Thread located in another class like this ClassName obj = new ClassName(arg); obj.start(); obj.join()
    Is that correct for waiting for the created thread to finish ?

    1) The last started thread needs to return a string to the Thread started from main. How can I accomplish that, because I read that I cannot use
    synchronized methods outside different classes (and the threads belongs to different classes).Threads do not "belong" to classes. Class code executes in a particular thread. The class instances exist as long as something, somewhere, holds a strong reference to them.
    So when you start a new thread, hold a strong reference to the object being executed by that thread. When the thread is done, retrieve your data from that object.
    Even better, don't subclass Thread to create your objects. Instead, implement Callable, and use a ThreadPoolExecutor to execute it.

  • How to return xmlType from Webservice generated with JDev and PL/SQL

    Hi,
    I have generated an PL/SQL package that's returning a value as xmlType.
    With JDeveloper I'm deploying this package as a webservice. When invoking the webservice from a webbrowser the result looks like:
    <?xml version="1.0" encoding="UTF-8" ?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:testXmltypeResponse
    xmlns:ns1="http://app/webservice.wsdl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="xsd:string">
    <ROWSET>
    <ROW>
    <TODAY>12-OCT-07</TODAY>
    </ROW>
    </ROWSET>
    </return>
    </ns1:testXmltypeResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    The problem is that the <return> tag contains 'xsi:type="xsd:string"'. And now the webservice response is not valid XML because the return value contains XML and not a string.
    The solution would be, when invoking the webservice if the xsi:type would be missing from the result tag or would contains xsd:any. I tried editing the WSDL in JDeveloper and changing the type to xsd:any. After deploying and calling the WSDL from the webbrowser it contains this type. But when invoking the method from the webbrowser it still returns xsd:string as type.
    How can I get rid of this type in the <return> or change it.
    My JDeveloper version is 10.1.3.3.0 The Oracle database and 9iAS are 10.2.
    Thanks in advance,
    Thijs

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • How to return sdo_geometry from java procedure

    How can I return a SDO_GEOMETRY object from a java-stored-procedure to PL/SQL.
    I have a java class with methods that creates a specific polygon based on some user values. I want to return this polygon as a SDO_GEOMETRY object to a PL/SQL procedure.
    JDeveloper does not accept SDO_GEOMETRY as a return type.
    Can this be done?

    Justin,
    I have a PL/SQL package that contains several functions. One of them does selection and filtering of spatial features based on a user's location and preferences. For this purpose a web-application runs this function.
    I would like this function to do the following:
    1. the function is called, user parameters are passed in
    2. a call to a java-stored-procedure is made. This java procedure creates a polygon based on the user's location and preferences.
    3. the polygon is returned to the PL/SQL function
    4. the funtion uses the returned polygon to query spatial features that intersect, etc.
    I can do the call to the java-stored-procedure but where I get stuck is how to get the polygon from java to pl/sql. I can return a String or a number from java but how can I return the polygon (e.g., STRUCT, java object)?
    The current solution uses a work-around by storing the polygon in a temporary table. I would like to change this because once the function has run, the polygon is not needed anymore so I would like to do without having to store the polygon.
    Markus

  • How to returning rowid from a dynamic

    which gentleman can do me a favor, tell me how to get the rowid from a returning clause in a dynamic sql.
    i use one clause as:
    declare
    v_rowid char(18);
    begin
    sql :='insert into test values('a') returning rowid into :rowid';
    execute immediate sql using out v_rowid;
    dbms_output.put_line(v_rowid);
    end;
    however, this clause always promte on
    value error
    i do not know what mistake i made.

    declare
    v_rowid char(18);
    v_sql varchar2(200);
    begin
    v_sql :='insert into test_Tab values(''a'') returning rowid into :1';
    execute immediate v_sql using out v_rowid;
    dbms_output.put_line(v_rowid);
    end;
    Not everyone on this board is a gentleman, some of us are ladies.
    null

Maybe you are looking for

  • How to get a set of character within a string?

    Hi, I need to cut a set of character within a string. I have tried everthing but I need help. Example. Database Version 11.2.0.3 create table tst_string (message varchar2(600)); insert into tst_string values ('ANR0166I Inventory file expiration finis

  • PO amount isn't reflected in the liquidity forecast

    Dear Gurus, I have completed all the cash management configuration, but somehow the liquidity forecast only captures the balance of PO that has been converted to invoice through MIRO. I think CM retrieves the invoice balance through planning group wh

  • Error SOURCE IS the same as the target Task name Clear Cube Data

    Hi, When I am trying to use the Clear Package I am getting an error - "Source is the same as the Target" Any help with how to resolve this ? thx

  • Unable to get 10g application server control page

    Need Urget help hi Operating system windows 2003 with sp1 Application server 10g-- v 10.1.2.0.2 I have installed both 10g application server infrastructure and middle tire sucessfully on the machine with all the components sucessfully installed witho

  • Adobe Flash Games Will Not Load

    I have updated Firefox to latest version 26.0...also updated Adobe flash to  Version 12.0.7.148...also updated video drivers for Pc..also cleared cache...also updated windows xp to windows 7..also made sure all add on were enabled that are suppose to