Adding f:Attribute dynamically to a dynamically created Button

Hi ,
I am trying to dynamically create a CommandButton and attach a f:Attribute to the same. But somehow I am not able to get hold of the correct API to do the same -
>RichCommandButton button=new RichCommandButton();
>button.setText("Ok");
>AttributeTag attr=new AttributeTag();
>attr.setValue("DC_OPERATION_BINDING", "bindings.DENY");
>button.getChildren().add(attr);
The issue is that the add method expects a UIComponent and attr is of type com.sun.faces.taglib.jsf_core.AttributeTag

gues u can use it like
button.getAttributes().put(DC_OPERATION_BINDING", "bindings.DENY");
{code}
http://docs.oracle.com/cd/E17802_01/j2ee/j2ee/javaserverfaces/1.2/docs/api/javax/faces/component/UIComponent.html#getAttributes%28%29                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Dynamically adding more attributes to cube dimension in SSAS 2008 R2

    I need to dynamically add more attributes to cube dimension in SSAS 2008 R2 because the dimension table the cube is based on is updated using dynamic pivoting and there is need to update the cube dimension attributes as more columns are added to the dimension
    table without making the changes through BIDS. Is there a way to dynamically adding more attributes to cube dimension in SSAS 2008 R2?
    Thanks
    BI Developer

    Definitely. You can use AMO to add dimension attributes on the server. I have definitely done this a few times for different clients of mine. Here is a generic AMO sample:
    http://msftasprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_AMOAdventureWorks&referringTitle=Home
    Notice the parts which add attributes to a dimension.
    http://artisconsulting.com/Blogs/GregGalloway

  • Futureproof and dynamically created button

    I have been looking solution how to make buttons dynamically so that I can fetch dynamically values for buttons:
    - value,onclick,class,type,request
    This excellent page has very closely what I am looking: http://www.laureston.ca/2012/04/20/simple-workflow-implementation-in-apex/
    but I have challenges getting the escaped special characters to work especially for the apex.submit - part.
    Maybe that is just because 'copy-pasting' the plsql-region code from www-page didn't work out of the box
    Application Express 4.2.3.00.08
    Because dealing with the escape chars make the page easily break and there are now the new dynamic actions, I need to check what would be futureproof way of dynamically creating the buttons.
    If this is anyway the most practical way to proceed, then where I should look for further information about htp.p(....) button creation examples with rich escapes?
    Made small test page, where you can see one of my trials trying to get the escapes right.
    user test
    pass test
    http://apex.oracle.com/pls/apex/f?p=1403:2
    rgrds paavo
    --below the code for dynamic plsql region -- very likely the escape chars are not copypasted and shown correctly:
    DECLARE
    --PL/SQL Dynamic Region
    --thisworks too??
      v_showme varchar2(3000);
    BEGIN
      for c in (select sysdate||'asdasd;asdasas'  as button_label
                , 'PIMREQUEST'  as button_request
                , 'button-gray' as button_class
                , 'button'      as button_type
                , 'P38_XPIMPOM' as button_setme
                , 'JUUSTOA'     as button_setme_value
                from dual) loop
    htp.p('<button value='''||c.button_label||''' onclick=\"apex.submit('''||c.button_request||''');'' class='''||c.button_class||''' type='''||c.button_type||'''>
    <span>'||c.button_label||'</span>
    </button>');
      end loop;
    END;

    Hi Paavo,
    Your right about the button_id. It's value comes from an input parameter. The button won't show up in the "When button pressed"-list_of_values. This is not only because you write the id yourself, but more because the entire button is created on the fly. The button isn't stored internal in an apex table, that's why it won't show up in a list of values.
    If you want to trigger a dynamic action with the button, you can use a jQuery selector as triggering element. Here you can refer to the button_id using the '#' as jQuery marker for ID, e.g. '#myButton'.
    What the button that you render does, depends on what you put in the p_link parameter. A normal save button would submit the page with condition 'SAVE', you can do that by setting p_link to 'apex.submit("SAVE")'. If the button should do a page redirect, you set p_link to 'http://www.page2go.com', or whatever url you wish to redirect to.
    The text you put in the button attributes is added as HTML element definition, so if you set p_attrs to 'alt="alternate text"', that will be added to the html of your button.
    An example for a conditional button call could be:
          if p_order_id is null
          then
            create_button
              ( p_id        => 'newOrder'
              , p_link    => 'javascript:apex.submit("CREATE"');'
              , p_label     => 'New Order'
              , p_css       => 'customButton'
          else
            create_button
              ( p_id        => 'updateOrder'
              , p_link    => 'javascript:apex.submit("SAVE"');'
              , p_label     => 'Update Order'
              , p_css       => 'customButton'
          end if;     
    This would create a 'CREATE' button for a new order (p_order_id is null), or a 'SAVE' button for an existing order.
    Regarding your ps: if you mean can you conditionaly create a button using dynamic actions? Then the answer would be yes. Yes you can use the create_button procedure in a dynamic action, however by writing it as stored procedure in the database, or in a database package, you can easily reuse your code and still have only one version of your procedure that you need to maintain.
    Regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • How to create dynamic DataTable with dynamic header/column in JSF?

    Hello everyone,
    I am having problem of programmatically create multiple DataTables which have different number of column? In my JSF page, I should implement a navigation table and a data table. The navigation table displays the links of all tables in the database so that the data table will load the data when the user click any link in navigation table. I have gone through [BalusC's post|http://balusc.blogspot.com/2006/06/using-datatables.html#PopulateDynamicDatatable] and I found that the section "populate dynamic datatable" does show me some hints. In his code,
    // Iterate over columns.
            for (int i = 0; i < dynamicList.get(0).size(); i++) {
                // Create <h:column>.
                HtmlColumn column = new HtmlColumn();
                dynamicDataTable.getChildren().add(column);
                // Create <h:outputText value="dynamicHeaders"> for <f:facet name="header"> of column.
    HtmlOutputText header = new HtmlOutputText();
    header.setValue(dynamicHeaders[i]);
    column.setHeader(header);
    // Create <h:outputText value="#{dynamicItem[" + i + "]}"> for the body of column.
    HtmlOutputText output = new HtmlOutputText();
    output.setValueExpression("value",
    createValueExpression("#{dynamicItem[" + i + "]}", String.class));
    column.getChildren().add(output);
    public HtmlPanelGroup getDynamicDataTableGroup() {
    // This will be called once in the first RESTORE VIEW phase.
    if (dynamicDataTableGroup == null) {
    loadDynamicList(); // Preload dynamic list.
    populateDynamicDataTable(); // Populate editable datatable.
    return dynamicDataTableGroup;
    I suppose the Getter method is only called once when the JSF page is loaded for the first time. By calling this Getter, columns are dynamically added to the table. However in my particular case, the dynamic list is not known until the user choose to view a table. That means I can not call loadDynamicList() in the Getter method. Subsequently, I can not execute the for loop in method "populateDynamicDataTable()".
    So, how can I implement a real dynamic datatable with dynamic columns, or in other words, a dynamic table that can load data from different data tables (different number of columns) in the database at run-time?
    Many thanks for any help in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    flyeminent wrote:
    However in my particular case, the dynamic list is not known until the user choose to view a table. Then move the call from the getter to the bean's action method.

  • Dump in adding a ui element to group dynamically

    hi all,
    I have a group which has a dropdown ,my requirement is when i click a button
    a dropdown should be created dynamically below the dropdown created at design time.
    My code in  wddomodifyview()
      cl_wd_dropdown_by_idx=>new_dropdown_by_idx(
       EXPORTING
           bind_texts                 = 'CN_RULEBUILDER.CA_CONDITION'
             RECEIVING
            control    = lr_input ).
       lr_group  ?= view->get_element( 'GRP_BUILDER' ).
    lr_group->add_child( lr_input ).
    when i run this i get dump
    Adapter error in MATRIX_LAYOUT "_03" of view "ZMCPTS_RULES_SCREEN.V_MAIN": No LayoutData exists for child element "_10" of the UIElementContainer
    Can someone please help me with this

    This is because you need to set the Layout for the new element added as below:
    data LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.
    LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = lr_input ).
    Thanks,

  • How to change the attributes of screen fields dynamically

    <b></b>
    well i have created a table by name empmaster_data with following fields.
    *emp_id.
    *emp_fname.
    *emp_lname
    *dob.
    *doj.
    *dept.
    *desig.
    now using a single screen i want to create,change and display the information.even i am using save and exit button.
    now i want to change the attributes of screen fields dynamically like active,input,output,invisible.

    Hi,
    Have Different Radio Buttons for the purposes what you have and use AT Selection Screen Output, Under the event Use loop at screen and with continue with your requirement.
    Hope This Info Helps YOU.
    <i>Reward Points If It Helps YOU.</i>
    Regards,
    Raghav

  • Accessing Dynamically created Button

    Hi,
    Can someone give me an example how to access dynamically created button? 
    I know how to create a button dynamically but don't know how to access from AS3.
    Thanks!

    Hi,
    Please go through following links.
    1) http://www.daveoncode.com/2009/05/20/objectcollector-accessing-dynamic-generated-flex-obje cts-by-id/
    2) http://stackoverflow.com/questions/6740813/flex-assigning-events-to-dynamically-created-bu ttons
    3) http://www.justskins.com/forums/adding-click-event-to-35785.html
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • I need to create Buttons dynamically Please Help

    I am currently developing a card game. I represent my cards as buttons. But as the player draws more cards from the deck I have to generate buttons dynamically at run-time. I could use arrays of buttons and store new buttons inside that arrays of buttons. But the only problem is I need ActionListener for each of my buttons. How do you create ActionListener for each different dynamically created buttons? Please Help.

    Here is my code. I just do not understand how to create those functions dynamically that functions different each time.
    Here is my code please take a look.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class run108{
    JButton setbutton;
    JButton ButtonUp;
    JButton ButtonDeal;     
    JButton slot1;
    JButton slot2;
    JButton slot3;
    JButton slot4;
    JButton slot5;
    JButton slot6;
    JButton slot7;
    cards[] card = new cards[55];
    public static void main(String[] argv)
         run108 startgui = new run108();
         startgui.createframe();     
    void createframe()
         //Standard of way of creating Frame
         JFrame frame = new JFrame("108");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setLocation(300,200);// Tells the startup position;
         //Adding Panels to the framework
         JPanel panelA = new JPanel();
         panelA.setBackground(Color.white);
         panelA.setLayout(new BoxLayout(panelA,BoxLayout.Y_AXIS));
         JPanel panelB = new JPanel();
         JPanel panelC = new JPanel();
         //Adding buttons with card images
         JLabel label1 = new JLabel("       Set of Cards");
         panelA.add(label1);
         ImageIcon pic1 = new ImageIcon("cards/backd.png");
         setbutton = new JButton(pic1);          
        panelA.add(setbutton);
        ImageIcon picdeal = new ImageIcon("cards/deal.png");
         ButtonDeal = new JButton(picdeal);
         panelA.add(BorderLayout.CENTER, ButtonDeal);
        ButtonDeal.addActionListener(new DealListener());
         JLabel label2 = new JLabel("       Your Target");
         panelA.add(label2);
         ButtonUp = new JButton(pic1);          
        panelA.add(BorderLayout.CENTER, ButtonUp);
        frame.add(BorderLayout.WEST,panelA);
        // Adds 7 initial card slots.
         ImageIcon pic2 = new ImageIcon("cards/backc.png");
         slot1 = new JButton(pic2);
        panelB.add(slot1);          
        slot1.addActionListener(new Slot1Listener());
        slot2 = new JButton(pic2);
        panelB.add(slot2);
        slot2.addActionListener(new Slot2Listener());
         slot3 = new JButton(pic2);
        panelB.add(slot3);
        slot3.addActionListener(new Slot3Listener());
         slot4 = new JButton(pic2);
        panelB.add(slot4);
        slot4.addActionListener(new Slot4Listener());
         slot5 = new JButton(pic2);
        panelB.add(slot5);
        slot5.addActionListener(new Slot5Listener());
         slot6 = new JButton(pic2);
        panelB.add(slot6);
        slot6.addActionListener(new Slot6Listener());
         slot7 = new JButton(pic2);
        panelB.add(slot7);
        slot7.addActionListener(new Slot7Listener());
        frame.add(BorderLayout.CENTER,panelB);
        // This has to be added @ the end to show the components
        //that were added after on. If it is placed before the components
        //the components shall not appear since they sit on the frame
         frame.setSize(600,500);
         frame.setVisible(true);
    class DealListener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot1Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot2Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot3Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot4Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot5Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot6Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot7Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    }

  • Dynamic ALV and cl_abap_structdescr Create method

    Hi
    In the process of creation of Dynamic ALV, as I have char_name and char_descr fields, I have to use char_descr as column header of ALV because char_name which has entries something like DVS_******(that do not make any sense to user). I am facing 2 problems here using the scenario above.
    1. char_descr contains characters like '[', ']', ' /', '.', space which are invalid characters for method cl_abap_structdescr=>create(). How to handle scenario like this?
    2. assign (lv_value) to <value>.
            if sy-subrc = 0.
              <value> = ls_bapi_char_value-charvalue.
              if <value> is assigned.
                move ls_bapi_char_value-charvalue to <value>.
    where-> concatenate '<table_dyn_wa>-' ls_bapi_char-char_descr into lv_value
                   <value> type any
                  <table_dyn_wa>- is dynamic table with structure created with cl_abap_tabledescr=>create( p_line_type = stru_type )
    with above code for few fields data is being assigned and for few sy-subrc = 4. The table from where I am reading the field contains char_name associated with it and not char_descr. For the fields whose char_name and char_descr matches exactly, ALV displays data for it.
    How to resolve the issue so that I could get all the data?
    Let me know if further details are needed.
    Thanks, in advance
    Trupti
    Edited by: TRUPTI KALLURWAR on Jul 9, 2010 7:08 PM

    Hello Srikanth,
    CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE( ) uses the GENERATE SUBROUTINE POOL technique to create the dynamic internal tables.
    And as per the SAP documentation,
    In an internal mode, a maximum of 36 temporary subroutine pools may be created.
    Source: [http://help.sap.com/abapdocu_702/en/abapgenerate_subroutine_pool.htm]
    Btw why are you crating 36 dynamic internal table? That's way too far-fetched even for the RTTC classes
    BR,
    Suhas

  • Adding rows in web dynpro ABAP Dynamic Interactive form.

    Hi Experts,
              I am having problem in web dynpro ABAP Dynamic Interactive form.
    This is my scenario....
    I have a dynamic interactive form that has buttons to add and remove rows in a table. It works fine when I preview it , but when I render, view or save it using ADS, it no longer works. The "add" button actually does instantiate more repeating rows, because I put some trace messages in to count them, but the added rows are not displayed. How do I make them visible?
    In web dynpro java we write some coding in modify view to set the pdf form as dynamic
    IWDInteractiveForm iForm =
    (IWDInteractiveForm)view.getElement("<ID>");
    iForm.setDynamicPDF(true);
    simillarly what we need to write in web dynpro ABAP.
    Please give me solution for the same.
    Thanks,
    Sathish

    hi all,
             expecting reply from u all. pls help me and give some sugesstion.
    regards,
    vinoth.

  • Dynamically Binding to Dynamically Create View

    I tried to copy the code of “Dynamically Binding to Dynamically Create View object” but something is wrong because when I am debbuging it doesn’t work after the sentence vo.executeQuery();
    I suspect that the reason could be how I created the view..
    Your code is running well but not mine.
    It shows this error
    •     JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
    •     null
    I don’t know why because the code is the same.
    How did you create the objet view ?
    Could you help me?

    I'd recommend checking out this article on Debugging ADF Applications:
    http://www.oracle.com/technology/products/jdev/tips/muench/debugger/index.html
    and then reporting here the full stack trace using the tips described in that article.

  • PP to AE Dynamic link doesn't create video layer in AE

    PP to AE Dynamic link doesn't create video layer in AE. CC2014 updated.
    I'm DynLink sending a MotionJpeg clip from PP to AE. On my MacPro, Right clicking clip in PPro> replace with AE Comp. AE opens showing the comp but no video layer in the comp, (the comp is completely blank), and in PPro shows a comp in the Project Panel and a blank video chip in the timeline. This used to be a simple proceedure, is there a setting to enable in Project Settings I don't know about. New to CC, used to do this all the time in CS6.

    It looks like you've got collapse transformations turned on and that the Footage layer is a composition. I'd guess that the Maria Isabel.avi in the Maria Isabel.avi composition is 2D. With Collapse transformations turned on what you are seeing is normal behavior.
    What you want to do is to simply right click on the Maria avi in the Premiere timeline and select Replace with After Effects Composition. Once inside AE don't pre-compose the avi layer, just make it 3D.
    The other option would be to open up the Maria Isabel.avi composition and do your 3D transformations there.
    Yet another option wold be to turn off Collapse transformations.
    I'm not sure why the Maria Isabel.avi footage was Pre-comped. I can't see anytning in the screenshot that gives me a reason.

  • Create button choices and dynamically assign actions to them.

    Hi,
    I'm currently working on SAP Commercial Project Management which use Floor Plan Manager.
    Here, I've to create button choices and assign some actions to the button choice values dynamically.
    Please let me know, what's the process to do that .
    Regards,
    Arnab

    chk this
    Passing default value to bind variable on page load.
    http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html

  • Creating buttons dynamically in module pool screen

    Hi friends,
    I have one screen .
    It has two input fields .
    Say : Sales order no & Bin no .
    based on this i found some batches from database table using select query .
    Now the number of buttons depends on the no of batches i found .
    If I get 5 batches , then I will create 5 Push Buttons on screen .
    Please let me know , How to create these buttons dynamically on screen .
    Regards ,
    Manoj

    Hey ,
    I tried using custom container and then a toolbar in it .
    But this toolbar create buttons either vertically OR horizonatally .
    I want buttons all over the screen to be created dynmically .
    Please help ...

  • Dynamically create button

    Good evening,
    Can you help me,
    How can i dynamically create button?
    Can you give me example code, and how i can make event for this button.
    Regards.
    Points garantied.

    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/11/ba74412cba127de10000000a155106/frameset.htm">Sap Library</a>

  • For loop and xml - how to point the right content in a XML file with a dynamically created button?

    Hi Everybody,
    as my first experience in AS3 I'm bulding a photo multigallery. In that gallery I have some buttons, each one pointing to its respective set of images.
    Each button is created with the for loop, that picks the information from a XML file. From this XML I get the text of the button, the position etc. What I did with some sucess. But there is a scary problem: I don't know how to make each button load the respective and unique set of images.
    I've tryied several different methods, with no effect, to make each loop to give to each button an unique identity to load the respective set of images.
    I imagine that the solution pass by the use of arrays. I wrote some code, and I guess that I'm almost there (but not sure). Here is my AS3 code until now:
    // CREATE MENU CONTAINER //
    var menuContainer:MovieClip = new MovieClip();
    menuContainer.x=10;
    menuContainer.y=300;
    addChild(menuContainer);
    // CREATE IMAGES CONTAINER //
    var imagesContainer:MovieClip = new MovieClip();
    imagesContainer.x=10;
    imagesContainer.y=10;
    addChild(imagesContainer);
    //// LOAD XML ////
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
    xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
    var xml:XML;
    function whenLoaded(evt:Event):void {
         xml=new XML(evt.target.data);
         var mySetsList:XMLList=xml.children();
         //// MENU BUTTONS ////
         // CREATE ARRAYS //
         var totalArray:Array = new Array();
         var setNodesArray:Array = new Array();
         var setNamesArray:Array = new Array();
         // POSITIONING BUTTONS INSIDE MENU CONTAINER//
         var rowsQuantity:Number=3;
         var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
         var cellWidth:Number=160;
         // CREATE BUTTONS //
         for (var i:int=0; i< mySetsList.length(); i++) {
              var newSetButtonMC:setButtonMC=new setButtonMC();
              //what do I do here to make it works? To give each button created a unique id.
              setNodesArray.push(i);
              //trace(setNodesArray);
              var imageNodesArray:Array = new Array();
              for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
                   imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
              totalArray.push(imageNodesArray);
              newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
              newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
              var cellX:Number=Math.floor(i/rowsQuantity);
              var cellY:Number=i%rowsQuantity;
              newSetButtonMC.x=cellX*cellWidth;
              newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
              newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
              menuContainer.addChild(newSetButtonMC);
         totalArray.push(setNodesArray);
         //// MENU BUTTONS ACTIONS ////
         function onClick(mevt:MouseEvent):void {
              trace(totalArray [0][0]);
              trace(totalArray [0][0]);
              // in the line above I achieved some success loading a specific info from XML.
              // but I don't know what to do with it.
              //what do I do here? To make each button to load its own node from XML.
    Here is my XML:
    <GALERIA galeriaTitle="galeria 01">
      <IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
    </GALERIA>
    <GALERIA galeriaTitle="galeria 02">
      <IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
    </GALERIA>
    Thanks everyone . ABSTRATO

    you can assign each newSetButtonMC and ivar property that points to its i value or, even easier:
    // CREATE MENU CONTAINER //
    var menuContainer:MovieClip = new MovieClip();
    menuContainer.x=10;
    menuContainer.y=300;
    addChild(menuContainer);
    // CREATE IMAGES CONTAINER //
    var imagesContainer:MovieClip = new MovieClip();
    imagesContainer.x=10;
    imagesContainer.y=10;
    addChild(imagesContainer);
    //// LOAD XML ////
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
    xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
    var xml:XML;
    function whenLoaded(evt:Event):void {
         xml=new XML(evt.target.data);
         var mySetsList:XMLList=xml.children();
         //// MENU BUTTONS ////
         // CREATE ARRAYS //
         var totalArray:Array = new Array();
         var setNodesArray:Array = new Array();
         var setNamesArray:Array = new Array();
         // POSITIONING BUTTONS INSIDE MENU CONTAINER//
         var rowsQuantity:Number=3;
         var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
         var cellWidth:Number=160;
         // CREATE BUTTONS //
         for (var i:int=0; i< mySetsList.length(); i++) {
              var newSetButtonMC:setButtonMC=new setButtonMC();
              //what do I do here to make it works? To give each button created a unique id.
              setNodesArray.push(i);
              //trace(setNodesArray);
              var imageNodesArray:Array = new Array();
              for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
                   imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
             nextSetButtonMC.imageArray = imageNodesArray;
              //totalArray.push(imageNodesArray);
              newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
              newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
              var cellX:Number=Math.floor(i/rowsQuantity);
              var cellY:Number=i%rowsQuantity;
              newSetButtonMC.x=cellX*cellWidth;
              newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
              newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
              menuContainer.addChild(newSetButtonMC);
         totalArray.push(setNodesArray);
         //// MENU BUTTONS ACTIONS ////
         function onClick(mevt:MouseEvent):void {
              var mc:setButtonMC=setButtonMC(mevt.currentTarget);
    for(i=0;i<mc.imageArray.length;i++){
    trace(mc.imageArray[i]);
    Here is my XML:
    <GALERIA galeriaTitle="galeria 01">
      <IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
    </GALERIA>
    <GALERIA galeriaTitle="galeria 02">
      <IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
    </GALERIA>
    Thanks everyone . ABSTRATO

Maybe you are looking for

  • Embed fonts in a Photoshop document?

    A friend has sent me a photoshop document to work on but i dont have all the fonts he does. Its a pain trying to find and download them all. Is there a way of embedding fonts in a document so he could send me the file and I could edit the text? I gue

  • Database Version for 9iAS ???

    We are evaluating wich version of the DB use with 9iAS, Standard or Enterprise. We do mostly need reads of the database, but have at least two applications that need replication with other DB's - that could be a point for Enterprise version. What are

  • Ask Q about u400 and u510.

    hi my friends i want to know u400 is a good laptob???  usb3 and optical drive is important for me how about u510 ?? can i buy it from dubai???? it came in september 2012 plz help me   shall i wait for u510 or buy u400??

  • WLS 6.1 SP4 available ?

    I heard that there is now SP4 for WLS 6.1. Is this true and if so, when and where is it ?

  • Meric -- Another package helper (packer fork)

    Hi. Here is Meric. I have made modifications to famous and well written "packer" (thanks to Matthew Bruenig) to fit my needs. So a packer fork "Meric" has born. I decided to share it with community. But remember, i am neither a coder nor a bash exper