Create a datatable component

I want to create a HtmlDataTable component in my java code.
I do this at the moment, but seems that nothing happens:
FacesContext context = FacesContext.getCurrentInstance();
        Application app = context.getApplication();
        HtmlDataTable table = (HtmlDataTable) app.createComponent(HtmlDataTable.COMPONENT_TYPE);
        UIColumn column = (UIColumn) app.createComponent(UIColumn.COMPONENT_TYPE);
        HtmlOutputLink link = (HtmlOutputLink) app.createComponent(HtmlOutputLink.COMPONENT_TYPE);
        HtmlOutputText text = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
        context.getViewRoot().getChildren().add(table);
        table.getChildren().add(column);
        column.getChildren().add(link);
        link.getChildren().add(text);
        table.setVar("item");
        table.setValueBinding("value", app.createValueBinding("#{menuBean.myList}"));
        link.setValue("#");
        text.setValueBinding("value", app.createValueBinding("#{item}"));What is wrong?

You create a new table as a child of UIViewRoot.
But UIViewRoot's rendersChildren property is false;
that means encodeChildren method is not invoked.
Encodeing of other components under <f:view> is done by the corresponding
Tag Handler; whereas your new table has no corresponding one.
I think you should create a new table under some component
whose rendersChildren property is true (e.g. PanelGrid).

