How populate itemrenderer items with data.

How populate itemrenderer items with data. Ie after my app starts I generate an array collection that I want to assign as the data provider to each combobox in my item renderer, which im using in a datagrid.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955"
               minHeight="600">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
        <s:ArrayCollection id="booksWithStores">
            <fx:Object name="book1" stores="{new ArrayCollection(['store1','store2'])}"/>
            <fx:Object name="book2" stores="{new ArrayCollection(['store1','store3'])}"/>
            <fx:Object name="book3" stores="{new ArrayCollection(['store2','store3', 'store4'])}"/>
            <fx:Object name="book4" stores="{new ArrayCollection(['store1','store4'])}"/>
        </s:ArrayCollection>
        <s:ArrayCollection id="booksWithoutStores">
            <fx:Object name="bookA"/>
            <fx:Object name="bookB"/>
            <fx:Object name="bookC"/>
            <fx:Object name="bookD"/>
        </s:ArrayCollection>
        <s:ArrayCollection id="allStores">
            <fx:String>store1B</fx:String>
            <fx:String>store2B</fx:String>
            <fx:String>store3B</fx:String>
            <fx:String>store4B</fx:String>
        </s:ArrayCollection>
        <fx:Component id="renderer1" className="Renderer1">
            <s:MXDataGridItemRenderer>
                <s:DropDownList dataProvider="{data.stores}" />   
            </s:MXDataGridItemRenderer>
        </fx:Component>
        <fx:Component id="renderer2" className="Renderer2">
            <s:MXDataGridItemRenderer>
                <s:DropDownList dataProvider="{storesList}" />
                <fx:Script>
                    <![CDATA[
                        import mx.collections.ArrayCollection;
                        [Bindable]
                        public var storesList:ArrayCollection;
                    ]]>
                </fx:Script>
            </s:MXDataGridItemRenderer>
        </fx:Component>
    </fx:Declarations>
    <mx:Form>
        <mx:FormItem label="Dynamic Stores">
            <mx:DataGrid dataProvider="{booksWithStores}" width="354">
                <mx:columns>
                    <mx:DataGridColumn dataField="name"/>
                    <mx:DataGridColumn dataField="stores" itemRenderer="{renderer1}"/>
                </mx:columns>
            </mx:DataGrid>
        </mx:FormItem>
        <mx:FormItem label="Static Stores">
            <mx:DataGrid dataProvider="{booksWithoutStores}" width="354">
                <mx:columns>
                    <mx:DataGridColumn dataField="name"/>
                    <mx:DataGridColumn dataField="stores" itemRenderer="{createRendererWithProperties(Renderer2, {storesList:allStores})}"/>
                </mx:columns>
            </mx:DataGrid>
        </mx:FormItem>
    </mx:Form>
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            public static function createRendererWithProperties(renderer:Class, properties:Object):IFactory
                var factory:ClassFactory=new ClassFactory(renderer);
                factory.properties=properties;
                return factory;
        ]]>
    </fx:Script>
</s:Application>

