Nest array in a custom component

Hello and thanks in advance,
I am building a custom datagrid component name custDG. It is a canvas containing the DG and some other visuals. So the actual component is based on canvas and has a DataGrid nested.
I have also build a custom class name config based on Array to hold the DG column information
AND a custom object class name col to hold each column information inside the config array class...
My question is how to make it possible for user to nest the array and columns inside the custom component when adds it to an application. For example:
<mike:custDG... >
     <mike:config>
          <mike:col.../>
          <mike:col.../>
          <mike:col.../>
     </mike:config>
</mike:custDG... >
Want to make something similar to the columns-datagridcolumn thingie but with custom classes in a custom component.
Anyone plz?
Thanks

I finally found how to set a default skin to a custom component so that users of my component will not have to set again the skinClass value of my component.
You have to create a defaults.css file at the root of your library and tell the compiler to take it into account.
The remaining problem is about the compiler. There are some steps before success and they are a bit mysterious/unclear....
I found 2 or 3 blog articles explaining those steps but the compiler arguments to use are all differents in each article...
Here are the links I found:
http://www.unitedmindset.com/jonbcampos/2010/05/12/creating-custom-spark-components/
http://www.betadesigns.co.uk/Blog/2010/05/14/default-skin-for-custom-flashbuilder-componen ts/
http://flexdevtips.blogspot.com/2009/06/default-stylesheet-in-swc-flex-library.html
Following the first article guidelines has been successful for me but I'm not marking this topic as Resolved because I'd like some answers about this whole thing...