Similar Messages

  • Displaying ResultSet in DataTable component

    Say my program codes have created a ResultSet object by applying some SQL query into the database tables.
    Now I just want to display the contents of that ResultSet object in the JSC DataTable component. Is it possible? If so, how?
    Thank you.

    Hi,
    I think i have found a way to do what we want to do :
    As written in Winston Prakash's Weblog (http://blogs.sun.com/roller/page/winston),
    1) I have created a java class "ResultRowDataProvider" that extends ListObjectDataProvider and that contains a method that fill a list from the resultset. (Later, this list will be automatically used to fill the Table Component)
    That is to say :
    public class ResultRowDataProvider extends ObjectListDataProvider{
    private List resultList = new ArrayList();
    /** Creates a new instance of ResultRowDataProvider */
    public ResultRowDataProvider() {
    setUserResizable(true);
    public void fillResultList(ResultSet rs){
    try{
    rs.beforeFirst();
    while(rs.next())
    resultList.add(new ResultRow(rs.getString(1), rs.getString(2)));
    } catch(SQLException sqle){}
    setList(resultList);
    public int getNbRows(){
    return this.resultList.size();
    2) I have created a java class "ResultRow" where I defined private attributes that the ResultRowDataProvider will provide.
    That is to say :
    public class ResultRow(){
    private String field1;
    private String field2;
    public ResultRow(String field1, String field2){
    this.field1 = field1;
    this.field2 = field2;
    public String getField1(){
    return this.field1;
    public String getField2(){
    return this.field2;
    public void setField1(String field1){
    this.field1 = field1;
    public void setField2(String field2){
    this.field2 = field2;
    3) I finally added the following line to the init( ) method in SessionBean1.java :
    resultRowDataProvider = new ResultRowDataProvider();
    Then it is compulsory to clean and build the project, to close the project and to reopen it so that the table component layout will take into account the ResultRowDataProvider.
    I chose it, but it didn't display the two fields I defined (field1 and field2)
    whereas Winston said it should display them. So I defined the table columns myself using as value : #{currentRow.getValue('field1')} for the field1 column.
    It worked at runtime.
    Now jetsons, I would like to tell you that I personnaly wanted to fill programmatically the Table Component because I am using an Oracle 9.2.0.1 database. In the first version of my project, i used the CachedRowSet. Then I read that i had to use OracleCachedRowSet using ocrs12.jar. But after many bugs at runtime, I had a look to forums and I read that :
    "JDBC drivers provided by Oracle are not suitable for Sun Java Studio Creator, and are not supported. Oracle drivers currently available do not fully implement the JDBC 3.0 Specification. Sun Java Studio Creator requires certain schema information at design time that Oracle drivers do not provide."
    In fact we can use DataDirect but ...
    Filling programmatically a Table Component is a database-independant way ;)
    Thank you for your help jetsons and MISS_DUKE.

  • 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.

  • How to Create a Table Component Dynamically based on the Need

    Hello all,
    I have a problem i need to create dynamically tables based on the no of records in the database. How can i create the table object using java code.
    Please help.

    Winston's blog will probably be helpful:
    How to create a table component dynamically:
    http://blogs.sun.com/roller/page/winston?entry=creating_dynamic_table
    Adding components to a dynamically created table
    http://blogs.sun.com/roller/page/winston?entry=dynamic_button_table
    Lark
    Creator Team

  • Creating a custom component in multisim using *.lib and *.olb files

    i have  *.lib and *.olb files for a pspice model. which file i have to you while creating a custom component in multisim.

    Hello,
    Thanks for your question. In order to create simulatable custom components in Multisim you need a SPICE model (Multisim can also understand PSpice Models). The file format for SPICE model can be different according to the manufacturer, for instance: *.cir, *.lib, *.llb. At the end of the day these files are text files that you can open with a text editor, therefore, you can simply copy and paste the model in Multisim.
    Here are two good resources on component creation:
    Component Creation 101
    Creating a Custom Component in NI Multisim
    When you reach the step where you need to enter the SPICE model, simply open the *.lib or *.olb file with a text editor, and copy and paste the model.
    Hope this helps.
    Fernando D.
    National Instruments

  • How to create a new component in CRM 7.0?

    while creating a new component with search and result options... main window is not created automatically.
    when tried to create it manually its giving short dump. kindly let me know what could be the reason for this problem?
    thanks alot.

    Hi Vijay,
    could you please specify what kind of short dump you are getting? The short dumps can be looked at in the sapgui transaction st22.
    Best regards,
    Erika

  • WDRuntimeException : Failed to create delegate for component

    Hi Friends,
    I encountered the following error while deploying the application to local DC. Actually, i'm trying to create a new view 'HCFileUploadView' in the existing application.
    An error has occurred:
    "Failed to process the request."
    Please contact your system administrator.
    Hide details
    Web Dynpro client:
    HTML Client
    Web Dynpro client capabilities:
    User agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322), version: null, DOM version: null, client type: msie6, client type profile: ie6, ActiveX: enabled, Cookies: enabled, Frames: enabled, Java applets: enabled, JavaScript: enabled, Tables: enabled, VB Script: enabled
    Web Dynpro runtime:
    Vendor: SAP, Build ID: 6.4011.00.0000.20050217164947.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:49:12[UTC], changelist=329752, host=PWDFM026)
    Web Dynpro code generators of DC local/CRRSRatingWDP:
    SapDictionaryGenerationCore: 6.4011.00.0000.20050127161623.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:34:47[UTC], changelist=324383, host=PWDFM026.wdf.sap.corp)
    SapMetamodelWebDynpro: 6.4011.00.0000.20050121170001.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:38:14[UTC], changelist=322883, host=PWDFM026.wdf.sap.corp)
    SapMetamodelCore: 6.4011.00.0000.20050121165648.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:28:49[UTC], changelist=322878, host=PWDFM026.wdf.sap.corp)
    SapWebDynproGenerationTemplates: 6.4011.00.0000.20050217164947.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:53:22[UTC], changelist=329752, host=PWDFM026)
    SapWebDynproGenerationCTemplates: 6.4011.00.0000.20050217164947.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:53:22[UTC], changelist=329752, host=PWDFM026)
    SapGenerationFrameworkCore: 6.4011.00.0000.20041104141254.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:28:00[UTC], changelist=298452, host=PWDFM026.wdf.sap.corp)
    SapIdeWebDynproCheckLayer: 6.4011.00.0000.20050215134310.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:42:02[UTC], changelist=329103, host=PWDFM026.wdf.sap.corp)
    SapMetamodelDictionary: 6.4011.00.0000.20040609163924.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:32:12[UTC], changelist=253570, host=PWDFM026.wdf.sap.corp)
    SapMetamodelCommon: 6.4011.00.0000.20050121165648.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:28:59[UTC], changelist=322878, host=PWDFM026.wdf.sap.corp)
    SapWebDynproGenerationCore: 6.4011.00.0000.20050215134310.0000 (release=630_VAL_REL, buildtime=2005-02-20:21:42:32[UTC], changelist=329103, host=PWDFM026.wdf.sap.corp)
    SapDictionaryGenerationTemplates: (unknown)
    Web Dynpro code generators of DC sap.com/tcwddispwda:
    No information available
    Web Dynpro code generators of DC sap.com/tcwdcorecomp:
    No information available
    J2EE Engine:
    No information available
    Java VM:
    Java HotSpot(TM) Server VM, version: 1.4.2_06-b03, vendor: Sun Microsystems Inc.
    Operating system:
    Windows XP, version: 5.1, architecture: x86
    Error stacktrace:
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for component com.mbb.crrs.web.webdynpro.component.DefaultRatingController. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
         at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:110)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.<init>(DelegatingComponent.java:38)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doInit(ClientComponent.java:775)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:329)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:349)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:599)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:48)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:391)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:265)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:74)
         ... 26 more
    Caused by: java.lang.ExceptionInInitializerError
         at com.mbb.crrs.web.webdynpro.component.wdp.InternalDefaultRatingController.<init>(InternalDefaultRatingController.java:192)
         ... 31 more
    Caused by: com.mbb.crrs.common.exceptions.ApplicationConfigurationException: Cannot load System Properties.
         at com.mbb.crrs.common.SystemContext.<init>(SystemContext.java:39)
         at com.mbb.crrs.common.SystemContext.getInstance(SystemContext.java:47)
         at com.mbb.crrs.common.LoggerFactory.getLogger(LoggerFactory.java:60)
         at com.mbb.crrs.web.webdynpro.component.DefaultRatingController.<clinit>(DefaultRatingController.java:737)
         ... 32 more
    Please help me on this issue.
    Thanks && Regards,
    Vijay.

    Hello!
    I face the same problem with Failed to create delegate for component:
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for component
    XXX.YYY.ZZZ..ume.Ume. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
    Caused by: java.lang.reflect.InvocationTargetException
    Caused by: java.lang.NoClassDefFoundError: com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClass
    I think this started after upgrading from 7.01 SP3 to SP5, but I'm not sure.
    What was it that solved your issue?
    *I found the error. My ProjectProperties.wdProperties did not contain the references it needed.*
    Edited by: Richard Linnander on Nov 23, 2009 2:33 PM

  • Error create a software component

    I am trying to create a software component in SLD, but I am getting following error.
    <b>“Unknown reference instance in CIMPropertyReference key property” </b>.
    I am giving following parameters .
    Product  : TBIT40_WORKSHOP,1.0 of SAP
    Vendor :sap
    Name :  PRASHANTH
    Version: 1.0
    can any one please help me create a SWC and also let me know how to create Product in SLD <b>I am new to XI</b> .

    Hi Prashanth,
    More on -
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a4/481955dc9e42c19d5a1bc3b8aead81/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/12/003479fa4c2d4aa9d175dcbb081d66/frameset.htm
    doubts in funda's of XI
    Hope this helps
    Regards,
    Moorthy

  • Can not create an Application Component on SAP R/3 system

    I have a source as SAP R/3 ( ECC 6.0 ) and Target as SAP BW 7.0
    a)Log on to SAP BW 7.0 and used  the “ID3CLNT400”  source system ,  by using  Modeling --
    > Source System  --  choose “Customizing Extractors”  from the context menu of the source system “ID3CLNT400”
    In the transaction  SBIW  on the SAP Source system , choose  the Business Information Warehouse -- > Post Processing of DataSources
    &#61550;     > Edit DataSources and Application Component Hierarchies.
    Choose the “IMG Activity “ Here , I am getting one warning.
    "NO Valid Application Component Exists"
    When I hit the continue button .
    Here when I create an Application Component and “SAVE”  the changes, I am getting the following error.
    Package "Z_Train" doesnt exists. Chose "Display Object " or "Cancel"
    Because of this , I couldn’t creat an Application component and also couldnot load any thing on the SAP BW side. Also , I am no way connected to the "Z_TRAIN" Package

    can u pls tell me how u solved it
    I am working on  Production system  when I go to rsa5 it displaying the msg
    No valid application component hierarchy exists
    Message no. R8053
    Diagnosis
    Currently no application component hierarchy ("APCO_MERGED", database table RODSAPPL and RODSAPPLT) exists in the system. This is required in BW so that the DataSources can be displayed correctly in the source system tree.
    Procedure
    Copy the application component hierarchy from the Content using transaction RSA9.
    In development system I went to RSA9 & transferred the application componet then its asks or pkg name I have given the pkg  name also before use the datasrcs , I have transported the same thing to production before transporting the datasrcs but in production the application component herarachy did not get transported I think that why its giving the msg No valid application component hierarchy exists but my datasrcs got transported ,pls suggest me what has to be done
    Should I import the same request in to production again
    Or shall I run rsa9 again & transfer the application component hierarchy again & transport it to production id I do this will already transported datarscs have any effect in production

  • How to create a datatable with row headers and column headers

    Hi,
    I am trying to create a two dimensional datatable which has both column headers and row headers. using <h:datatable> i could create a datatable with only column headers.
    Thanks in advance

    Are you saying that you want a column with only th's? You could also just apply some CSS on that specific column that its rows look like headers.

  • Create an Image Component that has a scale9Grid border

    Hello, I want to start the process of creating a custom Image
    Component that has a property of Scale9GridBorder, which upon
    setting, will use Scale9Grid to create a frame around an image. I
    was wondering if someone has any tips?
    I'm familiar with custom components, all written in
    Actionscript 3.0, and with the common createCHildren,
    commitPorperties, measure, updateDisplayLIst mehtods that Ill have
    to implement. I'm just not sure if classes like RectangleBorder,
    etc. will be of help for me.
    Maybe someone has already created a similar component?
    Thanks,
    Todd

    I guess, where I'm getting stuck is trying to use scale9Grid
    dynamically at runtime. Is this possible, or does scale9Grid only
    work with embeded images? (I can't find any samples of runtime
    setting a background image and then setting the innerRectangle of
    scale9Grid.
    THanks

  • How to create a text Component With Certain Properties

    I need to create a text component with the following properties:
    Has Capability to be italic, right/left aligned, have different background / foreground colors, and most importantly, the ability to have a fixed width and a height that is set by the amount of text in it (ie line wrapping expands the field vertically).
    It should be a simple exercise, but I cannot seem to figure out how to do it.

    Here is the correct syntax :
    private static JEditorPane constructPane(String text, int normWidth, int normHeight, boolean rightAlign, boolean italic,boolean isWhite) {
              JEditorPane pane = new JEditorPane();
              pane.setEditable(false);
              pane.setContentType("text/html");
              pane.setText(
                   "<html><head></head><body>"
                   + (italic?"<i>":"")
                   + "<table><COLGROUP><COL width=\""+normWidth+"\"><THREAD><tr><td valign=\"top\" align="+(rightAlign?"\"right\"":"\"left\"")+">"
                   + text+"</td></tr></table>"
                   + (italic?"</i>":"")
                   + "</body></html>");
              pane.setSize(normWidth,normHeight);
              if(isWhite)
                   pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1,0,1,0,Color.WHITE),BorderFactory.createEmptyBorder(0,1,0,1)));
                   pane.setForeground(Color.WHITE);
              else {
                   pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1,0,1,0,Color.BLACK),BorderFactory.createEmptyBorder(0,1,0,1)));
                   pane.setForeground(Color.BLACK);
              return pane;
         }

  • Cannot create SAPUI5 UI Component from a BPM Process

    Dear friends,
    For a very strange reason I am not able to create a SAPUI5 UI Component from a BPM Process. I am trying to create SAPUI5 UI's for an Human task as part of my BPM process. I am using NWDS 7.3 EHP1 SP15 PAT0000.
    We are using NWDI development configuration.
    The error log shows the following error:
    BC-BMT-BPM-CMP#      [Error: com.sap.glx.ide.flow.util.logger.IDEAbstractDynamicParticipant$TRACEENTRIES  Thread[main,6,main]]
    If I try to do the same under my LocalDevelopment I'm able to create a SAPUI5 component.
    Any ideas what could be causing this issue or where to look for more information about the error?
    Thank you in advance,

    Does anyone has any idea? This is rather urgent...
    Thank you,

  • How to create custom MXML component accepting other MXML componenents as children

    How can I create an MXML component that when I use it in the "main" MXML, accepts other MXML components...
    For example:
    <s:WindowedApplication>
         <myComponent>
              <otherMXMLcomponent></otherMXMLcomponent>
              <otherMXMLcomponent></otherMXMLcomponent>
              <otherMXMLcomponent></otherMXMLcomponent>
              <otherMXMLcomponent></otherMXMLcomponent>
         </myComponent>
    <s:WindowedApplication>
    How do you declare such a component?
    Thanks in advance

    Bhè non so se ho capito .. ti spiego la prova che ho fatto io.. Dunque, io ho provato a creare un mio componente Custom e a metterci dentro degli oggetti miei di esempio.. Il componente di esempio si chiama mioComponenteCustom e all'interno è strutturato in questo modo:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx">
    </s:Group>
    Al posto dei puntini ci metto quello che voglio.. nel tuo caso i tuoi 2 famosi pulsanti..
    All'esterno chiamerò :
    <mioComponenteCustom>
         <s:DataGrid>
         </s:DataGrid
    </mioComponenteCustom>
    Dove DataGrid è un componente a caso qualsiasi.. Ora, con questa struttura non ricevo errori e sembra andare bene..
    Dimmi se ho capito bene o volevi fare altro..
    Max

  • Creating flash cs3 component

    Hi,
    There is great and easy way to create flash based component
    in flash cs3 using action script 3.0.
    I am going to make a simple My button component which will
    behave likely same as flash native button component.
    You can modify this according your requirement this is just
    you give an idea about how we can go for creating a component in
    flash cs3.
    Follow these steps…
    1. Create a fla file and save this file with any name
    2. Create a movieClip and draw a rectangle shape on first
    frame.
    3. Right click on movieclip in library, select linkage
    4. Provide class name in text field area [MyButton] (you can
    use any name here which should matched with your class)
    5. Click Ok button
    6. Write class [MyButton]
    (you can copy and use this)
    * author @ sanjeev rajput
    * [email protected]
    * A flash action script 3.0 based component without extending
    UIComponent class
    package {
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import fl.motion.Color;
    public class MyButton extends Sprite{
    private var _tf:TextField;
    private var _Label:String="My Button";
    private var _bgColor:uint=0xCCCCCC;
    private var _rollOverColor:uint=0xFFCCCC;
    private var _borderColor:uint=0x000000;
    private var _borderThickness:int=1;
    private var _width:Number = 100;
    private var _height:Number =100;
    private var _background:Sprite;
    public function MyButton() {
    init();
    createChildren();
    initEventListeners();
    draw();
    //-------------property section [Start]
    [Inspectable]
    public function set Label(lbl:String){
    _Label=lbl;
    draw();
    public function get Label(){
    return _Label
    [Inspectable]
    public function set bgColor(color:uint):void{
    _bgColor=color;
    draw();
    [Inspectable]
    public function set borderColor(color:uint):void{
    _borderColor=color;
    draw();
    [Inspectable]
    public function set borderThickness(thickness:int):void{
    _borderThickness=thickness;
    [Inspectable]
    public function set rollOverColor(color:uint):void{
    _rollOverColor=color;
    //-------------property section [End]
    private function init():void {
    trace('welcome');
    _width = width;
    _height = height;
    scaleX = 1;
    scaleY = 1;
    removeChildAt(0);
    private function initEventListeners():void{
    addEventListener(MouseEvent.MOUSE_OVER, eventHandler);
    addEventListener(MouseEvent.MOUSE_OUT, eventHandler);
    private function eventHandler(event:Event):void{
    if(event.type == MouseEvent.MOUSE_OVER){
    toggleColor(_rollOverColor);
    if(event.type == MouseEvent.MOUSE_OUT){
    toggleColor(_bgColor)
    private function createChildren():void {
    _background = new Sprite();
    _tf = new TextField();
    _tf.autoSize = "center";
    _tf.selectable=false;
    addChild(_background);
    addChild(_tf);
    protected function draw():void {
    toggleColor(_bgColor);
    _tf.text = _Label;
    _tf.x = Math.floor((_width - _tf.width)/2);
    _tf.y = Math.floor((_height - _tf.height)/2);
    //width = _tf.width;
    private function toggleColor(color:uint):void{
    _background.graphics.clear();
    _background.graphics.beginFill(color, 1);
    _background.graphics.lineStyle(_borderThickness,
    _borderColor, 1);
    _background.graphics.drawRoundRect(0, 0, _width, _height,
    10, 10);
    _background.graphics.endFill();
    public function setSize(w:Number, h:Number):void {
    _width = w;
    _height = h;
    draw();
    7. Now right click again on your movieclip in library and
    select component definition.
    8. In class name text field provide same class name
    [MyButton]
    9. Click on ok button
    10. Right click again on movieClip in library and select
    Export SWC file.
    11. Same your exported SWC file in (For window only)
    [c:\Documents and Settings\$user\Local Settings\Application
    Data\Adobe\Flash CS3\en\Configuration\Commands\
    12. Now just open another new flash file open component
    panel/window reload component you will your component in component
    panel with MyButton name.
    13. Drag your custom component on stage provide inputs form
    property window and text it.
    Enjoy!

    Lt.CYX[UGA] wrote:
    > if anyone is using Flash CS3, try creating a flash
    movie, using the FLVPlayer
    > component to play an flv video and make it an executable
    projector. Run it
    > fullscreen and watch how the screen just stays black
    when the video should
    > appear. If you stay windowed, it works fine.
    >
    >
    steps to reproduce:
    > 1. create flash movie
    > 2. put an FLVPlayer component on a frame that's not the
    first (for testing
    > purposes)
    > 3. before the projector reaches the frame with the
    FLVPlayer component, change
    > it to fullscreen (by script or CTRL+F)
    >
    >
    observed behaviour:
    > not only the video doesn't play, but the whole screen is
    black until the
    > player goes back to windowed mode
    >
    >
    expected behaviour:
    > video should play
    >
    >
    remarks:
    > if you skip step 3, video plays correctly
    >
    Works just fine.
    Made new movie, on frame 2 places Full screen action, on
    frame 5 placed video component
    and stop(); action attached to frame. Projector pops large
    following by video playing
    just fine.
    I tried variety, first frame, many frames, all on one. Not
    able to reproduce your problem.
    Works on first go.
    Best Regards
    Urami
    Beauty is in the eye of the beer holder...
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

Maybe you are looking for