Similar Messages

  • How to create an item with date type mm/yyyy (no day)

    Hello,
    Is it possible to create an item with date type mm/yyyy (no day)? I want the pop-up date picker to just show month and year.
    Thanks,
    Jen

    Hi,
    you cannot pop-up date picker to just show month and year, but you can set your item format as MM-YYYY
    You can check this APEX_ITEM.DATE_POPUP2 at : http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_item.htm#CHDJHBCG (if using apex 4.1) else http://docs.oracle.com/cd/E10513_01/doc/apirefs.310/e12855/apex_item.htm#CHDFDDEI
    Edited by: Sergio_doudou on 2012-04-13 14:26

  • Pre populate an item with source type="Database Column"

    Hello gurus,
    How can I pre populate an item with source used "Always, replacing any..." and source type="Database Column"?
    I have a form that creates/updates rows in a table and when creating a new row I want to populate some of the fields based on some parameters from the previous page. How can I achieve this?
    I tried adding a conditional process when PK is null and populate the expected fields, but in the browser they are not shown with those values, even if I look into the session I can see that they have the values assigned in the process ?!?!?!
    Thanks in advance,
    Florin

    Florin,
    Use the Default Value item attribute. In you case, set the Default Value Type to Static Text with Session State Substitutions and enter your item using the &P1_ITEM_NAME. syntax in the Default value text box.
    Thanks,
    - Scott -

  • Table - populate one table with data from the list of another table

    Hello All,
    I am a newbie in Swing and am a book and few tutorials old.
    I am trying to achieve the following:
    (1) I populate Table1 (a JTable) with a list of data - each row consists of several columns. And I have a Table2 (also JTable) that is in the beginning empty.
    Both the tables (Table1 and Table2) are showed in the window.
    (2) Lets say, there's a button (JButton) in between the two tables.
    Now if I Select a row from Table1 and press the button, this row will be sent/copied to Table2.
    And this way I can choose different rows and pass the data to Table2.
    I have manages to make Table1 and put data in it ... but for the rest, I don't know where and how to begin.
    Would appreciate some ideas and tips.
    Thank you.

    Since you are using a button to start the copy process you don't need to worry about a ListSelectionListener or a MouseListener. You need to create a button with an ActionListener that does the following:
    a) Create an Array based on the size of the number of columns in the table
    b) get the index of the selected row
    c) populate the Array with data from the TableModel by using the table.getModel().getValueAt(...) method for each
    d) Now you can add the row of data to the other JTable by updating its model.
    DefaultTableModel model2 = (DefaultTableModel)table2.getMode();
    model.addRow( theArray );

  • How to use Count with Date Parameters

    Hello,
    I am having issues using the Count() function in conjunction with date parameters.
    This is a Siebel report and in my report I have 2 date parameters(From Date, To Date). In a nutshell I am basically trying to count Opportunities that has a start date within the given date period. However I don't see a reasonable way to put my date parameters within the Count() function. The reason being is that I need to have a huge chunk of code to convert the dates into a common format that can be compared, and it won't even fit within the code block in my rtf template. I am not even sure how to put multiple conditional statements inside a Count() function since all the examples I have seen are very simple.
    Anyone have a suggestion on how to use Count() with date parameters?
    Thanks.

    Any chance you can get the date formats in the correct format from siebel?
    I don't know Siebel - so I can't help you with that. If you get the correct format it is just
    <?count(row[(FromDate>=date) and  (date<=ToDate))?>
    Otherwise the approach would probably need to use string function to get year/monthd/day from the date
    and store it into a varialbe and compare later the same way
    <?variable@incontext:from; ....?>
    <?variable@incontext:to; ...?>
    <?count(row[($from>=date) and  (date<=$to))?>
    Potentially you can use the date functions such as xdofx:to_date to do the conversion
    [http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481158.htm]
    But I am not sure if they are available in your siebel implementation.
    Hope that helps

  • Trying to populate a table with data from WebRowset

    Hi,
    I want to be able to populate my tables with data from WebRowsets that have been saved to files. Everything goes good until I get to acceptChanges(). At which point I get a NullPointerException.
    Here's the code...
    WebRowSet wrs = new WebRowSetImpl();
    FileReader reader = new FileReader(inputFile);
    wrs.readXml(reader);
    wrs.beforeFirst();
    CachedRowSet crs = new CachedRowSetImpl();
    crs.setSyncProvider("com.sun.rowset.providers.RIXMLProvider");
    crs.populate(wrs);
    crs.beforeFirst();
    crs.acceptChanges(con);
    Results in...
    java.lang.NullPointerException
    at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:867)
    at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:919)
    I'm using Java 1.5_02. I looked at the source code for CachedRowSetImpl, and the only thing I could think of is that maybe "provider.getRowSetWriter()" in the following snippet is returning null....
    public void setSyncProvider(String s)
    throws SQLException
    provider = SyncFactory.getInstance(s);
    rowSetReader = provider.getRowSetReader();
    rowSetWriter = (TransactionalWriter)provider.getRowSetWriter();
    Any ideas?? Thanks!

    I have the same problem after setting com.sun.rowset.providers.RIXMLProvider.
    Looks like a bug to me.
    By the way, why are you creating a new CachedRowSet and populate it with a WebRowset (which extends CachedRowSet)?

  • Populate SQL table with data from Oracle DB in ODI

    Hi,
    I am trying to populate a source SQL table with fields from an Oracle db in ODI. I am trying to perform this using a procedure and I am am getting the following error:
    ODI-1226: Step PROC_1_Contract_Sls_Person_Lookup fails after 1 attempt(s).
    ODI-1232: Procedure PROC_1_Contract_Sls_Person_Lookup execution fails.
    ODI-1228: Task PROC_1_Contract_Sls_Person_Lookup (Procedure) fails on the target MICROSOFT_SQL_SERVER connection Phys_HypCMSDatamart.
    Caused By: weblogic.jdbc.sqlserverbase.ddc: [FMWGEN][SQLServer JDBC Driver][SQLServer]Invalid object name 'C2C_APP.CON_V'.
    My question is what is the best method to populate SQL db with data from an Oracle db? Using a procedure? A specific LKM?
    I found threads referring to using an LKM to populate Oracle tables with data from a SQL table....but nothing for the opposite.
    Any information would help.
    thanks,
    Eric

    Hi Eric,
    If using an Interface, I would recommend the LKM SQL to MSSQL (BULK) knowledge module. This will unload the data from Oracle into a file, then bulk load the staging db on the target using a BULK INSERT.
    Regards,
    Michael Rainey

  • How to populate text fields with data present in a table

    Hi,
    The page i'm building has got a select list for the primary key column and text fields corresponding to rest of the columns in the table.
    upon selecting some value from the list, the data corresponding to that row should get populated in the respective items. I don't want to add source in each item. can't i create a process or something else where this is done for each item.
    for eg there's a table with columns A(primary key) and B.
    there is a text fields on this page.
    this textfield should populate the data from the table whenever i submit the page such that teh value in B is select B from tablename where A = the selected value.
    Thanks
    Dhirendra

    So I assume page was not built using a wizard. Why on earth you would want to I dont know, but you could create an "After Header" pl/sql process to populate the relevant fields, assuming the id was know on entry to the page. If you want to select the id on the page and then populate the fields, guess you will need to use a "Text Field (always submits page when Enter pressed)" and then use an "On Submit" process to populate the items.
    If you are using an Automated Row Fetch, remember to select "Set memory Cache on Fetch" in that process.
    Hope this helps.

  • Page Item with Date format DD-MON-RR - APEX 32

    Hello,
    I am passing date parameter but somehow it is not formatting date properly on calendars.
    For e.g.
    Below is my calendar query
    select distinct count(*) knt, initcap(username) username, to_date(to_char(trunc(timestamp),'DD-MON-RR'),'DD-MON-RR') ts from xrx_master_records
    group by initcap(username), trunc(timestamp)In above query TS is the date column that results in DD-MON-RR format.
    Then I format column on calendar tab as shown below, here is how I am constructing the link.
    <!-- <a href="f?p=&APP_ID.:40:&APP_SESSION.::NO::P40_CAL:#USERNAME#:P40_DAILY_DATE:#TS#"
    style="color:NavyBlue;
    font-weight:bold">#USERNAME#(#KNT#) </a> -->But the issue is - #TS# field shows complete date with time stamp for page item P40_DAILY_DATE. i.e. instead of 21-JUL-10, it shows 21-JUL-2010 12:00:00 AM. That means, it is ignoring calendar query and reads straight from database.
    How can I make sure that P40_DAILY_DATE item receives date in DD-MON-RR format?
    Then, I plan to use P40_DAILY_DATE to connect with the report region by comparing timestamp column from same table with P40_DAILY_DATE.
    Please advice.
    Thanks,
    R

    Sorry but, I am expecting a more productive feedback than this.
    Let me state the obvious that, this forum is the community of SME who are volunteers. It is the precious help they provide with their insight to questions other members have. Due to the simple fact that it is purely a matter of choice whether to reply questions or not, it is perfectly justified that some of questions remain unanswered. I hope you understand this.
    And anyway, what makes you think that those question that remain unanswered on this forum, remain open forever?

  • Populate livecycle form with data in iOS / android

    Hi,
    I need to populate the livecycle form with data in offline mode in iOS or android. How do I achieve that? Any help is greatly appreciated.

    Thats good news.
    Is there a way currently to populate the livecycle static pdf with data in offline mode in iOS/ Andriod? For eg. if the data is in a xml file, is there a way to populate it into pdf in offline mode? If not, is it possible to achieve this in native code? Kindly help.

  • How to manage items withing categories?

    I want to be able to list and sort (in admin panel) all items in a web app or other area tagged with a specific category.  However, the Category listing option is alphabetical, and what if I have more than one category that starts with A?  for example:  "Apples" "Apricots".  If you have hundreds of items with different categories, it seems that you would need a way to sort them....
    And once I can get a list of category "Apples" items, how to filter based on the data in the fields?  Say customer entered "NO" to wanting a fruit item.  I would like to be able to sort of filter all "Apple" category items, that fruit field has "NO" value.
    And after I get that sorted view, how would I manage categories on these multiple items at once?  Say add another category "Veggies" and remove "Apples" from several items at once.  (can't do this manually if you have hundreds of items!
    Please help!!!

    Suppose i ve Form having Deptno Field and Ename field and both are List Item.... and I want in ename field list select those employee who are in selected Deptno on above list.
    WHEN-New-Form Instance.
    DECLARE
    CURSOR C1 IS
    SELECT Deptno FROM Dept;
    BEGIN
    FOR A IN C1 LOOP
    ADD_LIST_ELEMENT('block.deptno',1,A.deptno,A.deptno);
    END LOOP;
    END;
    DECLARE
    CURSOR C2 IS
    SELECT ename FROM emp where deptno=:block.deptno;
    BEGIN
    FOR B IN C2 LOOP
    ADD_LIST_ELEMENT('block.ename',1,B.ename,B.ename);
    END LOOP;
    END;
    Successfully Run
    Regards
    Danish Hayder

  • Populate list Item with a recordgroup?

    Hi Friend
    I want to populate a list Item with a "Recordgroup". Does it possible without using the add_eliment function?
    I did it through the Loop to read the item from record group. If the database changes the record does not change in my list item. because the list containing the added items which was delivered in the load time. But like Pressing F9, we can easily see the last changed data of the database.
    If possible please send me the detail code to me. Here I delivered the detail procedure which i did for that purpose.
    Farhad
    ==========================================================
    PROCEDURE Populate_Item_In_List (     List_name VARCHAR2,
                                                                                         QUERY_Text VARCHAR2,
                                                                                         rg_Level_Col_name VARCHAR2,
                                                                                         rg_Value_Col_name VARCHAR2) IS
         HERE THE PROCEDURE POPULATE THE LIST WITH THE REQUIRED DATA UNDER A CORRCET SQL (SELECT) COMMAND
         List_name                     THE LIST ITEM WHICH HAS TO BE LOADED BY THIS PROCEDURE
         QUERY_Text                     THIS CONTAINS THE QUERY TEXT BY WHICH THE LIST ITEM WILL LOAD
         rg_Level_Col_name THIS IS THE LEVEL OF THE REQUIRED ITEM THAT OBVIUSLY A CHAR DATA TO BE RETRIVE
         rg_Value_Col_name THIS IS THE VALUE OF THE REQUIRED ITEM THAT OBVIUSLY A NUMBER DATA TO BE RETRIVE
                   R_Group          RecordGroup;
                   Rowcount      NUMBER;
                   rg_name      VARCHAR2(40) := 'DefaultRG';
                   rg_id      RecordGroup;
                   errcode      NUMBER;
                   Lid                    Item;
    BEGIN
         --+++++++++++++++++++++THIS IS USED TO POPULATE THE RECORD GROUP+++++++++++++++++++++++++++++++++
                   rg_id := Find_Group(rg_name);                                             Find the record group                                                   +
                                                      --+
                   IF Id_Null(rg_id) THEN                                                                                                                                                                          --+
                             rg_id := Create_Group_From_Query(rg_name,Query_Text);                                                                                     --+
                             errcode := Populate_Group(rg_id);                                                                                                                                       --+
                   else                                                                                                                                                                                                                       --+
                             errcode := Populate_Group_With_Query(rg_id,Query_Text);                                                                            --+
                   END IF;                                                                                                                                                                                                                  --+
         --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     
              If errcode = 1403 then
                   Message('There is no data to be retrive......');
              else
         --+++++++++++++++++++++THIS IS USED FOR LOADING DATA TO THE LIST ITEM++++++++++++++++++++++++++++
                   Rowcount      :=      Get_Group_Row_Count(rg_id);                              Counting the total rows in RGroup          +
                   Lid                    :=     Find_Item(List_name);                                                                                                                                            --+
                   Clear_list(Lid);                                                                                          Clear the list which is loaded now     +
                   FOR J IN 1..Rowcount LOOP                                                                                                                                                                     --+
         Add_List_Element(List_name,                                                            the name of the list item                              +
                                                      J,                                                                                index of the list                                                  +
                                                      Get_Group_Char_Cell('DefaultRG.'||rg_Level_Col_name,j),     Level of item+
                                                      Get_Group_Number_Cell('DefaultRG.'||rg_Value_Col_name,j) value of item+
                                                      );                                                                                                                                                                               --+
                   END LOOP;                                                                                                                                                                                                             --+
         --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
              end if;
    END;
    ===============================================================

    Hi Farhad,
    You can make use of Populate_List built-in.
    Populate_List(list_id, 'RECGRP');
    You can find more information in online documentation of forms.
    Cheers
    Zakiy

  • I have an external address file. I want to type in a last name and have it populate my pdf with data

    I have an external contact address file. I want to create a dynamic pdf form and type in the last name and have it populate the form with first name, address, phone etc. I have Acrobat 9 Pro
    thanks

    The external file will be updated weekly. The data can be put in any format that will work. What format is best? The form is an Acrobat form. Minnesota state forms downloaded from their website and we use the Acrobat 9 forms wizard to render them fill-able. What is LiveCycle Designer? There isn't much more I can add. Is it possible or not? The Adobe Indian tech guy said I needed java scripts.

  • How to remove timestemp with Date Column in BI Answers

    Hi All,
    i want to know how can I remove timestamp with date col from repository with "caste" command???
    Regards
    Message was edited by:
    53637

    hi,
    ur e-mail id is not working so i paste the query explain plan here:
    -------------------- SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report';SELECT POS.POS_DATE saw_0, POS.POS_ASSET_DESC saw_1, POS.POS_MARKET_VAL_LCY saw_2, POS.POS_INT_ACCR_LCY saw_3 FROM WH1 WHERE POS.POS_DATE = date '2007-01-31' ORDER BY saw_0, saw_1, saw_2, saw_3
    +++Administrator:2a0000:2a0002:----2008/01/16 03:14:25
    -------------------- General Query Info:
    Repository: Star, Subject Area: WH1, Presentation: WH1
    +++Administrator:2a0000:2a0002:----2008/01/16 03:14:25
    -------------------- Logical Request (before navigation):
    RqList  distinct
        POS.POS_DATE as c1 GB,
        POS.POS_ASSET_DESC as c2 GB,
        POS.POS_MARKET_VAL_LCY as c3 GB,
        POS.POS_INT_ACCR_LCY as c4 GB
    DetailFilter: POS.POS_DATE = DATE '2007-01-31'
    OrderBy: c1 asc, c2 asc, c3 asc, c4 asc
    +++Administrator:2a0000:2a0002:----2008/01/16 03:14:25
    -------------------- Execution plan:
    Child Nodes (RqCache):
    RqList <<6636>> [for database 3023:2470:wh1,46] distinct
        cast(POS.POS_DATE as  DATE )  as c1 GB [for database 3023:2470,46],
        POS.POS_ASSET_DESC as c2 GB [for database 3023:2470,46],
        POS.POS_MARKET_VAL_LCY as c3 GB [for database 3023:2470,46],
        POS.POS_INT_ACCR_LCY as c4 GB [for database 3023:2470,46]
    Child Nodes (RqJoinSpec): <<6672>> [for database 3023:2470:wh1,46]
        POS T44641
    DetailFilter: cast(POS.POS_DATE as  DATE )  = DATE '2007-01-31' [for database 0:0]
    OrderBy: c1 asc, c2 asc, c3 asc, c4 asc [for database 3023:2470,46]
    +++Administrator:2a0000:2a0002:----2008/01/16 03:14:25
    -------------------- Sending query to database named wh1 (id: <<6636>>):
    select distinct  TRUNC(T44641.POS_DATE) as c1,
         T44641.POS_ASSET_DESC as c2,
         T44641.POS_MARKET_VAL_LCY as c3,
         T44641.POS_INT_ACCR_LCY as c4
    from
         POS T44641
    where  (  TRUNC(T44641.POS_DATE) = TO_DATE('2007-01-31' , 'YYYY-MM-DD') )
    order by c1, c2, c3, c4
    +++Administrator:2a0000:2a0002:----2008/01/16 03:17:21
    -------------------- Query Result Cache: [59124] The query for user 'Administrator' was inserted into the query result cache. The filename is 'C:\OracleBIData\cache\NQS_LENOVO_733059_11665_00000002.TBL'.

  • How to import xml with data?

    Excel 2013
    i got an XML file generated by the GPinventory tool. when i import it into Excel, i only get the headers.
    how can i import the data as well?

    Hi,
    As far as I know, the GPinventory tool Supported Operating System :Windows 2000, Windows Server 2003, Windows XP, I suppose it generated XML file with Excel 2003 schema, but Excel 2013 have a new XML schema. This issue usually caused by the XML scheme.
    Please create a Excel 2013 schema XML file
    to test with Excel 2013, if the file could be import well. We'd better check the generated XML file.
    As a workaround, we'd better save the results as
    a tab-delimited text file and then import to Excel 2013.
    If this issue still exists, please upload the XML file through OneDrive. I want to test it.
    Regards,
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help. If you have any feedback on our support, please click "[email protected]"

Maybe you are looking for

  • How do I delete the Yahoo button on the navigation line?

    On the navigation line there is a little house, "Yahoo". How do I delete it forever? Since I upgraded Firefox, every time I turn on the computer it opens with a Yahoo Homepage. Yahoo is so very invasive, worse than a virus . I want Google as my home

  • Runtime error in adobe application

    Hi All, I am trying to run a simple adobe application, I am getting this error com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException: Failed to  UPDATEDATAINPDF      at com.sap.tc.webdynpro.clientserver.uielib.adob

  • {function:: function } doesn't display in region

    Hey guys, I have the following region at http://longmanhomeusa.com/blogfeed/blogfeed.php note the spry:content="{function::FormatDate}" It doesn't seem to work. I think I'm looking at it too long as I can't seem to find the error. So I'm asking for a

  • Where are PDF files "printed" by Acrobat 8.3.1 in Mountain Lion?

    I just got a new Mac Mini and transferred my old version of Acrobat Pro 8.3.1.  I know that it will have some problems in Mountain Lion, but I only want to do a few simple things.  When I try to print to PDF and select Adobe PDF 8.0 as the printer (t

  • Complex Type as prameter

    I am exposing session beans as web services. My question is how can I use a user defined object as a parameter in the client. The scenario is like this. I invoke a method on an EJB through Webservice A and and it returns me an object of type let's sa