Similar Messages

  • Nesting JSF components in a  custom component

    I'm creating a new JSF custom component. my component needs to include an input text and a list box. my question is : how do I add these components to my JSF component ? I want to use to JSF component to render them rather then encoding the HTML myself. how can I do it ?
    I was told I need to use encodeChildren method somehow but I don't know how ?

    I finally found how to set a default skin to a custom component so that users of my component will not have to set again the skinClass value of my component.
    You have to create a defaults.css file at the root of your library and tell the compiler to take it into account.
    The remaining problem is about the compiler. There are some steps before success and they are a bit mysterious/unclear....
    I found 2 or 3 blog articles explaining those steps but the compiler arguments to use are all differents in each article...
    Here are the links I found:
    http://www.unitedmindset.com/jonbcampos/2010/05/12/creating-custom-spark-components/
    http://www.betadesigns.co.uk/Blog/2010/05/14/default-skin-for-custom-flashbuilder-componen ts/
    http://flexdevtips.blogspot.com/2009/06/default-stylesheet-in-swc-flex-library.html
    Following the first article guidelines has been successful for me but I'm not marking this topic as Resolved because I'd like some answers about this whole thing...

  • Advice on creating a tricky custom component

    Hi,
    I'm working on creating a custom component which displays a image at the top of the canvas, and loops through a passed array collection, displaying each row of the array collection in a item renderer. So the component should look like this (see attached image).
    As you can see from this image the header is a image itself, this will differ every instance of the panel, there should be 3 of these panels on the page. Then each row of data is a item renderer displaying the data provided from a array collection of value object. If there are 4 items in this array collection then the panel should show 4 rows, if there are 2 row in the array then the panel will display 2 rows. Also the height of the panel will dynamically change depending on the number of rows to show.
    I was thinking of extending a Canvas component, and then passing in the image URL and trying to load and draw the image dynamically, then I was thinking of using the Drawing API to create the rectangle shape using the drawRoundRectComplex() of the graphics class.
    The problems I see with this is that I don't think the drawn rectangle shape can re-draw itself to show the change in height when more or less row of data need to be be displayed.
    Another option I have been thinking about is extending the Panel class to create my component, this may be better for handling the height resizing, but I'm not sure it can support the look of this component (the header image and the three rounded corners).
    Could anyone give me some advice on what would be the better option for creating this component.
    Thanks
    Stephen

  • Best strategy for variable aggregate custom component in dataTable

    Hey group, I've got a question.
    I'd like to write a custom component to display a series of editable Things in a datatable, but the structure of each Thing will vary depending on what type of Thing it is. So, some Things will display radio button groups (with each radio button selecting a small set of additional input elements, so we have a vertical array radio buttons and beside each radio button, a small number of additional input elements), some will display text-entry fields, and so on.
    I'm wondering what the best strategy for tackling this sort of thing is. I'm sort of thinking I'll need to do something like dynamically add to the component tree in my custom component's encodeBegin(), and purge the extra (sub-) components in encodeEnd().
    Decoding will be a bit of a challenge, maybe.
    Or do I simply instantiate (via constructor calls, not createComponent()) the components I want and explicitly call their encode*() and decode() methods, without adding them to the view tree?
    To add to the fun of all this, I'm only just learning Faces (having gone through the Dudney book, Mastering JSF, and writing some simpler custom components) and I don't have experience with anything other than plain vanilla JSP. (No EJB, no Struts, no Tapestry, no spiffy VisualDevStudioWysiwyg++ [bah humbug, I'm an emacs user]). I'm using JSP 2.0, JSF 1.1_01, JBoss 4.0.1 and JDK 1.4.2. No, I won't upgrade to 1.5 (yet).
    Any hints, pointers to good sample code? I've looked at some of the sample code that came with the RI and I've tried to navigate the JSF Blueprints stuff, but I haven't really found anything on aggregating components into a custom component. Did I miss something obvious?
    If this isn't a good question, please let me know how I can sharpen it up a bit.
    Thanks.
    John.

    Hi,
    We're doing something very similar. I had a look at the Tomahawk Date component, and it seems to dynamically created InputText components in the encodeEnd(). However, it doesn't decode this directly (it only expects a single textual value). I expect you may have to check the request yourself in decode().
    Other ideas would be appreciated, though - I'm still new to JSF.

  • Custom component: porting from lc 8.0 to lc 8.2

    hello
    i developed a java pojo custom component for lc 8.0, essentially it connected to a db and returned a complex object. Now the environment has been upgraded to lc 8.2 . I've loaded my processes (which include my custom component) on the new environment. When i start the process , my component reaches the finally block where i've logged the db connections closing. Immediatly after the system crushes with the following error(i haven't added the whole stack trace because its huge): 
    2009-04-10 13:11:21,422 WARN  [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@2ac6fb1
    2009-04-10 13:11:21,431 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract com.adobe.pof.GenericObject com.adobe.pof.omapi.POFObjectManagerLocal.writeObject(com.adobe.pof.GenericObject,com.ado be.idp.Context) throws com.adobe.pof.POFException, causedBy:
    org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 643401bb:6b45:49df1884:29cb status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 643401bb:6b45:49df1884:29cb status: ActionStatus.ABORT_ONLY >))
        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94 )
        at com.adobe.pof.ConnectionWrapper.getConnection(ConnectionWrapper.java:45)
        at com.adobe.pof.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:179)
        at com.adobe.pof.adapter.JDBCAdapter.prepareStatement(JDBCAdapter.java:5299)
    After that jboss get stucked, printing exceptions every 2 minutes, and i need to stop and restart it. I don't see anything wrong with my code: i get the datasource object, i get a coonettin from it, make my queries/updates and finally i close the connection.
    googling i've found this might be due to datasource item being local-tx-datasource instead of xa-datasource, but all datasources are of this kind.
    Any hint about this problem will be greatly appreciated
    thank you in advance
    Stefano

    hi Steve
    thank you for your answer. Unluckly i'm not using mysql but oracle 9i (or 10i i don't know since i'm just a poor programmer). Anyway i did a test : i've bypassed the datasource file , hardcoding the connection parameters in my custom component and it has got executed without problem, then process has crushed again on a query done by some adobe component. there are many adobe sql component instances to read/write from the same schema my compnent uses, so i suppose the problem is inside datasource configuration. There's a datasource sample for oracle too?
    I cannot give much details, since the new system has been recently installed and i don't know all info (i think jboss is 4.2 but i'm not sure)
    thanks again
    regards
    Stfano

  • Custom component and non-primitive types of attributes

    Dear programmers
    I try to develope a custom UI component that one of its attribute is an ArrayList. For example:
    <productFile:Matrix images="#{MyBean.imagesArray}"/>Unfortuanetly I get the following exception:
    [Unable to convert string &#39;#{MyBean.imagesArray}&#39; to class java.util.ArrayList for attribute images: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager]: org.apache.jasper.JasperException: Unable to convert string '#{MyBean.imagesArray}' to class java.util.ArrayList for attribute images: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
    The attribute images is an ArrayList in the custom component.
    I have also specifieded it as an ArrayList in the tld file:
    <tag>
           <name>Matrix</name>
           <tag-class>org.sii.productfilejsf.tags.MatrixTag</tag-class>
           <body-content>JSP</body-content>
           <attribute>
                <name>images</name>
                <required>false</required>
                <rtexprvalue>false</rtexprvalue>
                <type>java.util.ArrayList</type>
           </attribute>
      </tag>Does anyone has an idea what can be the problem?
    How can I convert the expression?

    so how will I be able to convert it?Only your converter knows it.
    By the way, is your Matrix component fully completed including its children components?
    If yes, you should know how to implement a converter, or its equivalent code for them.
    For example, in the <h:dataTable> component, if its value attribute points an array of object,
    then it is automatically converted to an appropriate DataModel used by its column children.
    We may need to see your MyBean bean and related code set, if we have enough time.

  • How a custom component is called when we install a custom component in UCM.

    How a custom component is called when we install a custom component in UCM.
    On what event the component services will be activated and called.
    Suppose i create a Custom service name MULTIPLECHECKIN then this service will be called on what event and where it will be defined to call.

    Saurabh,
    the code is packed in the component (see component\Security Filter\java\Security Filter\ModifyAttributesFilter.java - the first Security Filter is the component name, the other Security Filter is the Java package name).
    What is important:
    - your class must implement the FilterImplementor interface (you will need UCM standard classes - server.zip in your classpath) and its doFilter method
    How the filter is executed?
    - actually, in this case you don't need any new service - you can use the standard 'hook', which is provided by standard checkin services
    - in Component Wizard create a new component, add your compiled class to it (make sure you follow the rules not to end up in classpath issues)
    - in Component Wizard click the 'Java Code' tab. Here you can add a Custom filter called validateCheckinData, which is executed by standard checkin services. If you parametrize the filter to call your class created above, you are done.
    'Working with Content Components' manual (e.g. here: http://download.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/documentation/developer/using_components_10en.pdf) can give you a basic picture. A better resource is Bex Huff's book - I would recommend you to get it, because it has a step-by-step HelloWorld example which can guide you through Component Wizard. I could also send you my own component (send me an email at [email protected]) which implements a filter for user quotas, so you just need to "replace classes".
    As for the other half of your task, searching for the file in the database server will work only if you use database as your storage (ie. install and configure File Store Provider component accordingly). Of course, you could do a search for file in this case - just consider that you will be comparing two BLOBs rather than two relatively short check-sums (most likely strings or arrays of bytes). Besides, it will not work if you use filesystem as your storage.
    Jiri

  • Including .as files in a custom component

    Can anyone tell me how to include an actionscript file in a
    custom component when the .as file resides one level above the
    component?
    All of my custom components are in the "src/components"
    directory and the actionscript file I need to include is one level
    up in the "src" directory. I assume this can be done easily, but I
    am new to Flex and can't get it working. I have tried ../ ,
    parentDocument, parentApplication, Application.application, and
    fully referencing the file from C: with no luck.
    The ../ version seems to point to the right place but my
    Problems panel is showing
    "1068: Unable to open included file:
    C:\CFusionMX7\wwwroot\c21hp\flex\src\yahooMap2.as"
    Any help would be greatly appreciated.

    @Ryan:
    Thanks for your reply. For type property in Inspectable metadata tag: http://livedocs.adobe.com/flex/gumbo/html/WS2db454920e96a9e51e63e3d11c0bf680e1-7ffe.html#W S2db454920e96a9e51e63e3d11c0bf69084-7a21
    It can have values like Boolean, Array, String etc. I am trying to have a custom one. But I notice that I have to close the property tag, even if it is a string or html for e.g. text property in TextInput, I have to write something like this:
    <mx:TextInput>
            <mx:htmlText>
                <![CDATA[
                ]]>
            </mx:htmlText>
        </mx:TextInput>
    and
    <mx:TextInput>
            <mx:text>something</mx:text>
        </mx:TextInput>
    But I still think, it should be there. Not sure
    Chetan

  • Component property declaration in a Custom Component

    Hello everyone,
    I have a question related to a custom component. I will define a use case and how I want to define a property.
    e.g.: I develop a custom component using Flex Library Project, with all manifest.xml, design.xml, locale etc. My component name is CustomList, now in this component, I define a property with following getter/setter.
    //  defaultState
    private var _defaultState:CustomState;
    [Bindable( "defaultStateChange" )]
    //I have tried defining type property as CustomState, doesn't works
    [Inspectable( category="General",  name="Default State" )]
    public function get defaultState():CustomState
         return _defaultState
    public function set defaultState( v:CustomState ):void
         if ( _defaultState!= v)
              _defaultState = v
              dispatchEvent(new Event("defaultStateChange"))
    Here, CustomState extends MXMLObjectAdapter and defines a id property and few other property. and In mxml I can define it like this,
    <CustomList ....>
         <defaultState>
              <CustomState label="" icon="" />
         </defaultState>
    </CustomList>
    Now, what I want to achieve is, I want to define property something like this:
    <CustomList ....>
         <defaultState label="" icon=""/>
    </CustomList>
    Can someone tell me how to achieve this and point me to some description about it.
    Thanks in advance.
    Chetan Sachdev

    @Ryan:
    Thanks for your reply. For type property in Inspectable metadata tag: http://livedocs.adobe.com/flex/gumbo/html/WS2db454920e96a9e51e63e3d11c0bf680e1-7ffe.html#W S2db454920e96a9e51e63e3d11c0bf69084-7a21
    It can have values like Boolean, Array, String etc. I am trying to have a custom one. But I notice that I have to close the property tag, even if it is a string or html for e.g. text property in TextInput, I have to write something like this:
    <mx:TextInput>
            <mx:htmlText>
                <![CDATA[
                ]]>
            </mx:htmlText>
        </mx:TextInput>
    and
    <mx:TextInput>
            <mx:text>something</mx:text>
        </mx:TextInput>
    But I still think, it should be there. Not sure
    Chetan

  • Dynamic datatable in custom component

    hi all,
    i'm working on a custom jsf component and this component will create a datatable dynamically. (you can see component details from http://www.jroller.com/page/hasant?entry=creating_dynamic_datatable_inside_of AND http://www.jroller.com/page/hasant?entry=jsf_question_for_community_what)
    the question is; when i want to add a selection column(dynamically), how can i handle its selected values?
    i mean, if i have created this datatable in a page with designer, i would bind an Integer[] to that selection column's checkboxes. But i have to add this selection column dynamically from my component. So, how can i GET and SET the selection columns values. Since this is a custom component, there is no backing bean for value binding to this component.
    when i resolve the request param string to get the selected rows, it's working(=i can see the selected rows somehow..) but, i can not set that values again while encoding that column after a submit.
    here is my row selection column encoding code;
         private void addSelectionColumnToTable(FacesContext context, UIData table) {
              UIColumn column = new UIColumn();
              HtmlInputRowSelect rowSelect = new HtmlInputRowSelect();
              rowSelect.setId("rowSelect1");
              rowSelect.setStyleClass("inputRowSelect");
              rowSelect.setValue(m_selectedRows);
              column.getChildren().add(rowSelect);
              table.getChildren().add(column);
         }In the code above, rowSelect.setValue(m_selectedRows); part not effecting anyhing. m_selectedRows variable includes row numbers(in an Integer array) that i want to see as selected.
    any solution/recommendation?

    Well if you are still interested in using a text component
    instead of a Button the way you would go about this is using
    textWidth. Here's how I've done it before using a text / label
    whatever you want that shows text.
    // => Set our text we got from database
    myText.text = "This is the text I got from the DB";
    // => Validate it so that way we make sure we get right
    numbers
    myText.validateNow();
    // => Find out how wide our text really is.
    var textWidth:Number = myText.textWidth
    // => Reset the width of our text component and add 20 for
    a little buffer
    myText.width = textWidth + 20;
    Now my suggestion is if your going to be dynamically creating
    these on the fly from a database call you throw it into a method /
    class and have that do all the work for you so all you have to do
    is pass the text to it and it resizes itself based on the example
    above.

  • Custom component problem

    I wrote a custom component:
    Here is the code for the UIComponent:
    package customcomponents;
    import javax.faces.component.*;
    import javax.faces.context.*;
    import java.util.Vector;
    import jsf.*;
    public class UIEventsTable extends UIComponentBase {
         public String getFamily() {
              return "EventsTable";
         public void encodeEnd( FacesContext context ) throws java.io.IOException {
              Vector<Event> events = (Vector<Event>) this.getAttributes().get("events");
              ResponseWriter writer = context.getResponseWriter();
              writer.startElement("table" , this );
              for( int i = 0 ; i < events.size() ; ++i ) {
                   writer.startElement("tr",this);
                        writer.startElement("td",this);
                             writer.write( events.elementAt(i).getEvent_description() );
                        writer.endElement("td");
                   writer.endElement("tr");
              writer.endElement("table");
    }This is the tag class
    package customcomponents;
    import javax.faces.webapp.*;
    import javax.faces.component.*;
    import java.util.*;
    import jsf.*;
    public class EventsTableTag extends UIComponentTag {
         Vector<Event> events = null;
         public String getRendererType() {
              return null;
         public String getComponentType() {
              return "EventsTable";
         public void release() {
              super.release();
              events = null;
         protected void setProperties( UIComponent component ){
              super.setProperties( component );
              if( events != null )
                   component.getAttributes().put( "events" , events );
         public Vector<Event> getEvents() {
              return events;
         public void setEvents(Vector<Event> events) {
              this.events = events;
    }Taglib descriptor:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
         <tlib-version>1.0</tlib-version>
        <jsp-version>1.2</jsp-version>
        <short-name>d</short-name>
         <uri>http://eventsTable.com/</uri>
        <tag>
             <name>EventsTable</name>
               <tag-class>customcomponents.EventsTableTag</tag-class>
               <body-content>JSP</body-content>
             <attribute>
                  <name>events</name>
             </attribute>
             <attribute>
                  <name>id</name>
             </attribute>
             <attribute>
                   <name>rendered</name>
              </attribute>
              <attribute>
                   <name>binding</name>
              </attribute>
        </tag>
    </taglib>And finally how I invoke the tag
    <d:EventsTable events="#{location.events}" />
    ...Now location.events is a java.util.Vector with the events. But when I use this tag I get following error message:
    Servlet.service() for servlet Faces Servlet threw exception
    org.apache.jasper.JasperException: Unable to convert string "#{location.events}" to class "java.util.Vector" for attribute "events": Property Editor not registered with the PropertyEditorManagerI do not understand why this doesn't work. Because in a "h:dataTable" I can tell the component to use an array as an input. Even more I don't know what a PropertyEditorManager is.
    So how can I pass the vector object to this custom component?

    I have tried with tomcat-6.0.14 and RI 1.2_06-b02-FCS
    <?xml version="1.0" encoding="UTF-8"?>
    <taglib xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
       version="2.1">
       <tlib-version>1.1</tlib-version>
        <short-name>d</short-name>
         <uri>http://eventsTable.com/</uri>
        <tag>
             <name>EventsTable</name>
               <tag-class>customcomponents.EventsTableTag</tag-class>
           <attribute>
               <name>events</name>
             <deferred-value>
                <type>java.util.Vector</type>
             </deferred-value>        
          </attribute>
        </tag>
    </taglib>
    package customcomponents;
    import javax.el.ValueExpression;
    import javax.faces.webapp.*;
    import javax.faces.component.*;
    public class EventsTableTag extends UIComponentELTag {
         private ValueExpression events = null;
         public String getRendererType() {
              return null;
         public String getComponentType() {
              return "EventsTable";
         public void release() {
              super.release();
              events = null;
         protected void setProperties( UIComponent component ){
              super.setProperties( component );
              component.setValueExpression("events", events);
         public void setEvents(ValueExpression events){
              this.events = events;
    }

  • Adding Visual custom component in spark DataGrid

    I am working with flex 4.5. I want to create Gauge component Datagrid.
    I am using open source com.betterthantomorrow.components. I have created custom components like this
        <?xml version="1.0" encoding="utf-8"?>
        <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                   xmlns:s="library://ns.adobe.com/flex/spark"
                                                   xmlns:mx="library://ns.adobe.com/flex/mx"
                                                   xmlns:bttc="com.betterthantomorrow.components.*"
                                                   xmlns:gauge="com.betterthantomorrow.components.gauge.*"
                                                   xmlns:objects="tekhnia.com.tekhniag.objects.*"
                                                   width="30%" height="65" backgroundColor="black" borderColor="black"
                                                   creationComplete="init(event)">
                  <fx:Declarations>
                            <mx:NumberFormatter precision="1" id="formatter" rounding="nearest" />
                  </fx:Declarations>
                  <fx:Script>
                            <![CDATA[
                                      import mx.events.FlexEvent;
                                      import mx.messaging.channels.StreamingAMFChannel;
                                      [Bindable]
                                      public var cpuValue:Number;
                                      [Bindable]
                                      public var memoryValue:Number;
                                      [Bindable]
                                      public var diskValue:Number;
                                      [Bindable]
                                      public var mycomp:String;
                                      [Bindable]
                                      public var serverName:String;
                                      [Bindable]
                                      public var statusImage:String;
                                      protected function init(event:FlexEvent):void
                                                var strValues:String;
                                                var strColors:String;
                                                var strAlphas:String;
                                                strColors="0x009900,0xFFFF00,0xDD0000";
                                                strValues="0,50,70,100";
                                                strAlphas=".8,.8,.8"
                                                var values:Array=strValues.split(",");
                                                var colors:Array=strColors.split(",");
                                                var alphas:Array=strAlphas.split(",");
                                                gauge1.setStyle("alertValues",values);
                                                gauge1.setStyle("alertColors",colors);
                                                gauge1.setStyle("alertAlphas",alphas);
                                                gauge2.setStyle("alertValues",values);
                                                gauge2.setStyle("alertColors",colors);
                                                gauge2.setStyle("alertAlphas",alphas);
                                                gauge.setStyle("alertValues",values);
                                                gauge.setStyle("alertColors",colors);
                                                gauge.setStyle("alertAlphas",alphas);
                                                gauge.invalidateDisplayList();
                                                gauge1.invalidateDisplayList();
                                                gauge2.invalidateDisplayList();
                            ]]>
                  </fx:Script>
                  <s:layout>
                            <s:HorizontalLayout/>
                  </s:layout>
                  <s:TileGroup width="101" paddingLeft="20" paddingRight="2">
                            <bttc:Gauge id="gauge"
                                                          diameter="50" width="50"
                                                          verticalCenter="0" horizontalCenter="-111"
                                                          minValue="1"  maxValue="10" value="{cpuValue}"  valueFormatter="{formatter}"
                                                          bigTicks="9" smallTicks="45" showMinMax="false" showValue="false" pointerColor="white"/>
                  </s:TileGroup>
                  <s:TileGroup width="101" paddingLeft="20" paddingRight="2">
                            <bttc:Gauge id="gauge1"
                                                          diameter="50" width="50"
                                                          verticalCenter="0" horizontalCenter="-111"
                                                          minValue="1"  maxValue="10" value="{memoryValue}"  valueFormatter="{formatter}"
                                                          bigTicks="9" smallTicks="45" showMinMax="false" showValue="false" pointerColor="white" automationName="T"/>
                  </s:TileGroup>
                  <s:TileGroup width="101" paddingLeft="20" paddingRight="2">
                            <bttc:Gauge id="gauge2"
                                                          diameter="50" width="50"
                                                          verticalCenter="0" horizontalCenter="-111"
                                                          minValue="1"  maxValue="10" value="{diskValue}"  valueFormatter="{formatter}"
                                                          bigTicks="9" smallTicks="45" showMinMax="false" showValue="false" pointerColor="white"/>
                  </s:TileGroup>
                  <s:TileGroup width="40" paddingTop="3">
                            <s:Image source="assets/led/big/{statusImage}" />
                            <s:Label  color="white" text="{serverName}" textAlign="center"/>
                  </s:TileGroup>
        </s:BorderContainer>
    I want to add this component in Datagrid. I have tried a lot on net. I didn't find any help. I read books as well.
    Please help me. I found somewhere on the site one liner answer : write grid renderer. I don't how to write grid renderer and pass the data values to it.
    I will be more thank full someone gives me pointer to sample grid renderer or code.

    What's the flow here?
    Do you want to pop-up a JSP in a window to prompt the user for extra information before submitting the check-in form? If so, you need a custom component to override the resource that draws the "submit" button on the form.
    Or, do you want to execute something like a web service during the check-in process? If so, do a validateStandard filter. See the 'DynamicPrefix' comonent in the howtocomponents:
    http://www.oracle.com/technetwork/middleware/content-management/index-092832.html

  • Properly binding an object to a custom component.

    I am apparently not doing this. What am I missing to properly
    bind an
    object from a repeater looping over an array of object to the
    custom
    component called in the repeater?
    <mx:Repeater
    id="dayCells"
    dataProvider="{days}"
    startingIndex="{weekRows.currentItem}"
    count="7">
    <mx:GridItem
    width="14%"
    borderColor="black"
    borderThickness="1"
    borderStyle="solid">
    <mx:Label
    text="{dayCells.currentItem.formatedDate}" />
    <ian:dayFormat2
    drawData="{dayCells.currentItem as drawDay}"
    test="{dayCells.currentItem.formatedDate}" />
    </mx:GridItem>
    </mx:Repeater>
    {days} is an array of drawDate.as objects returned with a
    remoteObject.
    I can correctly bind properties of these drawDate objects in
    the
    lable and the test property of the dayFormat2
    customComponent. But I
    can NOT correctly bind the entire object over to dayFormat2.
    What am I
    missing?
    My current version of dayFormat2.mxml, I have tried several
    alternatives
    for this file.
    ?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%">
    <mx:Script>
    <![CDATA[
    import drawDay;
    //Define public variables
    [Bindable]
    public var drawData:drawDay;
    [Bindable]
    public var test:String;
    ]]>
    </mx:Script>
    <mx:DateFormatter id="dayNum" formatString="DD" />
    <mx:HBox
    backgroundColor="0x002649"
    width="100%"
    horizontalAlign="right">
    <mx:Label
    text="{test}"
    color="white" />
    <mx:HBox
    backgroundColor="0xAF1E2D"
    horizontalAlign="center">
    <mx:Label
    text="{dayNum.format(drawData.date)}"
    color="white" />
    </mx:HBox>
    </mx:HBox>
    <mx:Label text="foobar" />
    </mx:VBox>
    The first label bound to the test String works correctly. The
    second
    label bound to the drawData drawDay object date property does
    not work
    correctly.
    What is the proper way to bind this object?

    I have struggled with this all day and made no headway. The
    only
    strange thing I get is with this line:
    <mx:Label text="{dayCells.currentItem.toString()}" />
    outputs [object Object]
    Not the expected string from this drawDay.as function.
    // toString()
    public function toString():String
    return "Date: " + formatedDate;
    Ian Skinner wrote:
    > I am apparently not doing this. What am I missing to
    properly bind an
    > object from a repeater looping over an array of object
    to the custom
    > component called in the repeater?
    >
    > <mx:Repeater
    > id="dayCells"
    > dataProvider="{days}"
    > startingIndex="{weekRows.currentItem}"
    > count="7">
    > <mx:GridItem
    > width="14%"
    > borderColor="black"
    > borderThickness="1"
    > borderStyle="solid">
    > <mx:Label
    > text="{dayCells.currentItem.formatedDate}" />
    > <ian:dayFormat2
    > drawData="{dayCells.currentItem as drawDay}"
    > test="{dayCells.currentItem.formatedDate}" />
    > </mx:GridItem>
    > </mx:Repeater>
    >
    > {days} is an array of drawDate.as objects returned with
    a remoteObject.
    > I can correctly bind properties of these drawDate
    objects in the lable
    > and the test property of the dayFormat2 customComponent.
    But I can NOT
    > correctly bind the entire object over to dayFormat2.
    What am I missing?
    >
    > My current version of dayFormat2.mxml, I have tried
    several alternatives
    > for this file.
    >
    > ?xml version="1.0" encoding="utf-8"?>
    > <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%">
    > <mx:Script>
    > <![CDATA[
    > import drawDay;
    >
    > //Define public variables
    > [Bindable]
    > public var drawData:drawDay;
    >
    > [Bindable]
    > public var test:String;
    > ]]>
    > </mx:Script>
    >
    > <mx:DateFormatter id="dayNum" formatString="DD" />
    >
    > <mx:HBox
    > backgroundColor="0x002649"
    > width="100%"
    > horizontalAlign="right">
    > <mx:Label
    > text="{test}"
    > color="white" />
    > <mx:HBox
    > backgroundColor="0xAF1E2D"
    > horizontalAlign="center">
    > <mx:Label
    > text="{dayNum.format(drawData.date)}"
    > color="white" />
    > </mx:HBox>
    > </mx:HBox>
    >
    > <mx:Label text="foobar" />
    > </mx:VBox>
    >
    > The first label bound to the test String works
    correctly. The second
    > label bound to the drawData drawDay object date property
    does not work
    > correctly.
    >
    > What is the proper way to bind this object?

  • Can I define a constructor for a Custom Component?

    I have a custom component which I instantiate through ActionScript.  For the sake of clean code, I would like to be able to assign the variables through the constructor like any other class:
    var myComp:CustomComponent = new CustomComponent(arg1, arg2, ...);
    However, when I try to write a constructor in the Script block for the component, it gives me a compile error telling me that I have multiple constructors:
    //In Script tag//
    public function CustomeComponent(arg1, arg2 ...):void { ... }
    Are we not able to define constructors for Custom Components?

    If this post helps, please mark it as such.
    If you create an array variable in your MXML component, and then set it with myVar="[val1, val2, val3]" in the opening tag of your component, then you basically have a constructor in MXML.
    You can use the [Bindable] metadata tag in three places:
    Before a public class definition.
    The [Bindable] metadata tag makes usable as the source of a binding expression all public properties that you defined as variables, and all public properties that are defined by using both a setter and a getter method. In this case, [Bindable] takes no parameters, as the following example shows:
    [Bindable]
    public class TextAreaFontControl extends TextArea {}
    The Flex compiler automatically generates an event named propertyChange, of type PropertyChangeEvent, for all public properties so that the properties can be used as the source of a data binding expression.
    If the property value remains the same on a write, Flex does not dispatch the event or update the property, where not the same translates to the following test:
    (oldValue !== value)
    That means if a property contains a reference to an object, and that reference is modified to reference a different but equivalent object, the binding is triggered. If the property is not modified, but the object that it points to changes internally, the binding is not triggered.
    Note: When you use the [Bindable] metadata tag before a public class definition, it only applies to public properties; it does not apply to private or protected properties, or to properties defined in any other namespace. You must insert the [Bindable] metadata tag before a nonpublic property to make it usable as the source for a data binding expression.
    Before a public, protected, or private property defined as a variable to make that specific property support binding.
    The tag can have the following forms:
    [Bindable]
    public var foo:String;
    The Flex compiler automatically generates an event named propertyChange, of type PropertyChangeEvent, for the property. If the property value remains the same on a write, Flex does not dispatch the event or update the property.
    You can also specify the event name, as the following example shows:
    [Bindable(event="fooChanged")]
    public var foo:String;
    In this case, you are responsible for generating and dispatching the event, typically as part of some other method of your class. You can specify a [Bindable] tag that includes the event specification if you want to name the event, even when you already specified the [Bindable] tag at the class level.
    Before a public, protected, or private property defined by a getter or setter method.
    You must define both a setter and a getter method to use the [Bindable] tag with the property. If you define just a setter method, you create a write-only property that you cannot use as the source of a data-binding expression. If you define just a getter method, you create a read-only property that you can use as the source of a data-binding expression without inserting the [Bindable] metadata tag. This is similar to the way that you can use a variable, defined by using the const keyword, as the source for a data binding expression.
    The tag can have the following forms:
    As far as binding, you can add the [Bindable] tag before the class declaration to make bindable all public properties defined as variables, and all public properties defined by using both a setter and a getter method.

  • Adding Parameters (Inspectable) to a Custom Component?

    Hi --
    I am attempting to build a custom component just to learn a
    little more
    about AS 3.0. I can not figure out where / how in my package
    declarations I
    can "expose" parameters that will be visible to the user in
    the Flash IDE
    when using my component.
    Thanks
    Rich

    Hi Richard ,
    there is a pretty cool livedoc about component creation in as
    3 :
    http://www.adobe.com/devnet/flash/articles/creating_as3_components.html
    setting up the inspectables is the same as it was in as2
    i am doing it in my controller :
    [as]
    package mat3d.yugopReel {
    import flash.display.*;
    import flash.text.TextField;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import fl.core.InvalidationType;
    import fl.core.UIComponent;
    import fl.data.DataProvider;
    import fl.events.ComponentEvent;
    import fl.containers.UILoader;
    import mat3d.yugopReel.model.MainModel;
    public class ScrollReel extends UIComponent {
    public var dataProvider : DataProvider;
    public var RIG : Sprite;
    public var LeftBTN : Sprite;
    public var RightBTN : Sprite;
    public var myModel : mat3d.yugopReel.model.MainModel;
    private var _background : Sprite;
    private var _tf : TextField;
    public var _AutoScroll : Boolean;
    public var _StepControl : Boolean;
    private var _FileType : String;
    public var _File : String;
    private var _text : String;
    public var _ScrollInit : String;
    public var _StepBehaviour : String;
    public var _PictureSize : String;
    public var _ScrollTime : Number;
    public var abstand_x : Number = 90.3;
    public var abstand_y : Number = 125;
    public var ConfigData : Array;
    public function ScrollReel() {
    super();
    alpha = 0;
    myModel = new mat3d.yugopReel.model.MainModel(this);
    >> start get set INSPECTABLES
    AutoScroll start
    public function get AutoScroll() : Boolean {
    return _AutoScroll;
    myPropInit.AutoScroll = true;
    public function set AutoScroll(value : Boolean) : void {
    _AutoScroll = value;
    myPropInit.AutoScroll = true;
    [Inspectable(name="AutoScroll",defaultValue="false",type="Boolean")]
    AutoScroll end
    FileType start
    public function get FileType() : String {
    return _FileType;
    myPropInit.FileType = true;
    public function set FileType(value : String) : void {
    _FileType = value;
    myPropInit.FileType = true;
    [Inspectable(name="FileType",defaultValue="XML",type="String")]
    FileType end
    Filestart
    public function get File() : String {
    return _File;
    myPropInit.File = true;
    public function set File(value : String) : void {
    _File = value;
    myPropInit.File = true;
    init();
    [Inspectable(name="File",defaultValue="",type="String")]
    File end
    Width start
    public function get Width() : Number {
    return width;
    myPropInit.Width = true;
    public function set Width(value : Number) : void {
    width = value;
    //trace("setWidth >>>" + width);
    myPropInit.Width = true;
    [Inspectable(name="Width",defaultValue="250",type="Number")]
    Width end
    Height start
    public function get Height() : Number {
    return height;
    myPropInit.Height = true;
    public function set Height(value : Number) : void {
    height = value;
    trace("setHeight >>>" + height);
    myPropInit.Height = true;
    [Inspectable(name="Height",defaultValue="50",type="Number")]
    Height end
    ScrollTime start
    public function get ScrollTime() : Number {
    return _ScrollTime;
    myPropInit.ScrollTime = true;
    public function set ScrollTime(value : Number) : void {
    _ScrollTime = value;
    myPropInit.ScrollTime = true;
    [Inspectable(name="ScrollTime",defaultValue="0.2",type="Number")]
    ScrollTime end
    ScrollInit start
    public function get ScrollInit() : String {
    return _ScrollInit;
    myPropInit.ScrollInit = true;
    public function set ScrollInit(value : String) : void {
    _ScrollInit = value;
    myPropInit.ScrollInit = true;
    [Inspectable(name="ScrollInit",defaultValue="_x",type="String")]
    ScrollInit end
    PicSize start
    public function get PictureRatio() : String {
    return _PictureSize;
    myPropInit.PictureSize = true;
    public function set PictureRatio(value : String) : void {
    _PictureSize = value;
    myPropInit.PictureSize = true;
    [Inspectable(name="PictureSize",defaultValue="",type="String")]
    PictureSize end
    Step Controll start
    public function get StepControl() : Boolean {
    return _StepControl;
    myPropInit.StepControl = true;
    public function set StepControl(value : Boolean) : void {
    _StepControl = value;
    myPropInit.StepControl = true;
    [Inspectable(name="StepControl",defaultValue="false",type="Boolean")]
    Step Controll end
    Step Behaviour start
    public function get StepBehaviour() : String {
    return _StepBehaviour;
    myPropInit.StepBehaviour = true;
    public function set StepBehaviour(value : String) : void {
    _StepBehaviour = value;
    myPropInit.StepBehaviour = true;
    [Inspectable(name="StepBehaviour",defaultValue="easeInOutQuad",type="String")]
    Step Behaviour end
    DataProviderstart
    public function get DataProvider() : Object {
    return DataProvider;
    public function set DataProvider(value : Object) : void {
    DataProvider = value;
    myPropInit.StepBehaviour = true;
    [Inspectable(name="DataProvider",defaultValue="",type="Collection")]
    DataProvider end
    >> end get set INSPECTABLES
    private function init() : void {
    myModel .handleData();
    public override function toString() : String {
    return super.toString();
    [/as]
    bw
    matthias

Maybe you are looking for