Set Spark TabBar ItemRenderer State

I have a custom ItemRenderer for a tabBar and I need to be able to control the state of each itemRenderer on the tabBar individually. For example, if a change is made to the data in one of the tabs, I want to change the display of the tab to the "unsaved" state, so that a user has a visual cue when there are usaved edits.
<?xml version="1.0" encoding="utf-8"?><s:ItemRenderer  xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s="
library://ns.adobe.com/flex/spark"xmlns:mx="
library://ns.adobe.com/flex/mx"top="
2" width="200" height="34" autoDrawBackground="false" buttonMode="true">
 <s:states>  
<s:State name="normal"/>  
<s:State name="selected"/>  
<s:State name="hovered"/>  
<s:State name="unsaved"/>
 </s:states> 
<!-- background --> 
<s:Rect left="1" right="1" top="1" bottom="0" radiusX="5" radiusY="5">  
<s:fill>  
<s:LinearGradient rotation="90">  
<s:GradientEntry color="0xffffff"/>  
<s:GradientEntry color="0xd8d8d8" alpha="0.85" color.selected="0xf76a6a" alpha.selected="1.0" color.hovered="0x929496" alpha.hovered="0.85"/>  
</s:LinearGradient>  
</s:fill>  
</s:Rect> 
<!-- border rectangle --> 
<s:Line left="0" right="0" top="1">  
<s:stroke>  
<s:SolidColorStroke weight="1" alpha="1.0" color="0x999999"/>  
</s:stroke>  
</s:Line> 
<s:Line left="0" bottom="0" top="1">  
<s:stroke>  
<s:SolidColorStroke weight="1" alpha="1.0" color="0x999999"/>  
</s:stroke>  
</s:Line> 
<s:Line right="0" bottom="0" top="1">  
<s:stroke>  
<s:SolidColorStroke weight="1" alpha="1.0" color="0x999999"/>  
</s:stroke>  
</s:Line> 
<s:Line left="0" right="0" bottom="0">  
<s:stroke>  
<s:SolidColorStroke weight="1" alpha="1.0" color="0x999999" alpha.selected="0.0" color.selected="0xffffff"/>  
</s:stroke>  
</s:Line> 
<s:Label left="4" right="20" fontSize="14" text="{data.LastName}, {data.FirstName}"verticalCenter="
0"/>
 <s:Label id="closePtX" right="5" top="5" fontSize="14" fontWeight="bold" text="x"/></s:ItemRenderer>

hi,
With state transitions a lot of the smarts are already built in, when fading for instance the transition knows when to fade in or fade out, getting your components placed in the states you want is all that is needed.
This is a simple example but as you can see there is virtually no code involved..
http://gumbo.flashhub.net/cyber/  source included
David.

Similar Messages

  • Extending a component which already extends a spark list ItemRenderer

    Hello everyone,
    I have the following situation: Im displaying lists of very similar data objects (they extend the same parent) so in order to avoid a lot of changes to many itemrenderers (if i need to change something in the common properties) when displaying this data, i defined a spark list ItemRenderer (in MXML) which displays the common properties (file called BaseRenderer.mxml):
    <s:ItemRenderer>
         //in the script section i override the set data property
         //some MXML labels, checkboxes, etc
    </s:ItemRenderer>
    Then i created a specific itemrenderer which extended it (file SpecificRenderer.mxml):
    <model:BaseRenderer>
         //again i override the set data property
         //some ADITIONAL MXML labels, checkboxes, etc
    </model:BaseRenderer>
    When i run the app, and when the specific renderer is used, it works (no errors are thrown) , but it only shows the content of specific renderer, nothing from base renderer is visible. Is this the right way to do this, or do i have to override some additional stuff in my specific renderers?
    Thank you.
    One more thing, i just noticed, if i remove all MXML tags from specific renderer, the content from base renderer becomes visible, seems as if specific content overrides base content. Is there a way to add mxml tags into the specificrenderer?

    Yes i suspected them to be merged, and you gave me a great idea. As you say this behavior is true across all mxml defined components, not just itemrenderers. I want to avoid actionscript renderers because i dont (and wont) have any performance issues anyway and i like flexibility in design view, so instead i found another solution which i slightly modified. Some spark components inherit property mxmlContent, which you can override. This is what i came up with in the end: I added the property override into specific renderer and everything is shown as expected (because base elements are merged with the ones from extended component).
    override public function set mxmlContent(value:Array):void {
                                            var adding:Boolean = true;
                                            var index:int = 0;
                                            while (adding) {
        var element:IVisualElement = null;
        try {          element = super.getElementAt(index); } catch(e:Error) {          }
        if ( element != null )  {
           value.push(element);
           index += 1;
        else
          adding = false;
                                            value.reverse();
                                            super.mxmlContent = value;

  • How to add a dummy row in the result set of a SELECT statement.

    Hello Everyone -
    I have requirment to add a dummy row in the result set of a SELECT statement.
    For e.g. lets say there is a table Payment having following colums:
    Payment_id number
    status varchar2(10)
    amount number
    payment_date date
    so here is the data :-
    Payment_id Status Amount payment_date
    1 Applied 100 12/07/2008
    2 Reversed 200 01/ 06/2009
    3 Applied 300 01/ 07/2009
    Here is my SQL
    Select * form payment where payment_date >= 01/01/2009
    Output will be
    2 Reversed 200 01/ 06/2009
    3 Applied 300 01/ 07/2009
    My desired output is below
    2 Reversed 200 01/ 06/2009
    3 Applied 300 01/ 07/2009
    2 Reversed -200 01/ 06/2009 ------(Dummy Row)
    Thrid row here is the dummy row which I want to add when status is "Reversed"
    I would be very thankful for any kind of help in this regard ...
    Thanks,
    Gaurav

    Cartesion joining against a dummy table is a useful method of creating a dummy row:
    with my_tab as (select 1 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
                    select 1 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 1 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/05/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 4 Payment_id, 'Reversed' Status, -400 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 5 Payment_id, 'Applied' Status, 500 Amount, to_date('01/07/2009', 'mm/dd/yyyy') payment_date from dual),
                    --- end of mimicking your table
          dummy as (select 'Reversed' col1, 1 rn from dual union all
                    select 'Reversed' col1, 2 rn from dual)
    select mt.cust_id,
           mt.payment_id,
           mt.status,
           decode(dummy.rn, 2, -1*mt.amount, mt.amount) amount,
           mt.payment_date
    from   my_tab mt,
           dummy
    where  mt.status = dummy.col1 (+)
    order by mt.cust_id, mt.payment_id, dummy.rn nulls first;
    CUST_ID     PAYMENT_ID     STATUS     AMOUNT     PAYMENT_DATE
    1     1     Applied     100     07/12/2008
    1     2     Reversed     200     06/01/2009
    1     2     Reversed     -200     06/01/2009
    1     3     Applied     300     06/01/2009
    2     1     Applied     100     07/12/2008
    2     2     Reversed     200     05/01/2009
    2     2     Reversed     -200     05/01/2009
    2     3     Applied     300     06/01/2009
    2     4     Reversed     -400     06/01/2009
    2     4     Reversed     400     06/01/2009
    2     5     Applied     500     07/01/2009Edited by: Boneist on 07-Jan-2009 23:10
    NB. You may have to mess around with the ordering if that's not come back in the order you wanted. You didn't mention what the rules were for any expected ordering though, so I've made up my own *{;-)
    Also, I added an identifier (cust_id) to differentiate between different sets of payments, since that's usually the case. Remove that if it's not applicable for your case.

  • Weblogic generated finder method not setting parameters in prepared statement

    Hi,
    I am using weblogic 6.1 sp2 and have a CMP bean with a finder defined as follows:
    <query>
    <query-method>
    <method-name>findByPcPayclass</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql>SELECT DISTINCT OBJECT(p) FROM Payments p, PaymentType
    t WHERE p.paymentType.pcPayClass = '?1'</ejb-ql>
    </query>
    The weblogic generated code follwos:
    public java.util.Collection ejbFindByPcPayclass(java.lang.String param0) throws
    javax.ejb.FinderException
    if(__WL_verbose) {
    Debug.say("called findByPcPayclass");
    java.sql.Connection __WL_con = null;
    java.sql.PreparedStatement __WL_stmt = null;
    java.sql.ResultSet __WL_rs = null;
    __WL_pm.flushModifiedBeans();
    try {
    __WL_con = __WL_pm.getConnection();
    } catch (java.lang.Exception e) {
    __WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
    throw new javax.ejb.FinderException("Couldn't get connection: " + EOL +
    e.toString() + EOL +
    RDBMSUtils.throwable2StackTrace(e));
    try {
    java.lang.String __WL_query = "SELECT WL0.DEPOSIT_UID, WL0.GLA_ID, WL0.MARKET_CODE,
    WL0.ORIGINAL_PAYMENT_ID, WL0.PAYMENT_ACCT_NUMBER, WL0.PAYMENT_ACK, WL0.PAYMENT_AMOUNT,
    WL0.PAYMENT_CARD_CHECK_NUM, WL0.PAYMENT_CARE_SITE, WL0.PAYMENT_CUST_NAME, WL0.PAYMENT_DESIGNATOR,
    WL0.PAYMENT_EFFECTIVE_DATE, WL0.PAYMENT_ID, WL0.PAYMENT_INV_ID, WL0.PAYMENT_MOBILE_NUMBER,
    WL0.PAYMENT_SPLIT, WL0.PC_PAYCLASS, WL0.PT_UID, WL0.TT_UID FROM payment_type
    WL2, payment_type WL1, payments WL0 WHERE (WL2.PC_PAYCLASS = '?1') AND WL0.PT_UID
    = WL2.PT_UID " + __WL_pm.selectForUpdate();
    if(__WL_verbose) {
    Debug.say("Finder produced statement string " + __WL_query);
    __WL_stmt = __WL_con.prepareStatement(__WL_query);
    // preparedStatementParamIndex reset.
    __WL_rs = __WL_stmt.executeQuery();
    } catch (java.lang.Exception e) {
    __WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
    throw new javax.ejb.FinderException(
    "Exception in findByPcPayclass while preparing or executing " +
    "statement: '" + __WL_stmt + "'" + EOL +
    e.toString() + EOL +
    RDBMSUtils.throwable2StackTrace(e));
    The parameter is never set in the prepared statement before it executes. This
    causes the finder to return an empty result set. Is this a bug or is there some
    configuration that I missed. I am using ant 1.5 to do the ejbc. the ant target
    follows:
    <target name="ccas.ejbc" depends="ccas.compile, ccas.stage, dd.combine">
    <ejbjar srcdir="${buildClasses}/"
    descriptordir="${buildOutput}/ear_dd"
    basejarname="CCAS"
    flatdestdir="true"
    dependency="full">
    <support dir="${buildClasses}">
    <include name="CCAS/**/*.class"/>
    </support>
    <weblogic destdir="${ear.stage.dir}"
    rebuild="false"
    keepgenerated="true"
    jvmdebuglevel="16">
    <classpath refid="classpath"/>
    <wlclasspath refid="classpath"/>
    </weblogic>
    <include name="ejb-jar.xml"/>
    <exclude name="**/*-weblogic*.xml"/>
    </ejbjar>
    </target>

    replace '?1' with ?1
    "Eugene Stephens" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi,
    I am using weblogic 6.1 sp2 and have a CMP bean with a finder defined asfollows:
    <query>
    <query-method>
    <method-name>findByPcPayclass</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql>SELECT DISTINCT OBJECT(p) FROM Payments p,PaymentType
    t WHERE p.paymentType.pcPayClass = '?1'</ejb-ql>
    </query>
    The weblogic generated code follwos:
    public java.util.Collection ejbFindByPcPayclass(java.lang.String param0)throws
    javax.ejb.FinderException
    if(__WL_verbose) {
    Debug.say("called findByPcPayclass");
    java.sql.Connection __WL_con = null;
    java.sql.PreparedStatement __WL_stmt = null;
    java.sql.ResultSet __WL_rs = null;
    __WL_pm.flushModifiedBeans();
    try {
    __WL_con = __WL_pm.getConnection();
    } catch (java.lang.Exception e) {
    __WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
    throw new javax.ejb.FinderException("Couldn't get connection: " +EOL +
    e.toString() + EOL +
    RDBMSUtils.throwable2StackTrace(e));
    try {
    java.lang.String __WL_query = "SELECT WL0.DEPOSIT_UID, WL0.GLA_ID,WL0.MARKET_CODE,
    WL0.ORIGINAL_PAYMENT_ID, WL0.PAYMENT_ACCT_NUMBER, WL0.PAYMENT_ACK,WL0.PAYMENT_AMOUNT,
    WL0.PAYMENT_CARD_CHECK_NUM, WL0.PAYMENT_CARE_SITE, WL0.PAYMENT_CUST_NAME,WL0.PAYMENT_DESIGNATOR,
    WL0.PAYMENT_EFFECTIVE_DATE, WL0.PAYMENT_ID, WL0.PAYMENT_INV_ID,WL0.PAYMENT_MOBILE_NUMBER,
    WL0.PAYMENT_SPLIT, WL0.PC_PAYCLASS, WL0.PT_UID, WL0.TT_UID FROMpayment_type
    WL2, payment_type WL1, payments WL0 WHERE (WL2.PC_PAYCLASS = '?1') ANDWL0.PT_UID
    = WL2.PT_UID " + __WL_pm.selectForUpdate();
    if(__WL_verbose) {
    Debug.say("Finder produced statement string " + __WL_query);
    __WL_stmt = __WL_con.prepareStatement(__WL_query);
    // preparedStatementParamIndex reset.
    __WL_rs = __WL_stmt.executeQuery();
    } catch (java.lang.Exception e) {
    __WL_pm.releaseResources(__WL_con, __WL_stmt, __WL_rs);
    throw new javax.ejb.FinderException(
    "Exception in findByPcPayclass while preparing or executing " +
    "statement: '" + __WL_stmt + "'" + EOL +
    e.toString() + EOL +
    RDBMSUtils.throwable2StackTrace(e));
    The parameter is never set in the prepared statement before it executes.This
    causes the finder to return an empty result set. Is this a bug or is theresome
    configuration that I missed. I am using ant 1.5 to do the ejbc. the anttarget
    follows:
    <target name="ccas.ejbc" depends="ccas.compile, ccas.stage,dd.combine">
    <ejbjar srcdir="${buildClasses}/"
    descriptordir="${buildOutput}/ear_dd"
    basejarname="CCAS"
    flatdestdir="true"
    dependency="full">
    <support dir="${buildClasses}">
    <include name="CCAS/**/*.class"/>
    </support>
    <weblogic destdir="${ear.stage.dir}"
    rebuild="false"
    keepgenerated="true"
    jvmdebuglevel="16">
    <classpath refid="classpath"/>
    <wlclasspath refid="classpath"/>
    </weblogic>
    <include name="ejb-jar.xml"/>
    <exclude name="**/*-weblogic*.xml"/>
    </ejbjar>
    </target>

  • My ipad has a password that I can't remember and it's not connected to the internet, so my computer won't recognize it and I know that when all get this figured out that it will be set back to factory state but how do I get it there

    My ipad has a password that I can't remember and it's not connected to the internet, so my computer won't recognize it and I know that when all get this figured out that it will be set back to factory state but how do I get it there

    If you've forgotten the passcode to unlock your iPad then there are instructions on this page for how to reset the iPad (your iPad doesn't need to be connected to the internet) : http://support.apple.com/kb/HT1212
    If your computer's iTunes isnt recognising the iPad when you connect it then have you got a recent version of iTunes installed on your computer ? There are also troubleshooting pages for a device not showing in iTunes on these pages :
    PC : http://support.apple.com/kb/TS1538
    Mac : http://support.apple.com/kb/TS1591

  • Help with doing SELECT sub query within the SET of an UPDATE statement

    After doing some research, it appears as if it's possible to use a SELECT subquery in the SET of an UPDATE statement.  i did find some examples and here is my code, however when I click the "check" button it's saying the field (my entire select subquery) is unknown and neither in one of the specified tables or defined by a "DATA".  Do I have a syntax issue or is there another reason why it's not taking this as a valid statement?  Thanks for the help!
    LOOP AT IT_DATA
    UPDATE /BIC/AZDP_O0140
       SET /BIC/ZCOUNTER = (SELECT COUNT( DISTINCT MATERIAL )
                            FROM /BIC/AZDP_O0140
                            WHERE MATERIAL EQ IT_DATA-MATERIAL
                            GROUP BY MATERIAL).
    ENDLOOP.

    my Update does indeed have a WHERE clause but because of the issue i'm having, all my criteria in my WHERE is black text in the ABAP editor.  The editor doesn't even recognize the keywords "WHERE" or "EQ".  Below is my entire statement which contains all WHERE criteria in both the Update and the Subquery, i've just removed it for testing to help simplify the query and eliminate as many other factors as posisble that may be causing problems:
    LOOP AT IT_DATA.
       UPDATE /BIC/AZDP_O0140
       SET /BIC/ZCOUNTER = (SELECT COUNT( DISTINCT MATERIAL ) FROM /BIC/AZDP_O0140
       WHERE WHSE_NUM EQ IT_DATA-WAREHOUSE
        AND  PLANT EQ IT_DATA-PLANT
        AND  /BIC/ZTRAN_NO EQ IT_DATA-TRANS_NUM
        AND  DELIV_NUMB EQ IT_DATA-DELIVERY
        AND  MATERIAL EQ IT_DATA-MATERIAL
        GROUP BY MATERIAL)
       WHERE WHSE_NUM EQ IT_DATA-WAREHOUSE
        AND  PLANT EQ IT_DATA-PLANT
        AND  /BIC/ZTRAN_NO EQ IT_DATA-TRANS_NUM
        AND  DELIV_NUMB EQ IT_DATA-DELIVERY
        AND  MATERIAL EQ IT_DATA-MATERIAL.
    ENDLOOP.
    i should also mention the sources i found were not within the SAP Library but instead on other third-party ABAP websites.  so because i was having issues i wanted to post here to see if anyone else has come up with a working solution.  but if this cannot be done i can likely come up with a solution for my needs using multiple internal tables, this would just have been much easier since i can get a query like this to do what i want in SQL Server.  Thought i could utilize this in ABAP as well.

  • Database Control - Dynamically setting the @jc.sql statement 'attribute' ?

    Hi,
    I have a JCX file that extends a database control. I wan't to be able to set the
    @jc.sql statement 'attribute' value dynamically. There does not seem to be a setProperty()
    api in the
    DatabaseControl (interface) like there is in some other types of control (e.g.,
    FileControl).
    The code extract below sets the value statically, however I wan't to be able to
    set this for the method dynamically (say at runtime) and not necessary at design
    time...
    I would really appreciate, if someone knows any way that this is possible ...
    Thanks very much,
    Vishwa
    CODE EXTRACT >>>>>>..public interface PointBaseCustomersControl extends DatabaseControl, com.bea.control.ControlExtension
    // Sample database function. Uncomment to use
    // static public class Customer
    // public int id;
    // public String name;
    // * @jc:sql statement="SELECT ID, NAME FROM CUSTOMERS WHERE ID = {id}"
    // Customer findCustomer(int id);
    // Add "throws SQLException" to request that SQLExeptions be thrown on errors.
    static final long serialVersionUID = 1L;
    * @jc:sql statement="SELECT * FROM CUSTOMER"
    PointBaseCustomersDocument getCustomers();

    Hello again,
    I need some help. I recreated the SQL Inserts with VS 2005
    and am not doing something right. I got this from MSDN on how to
    insert records using the SQLdataSource Control. Here's what I got,
    but I get an exception error Message: ORA-01036: illegal variable
    name/number. I know this is an Adobe forum, but this is a basic
    ASP.NET question. I'm queying WMI to retrieve computer information
    that I send to the TextBoxes. Any help would be appreciated.
    protected void bnSubmit_click(object sender, EventArgs e)
    SqlDataSource1.Insert();
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:CAT %>"
    ProviderName="<%$ ConnectionStrings:CAT.ProviderName
    %>" SelectCommand='SELECT * FROM "HARDWARE"'
    InsertCommand="INSERT INTO HARDWARE(SERVICE_TAG, MANUFACTURER,
    MODEL, OS, SERVICE_PACK, PROC, RAM, HDD, LAN, LAN_MAC, WIFI,
    WIFI_MAC, HDD_SIZE) VALUES
    (@SERVICE_TAG,@MANUFACTURER,@MODEL,@OS,@SERVICE_PACK,@PROC,@RAM,@HDD,@LAN,@LAN_MAC,@WIFI, @WIFI_MAC,@HDD_SIZE)">
    <insertparameters>
    <asp:formparameter name="SERVICE_TAG" formfield="txtSt"
    Type="String" />
    <asp:formparameter name="MANUFACTURER" formfield="txtMf"
    Type="String" />
    <asp:formparameter name="MODEL" formfield="txtMd"
    Type="String" />
    <asp:formparameter name="OS" formfield="txtOs"
    Type="String"/>
    <asp:formparameter name="SERVICE_PACK" formfield="txtSp"
    Type="String" />
    <asp:formparameter name="PROC" formfield="txtProc"
    Type="String"/>
    <asp:formparameter name="RAM" formfield="txtMem"
    Type="String"/>
    <asp:formparameter name="HDD" formfield="txtHdd"
    Type="String"/>
    <asp:formparameter name="LAN" formfield="txtLan"
    Type="String"/>
    <asp:formparameter name="LAN_MAC" formfield="txtLmac"
    Type="String"/>
    <asp:formparameter name="WIFI" formfield="txtWlan"
    Type="String"/>
    <asp:formparameter name="WIFI_MAC" formfield="txtLmac"
    Type="String"/>
    <asp:formparameter name="HDD_SIZE" formfield="txtHds"
    Type="String"/>
    </insertparameters>
    </asp:SqlDataSource>

  • [svn:fx-trunk] 15267: Cannot set Spark Label or Spark RichText showTruncationTip property at runtime using bindngs or ActionScript .

    Revision: 15267
    Revision: 15267
    Author:   [email protected]
    Date:     2010-04-07 15:57:04 -0700 (Wed, 07 Apr 2010)
    Log Message:
    Cannot set Spark Label or Spark RichText showTruncationTip property at runtime using bindngs or ActionScript.
    QE notes:
    Doc notes: None
    Bugs: partial fix for SDK-25980
    Reviewed By: Gordon
    Tests run: checkintests
    Fix Label styles baselineShift and typographicCase so they work as documented.  The documentation is from TLF.
    QE notes:
    Doc notes: None
    Bugs: partial fix for SDK-25169, SDK-25210
    Reviewed By: Gordon
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-25980
        http://bugs.adobe.com/jira/browse/SDK-25169
        http://bugs.adobe.com/jira/browse/SDK-25210
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Label.as

    I'd have to see the xml to say what, but 1009 is what it says - a null reference has no properties, it is null.
    Try tracing out SampleWebServiceCS.GetMember and you'll quickly see where along your .element.element path you have an error.
    (BTW, I've not used s:Operation before, but is your syntax correct?)
    G

  • Load speed: FLEX MX:TABNAVIGATOR LOAD SPEED VERSUS SPARK:TABBAR

    TODAY I NOTICED A LARGE DIFFERENCE BETWEEN
    THE OLDER MX:TABNAVIGATOR
    AND NEWER S:TABBAR (SPARK)
    Summary:
    My test application was built in flex builder 4 and I was using my localhost (asp.net devlepment enviroment) for testing.
    Tests I built:
    I built many proofs for concept using flex objects, ui  and data handlers.
    HOW WAS THIS TEST (which I spoke about in the title) CREATED:
    I built two components which will be used as CHILDREN to the main application.  The fist child component used the SPARK TABBAR and the other child component used the MX:TABNAVIGATOR.  The main application declared these children (using action script) initially and a List control actually loaded the children into the main application.
    BOTH CHILD COMPPONENTS had 10 tabs....
    5 of the 10 tabs contained "grand" child components (none of the components(main application/children/grandchildren) worked with external data)
    RESULTS:
    THE LOAD SPEED BETWEEN THE TWO CONTROLS was very noticable between the two controls.
    THE SPARK COMPONENT (S:tabbar) AVERAGED 3-5 SECONDS TO LOAD
    WHERE THE MX:TABNAVIGATOR ONLY TOOK 1-2 SECONDS
    HAS ANYBODY ELSE EXPERIENCED THE SAME RESULTS?
    THANKS,
    DOUG LUBY OF LOUISIANA
    WWW.douglubey.com
    SEARCH:  FLEX MX:TABNAVIGATOR LOAD SPEED VERSUS SPARK:TABBAR

    It definately seems to fit (pretty good).
    My labels in the "TABS" were of different length.
    So I converted them all to be the same length.
    <s:TabBar dataProvider="{viewstackSampleB}" id="sampleBMainTabBar"left="
    11" top="8" right="11" height="34" fontSize="6"/>
    <mx:ViewStack id="viewstackSampleB" cornerRadius="20" top="40" bottom="10" left="10" right="10">
    <s:NavigatorContent label="Profile___________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="0" right="0" bottom="0" backgroundColor="#000080">
    <sample:SampleB_Profile id="studentProfile" left="2" top="2" right="2" bottom="2"/>
    </s:NavigatorContent>
    </s:NavigatorContent>
    <s:NavigatorContent label="SampleB_DragNDrop1________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="0" right="0" bottom="0" backgroundColor="#000080">
    <sample:SampleB_DragNDrop1 id="studentDragNDrop1" left="2" top="2" right="2" bottom="2"/>
    </s:NavigatorContent>  
    </s:NavigatorContent>
    <s:NavigatorContent label="SampleB_DragNDrop2________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    <sample:SampleB_DragNDrop2 id="studentDragNDrop2" left="2" top="2" right="2" bottom="2"/>
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    <s:NavigatorContent label="SampleB_PullDataFromParent" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    <sample:SampleB_PullingDataParent id="studentPullingDataParent" left="2" top="2" right="2" bottom="2"/>
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    <s:NavigatorContent label="Tab Five__________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    <s:NavigatorContent label="Tab Six___________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    <s:NavigatorContent label="Tab Seven_________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab Eight_________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab Nine__________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>
    <s:NavigatorContent label="Tab Ten___________________" width="100%" height="100%">
    <s:NavigatorContent left="0" top="-3" right="0" bottom="0" backgroundColor="#AEAEAE">
    </s:NavigatorContent>  
    </s:NavigatorContent>  
    </mx:ViewStack>
    THIS APPEARS TO HAVE THE SAME LOAD TIME as the TabNavigator.
    So I have to ask:
    What is a permanent fix for this.
    Where I can I update my current "Build" for FLEX 4
    so my application does not retain this bug.
    OR ANOTHER QUESTION...what can I exclude in my declarations to fix this bug.
    I would prefer to use the Spark TabBar over the mx:tabnavigator
    MY CURRENT "BUILD" is 4.0.1.277662

  • Place spark TabBar on Bottom of ViewStacks (+ rounded corners pointing downwards)

    Why is it so hard to do such a simple thing... I figure also it must be a very common thing.
    <s:VGroup horizontalAlign="center" horizontalCenter="0" verticalCenter="0" gap="0">
        <mx:ViewStack id="view" width="450" height="300" />
        <!-- NavigatorContent dynamically gets added to view on appComplete-->
        <s:TabBar dataProvider="{view}" skinClass="skins.CustomSparkTabBarSkin" />
    </s:VGroup>
    The Custom Skin:
    <s:Skin
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:fb="http://ns.adobe.com/flashbuilder/2009"    
    alpha.disabled="0.5"><fx:Metadata>
        <![CDATA[
        [HostComponent("spark.components.TabBar")]
        ]]>
    </fx:Metadata>
    <fx:Script  fb:purpose="styling" >
        <![CDATA[
        import mx.core.UIComponent;
        /**  Push the cornerRadius style to the item renderers.*/
        override protected function updateDisplayList(unscaledWidth:Number, unscaleHeight:Number):void {
            const numElements:int = dataGroup.numElements;
            const cornerRadius:int = hostComponent.getStyle("cornerRadius");
            for (var i:int = 0; i < numElements; i++) {
                var elt:UIComponent = dataGroup.getElementAt(i) as UIComponent;
                if (elt)
                    elt.setStyle("cornerRadius", cornerRadius);
            super.updateDisplayList(unscaledWidth, unscaledHeight);
        ]]>           
    </fx:Script>
    <s:states>
        <s:State name="normal" />
        <s:State name="disabled" />
    </s:states>
    <!--- @copy spark.components.SkinnableDataContainer#dataGroup -->
    <s:DataGroup id="dataGroup" width="100%" height="100%">
    Comes out with this component:
    I would like to place that TabBar at the Bottom of the viewstack, rounded corners pointing outwardly.
    if I add rotation="180" to the TabBar <s:TabBar dataProvider="{view}" skinClass="skins.CustomSparkTabBarSkin" rotation="180"/> will make the matter all the more laughable. I don't understand why is it so hard to create a TabNavigator with the buttons on the bottom?!

    Alright, I solved it by using Flash Catalyst... at least its' a simple way...
    So what I did was, Skinned it in Photoshop, imported it to Catalyst, and did the ncessary (convert to button, and select the label for it) and imported it into Flash Builder 4.
    I added the following component in Main:
    <mx:ViewStack id="view" width="450" height="300"  x="33" y="70"/>
    <s:TabBar id="tabBar" dataProvider="{view}" skinClass="components.CustomSparkTabBarSkin" y="375" x="32"/>
    The component.CustomSparkTabBarSkin
    <s:DataGroup id="dataGroup" width="100%" height="100%">
        <s:layout>
            <s:ButtonBarHorizontalLayout gap="4"/>
        </s:layout>
        <s:itemRenderer>
           <fx:Component>
               <s:ButtonBarButton skinClass="components.TabButton" buttonMode="true"/>
           </fx:Component>
        </s:itemRenderer>
    The components.TabButton (generated by Flash Catalyst)
    <s:Group d:userLabel="Tab Button 1" x="0" y="0">
         <s:BitmapImage smooth="true" source="@Embed('/assets/images/Game Tab Navigator/Buttonec.png')" d:userLabel="Button 99c" x="4" y="0"/>
         <s:RichText alpha="0.95" color="#725b3c" fontFamily="Bebas" fontSize="18" height="20" lineHeight="120%" textAlign="center" d:userLabel="hello" whiteSpaceCollapse="preserve" width="62" x="0" y="24" x.up="0" y.up="14">
              <s:content>
                   <s:p>
                   <s:span>Hello</s:span>
                   <s:span baselineShift="2" fontFamily="Myriad Pro" fontSize="17" fontWeight="bold">¢</s:span>
                   </s:p>
            </s:content>
         </s:RichText>
    </s:Group>
    Now the problem is... When I label my NavigatorContent, and dynamically added to the ViewStack (which is the dataprovider of the TabBar), the TabBar don't show the labels...
    Even though it's hardcoded in the example above to show Hello ... Nothing shows.
    What am I missing?

  • Set textSelectionColor of itemrenderer in my combobox

    Hi all,
    First of all, all apologies if this question were already discussed around. I serached and found nothing. On the web, all that I have found didn't really help.
    I defined an itemRenderer for a combobox
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" styleName="plain" >
         <mx:Style source="styles.css" />
         <mx:Script>
              <![CDATA[
                   private function check():void{
                        if(data.status=='ko'){
                             lbl.styleName='ko';
              ]]>
         </mx:Script>
         <mx:Label id="lbl"
                     text="{data.name}"
                     valueCommit="check()"
         />
    </mx:VBox>
    And then my combobox
    <mx:ComboBox itemRenderer="listItem" labelField="name" />
    I have styles the combobox component like this
    ComboBox
         font-family:"HelveticaNeueLT Pro 57 Cn";
         font-size:12;
         color:#FFFFFF;
         alternatingItemColors: #555555, #383838;
         rollOverColor:#F9B41F;
         selectionColor:#2D2D2D;
         textRollOverColor:white;
         textSelectedColor:#F9B41F;
    Everything is fine to the exception of the textRollOverColor & textSelectedColor properties which are ignored by the itemRenderer.
    So I am looking for a way to do this.
    I was advised to create a custom combobox, so I did
    package custom
         import mx.controls.ComboBox;
         import mx.events.DropdownEvent;
         public class customCombobox extends ComboBox
              private var DD:ComboBox;
              public function customCombobox()
                   //TODO: implement function
                   super();
    But I can't get how to deal with the events (rollOver/selected) so I can style the label of the itemRenderer. I am so stuck for days on that.
    So thanks in advance to anyone who could help exiting this deadend
    Just for info, it needs to be mx only, not spark.
    Loic

    The renderer is responsible for setting the text color using those styles.
    Look in mx.controls.listClasses.ListItemRenderer to see how it does it.

  • Spark List Itemrenderer items outside of List

    I have a spark list and i want some of the items in it to appear out side of the list depending on the users interaction.
    Is there a way to make items of an item renderer appear outsid of the LIst container?
    When i use basic layout on the lsit and explicitly set the x and y, they appear behind the list.
    Thanks.

    Hi jmandawg,
    My ListRenderer.mxml may be what you want as follows,
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer 
    xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="
    library://ns.adobe.com/flex/spark" xmlns:mx="
    library://ns.adobe.com/flex/mx" hide="mOut(
    null)" mouseMove="mOut(event)" mouseOut="mOutValueItem(event)"mouseDownOutside="mOut(event)" creationComplete="inited()"
    autoDrawBackground="
    true">
    <fx:Script>
    <![CDATA[
    import mx.controls.TextInput; 
    import mx.managers.PopUpManager; 
    import mx.utils.StringUtil; 
    import flash.text.TextLineMetrics; 
    public var mouseOnPopup:Boolean = false;  
    public var vi:mx.controls.TextInput; 
    private function inited():void {vi =
    new mx.controls.TextInput();vi.editable=
    false;vi.addEventListener(MouseEvent.MOUSE_OUT, mOut);
    vi.addEventListener(MouseEvent.ROLL_OUT, mOut);
    vi.addEventListener(MouseEvent.MOUSE_OVER, mOverPopup);
    private function mOut(event:MouseEvent):void { 
    if ( vi.isPopUp ) {PopUpManager.removePopUp(vi)
    mouseOnPopup =
    false;}
    private function mOverPopup(event:MouseEvent):void {mouseOnPopup =
    true;}
    private function mOutValueItem(event:MouseEvent):void { 
    if ( vi.isPopUp && !mouseOnPopup) {PopUpManager.removePopUp(vi)
    private function mOver(event:MouseEvent):void { 
    var txt:String = itemValue.texttxt = StringUtil.trim(txt);
    if(txt.length<5) return; 
    if(!vi.isPopUp) {PopUpManager.addPopUp(vi,
    this.parent)vi.text=txt;
    vi.setStyle(
    'fontSize',18); 
    var txtMetrics:TextLineMetrics = vi.measureText(vi.text);vi.width=txtMetrics.width*1.2
    vi.height=itemValue.height*1.4
    var p:Point = itemValue.localToGlobal(new Point(itemValue.x, itemValue.y));vi.x=p.x;
    vi.y=p.y-10;
    ]]>
    </fx:Script>
    <s:TextInput id="itemValue" text="{data.value}" width="200" mouseOver="mOver(event)" mouseOut="mOutValueItem(event)" mouseMove="mOut(event)" editable="false"/> 
    </s:ItemRenderer>
    You may test it with the following in your main.mxml
    Bindable] 
    private var detailAC:ArrayCollection = new ArrayCollection([{value:"nteDevice.device"},{value:
    "nteDevice.deviceTypenteDevice.loopbackIpAddr"},{value:
    "nteDevice.ipAddressnteDevice.loopbackIpAddr"},{value:
    "nteDevice.loopbackIpAddrnteDevice.loopbackIpAddr"}, {value:
    "nteDevice.release"},{value:
    "nteDevice.releasenteDevice.loopbackIpAddr"},{value:
    "nteDevice.clli"},{value:
    "nteDevice.provisionStatus"}]);
     <s:List id="lst" itemRenderer="com.att.ntscp.view.component.ListRenderer" dataProvider="{detailAC}" width="200" height="200"/>
    Is it a little bit trick?
    Jeffrey

  • Change one alternatingRowColor of a spark DataGrid ItemRenderer

    Hi,
    I try to find a way to change the alternatingRowColor of only one spark ItemRenderer. It depends on a property set in an item in the DataProvider and this property can change at the runtime.
    How do to this?
    Thx.

    Do you mean to say depending on item value in data provider it datagrid row color should change?
    If yes then following link can help to solve your issue:
    http://butterfliesandbugs.wordpress.com/2011/02/04/changing-the-background-color-of-a-row- using-itemrendererfunction/
    Thanks and Best regards,
    Pooja Kuber | [email protected] | www.infocepts.com

  • How do i set spark list selected item's color??

    hey guys... so got a little problem... i have a spark list which gets populated from a array collection that looks likda like this
    [0] = "name1"
    [1] = "name 2"
    [2] = "name 3"
    when i click on say "name 1" i  need the color of "name 1" to change to say red...
    and when i click on another item i need that color to stay... red on "name 1"...
    oh and... i need to do the color change in actionscript rather than the mxml file...
    any ideas???

    Hi,
    I'm not sure if this is exactly what you are looking for. What I did was created an itemRender for the list and assigned it like so
    <s:List dataProvider="{ listDataProvider}" itemRenderer="listItemRenderer"/>
    And the listItemRenderer will look some
    //Code Begins
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                              xmlns:s="library://ns.adobe.com/flex/spark"
                              xmlns:mx="library://ns.adobe.com/flex/mx"
                              focusEnabled="true" >
        <fx:Script>
            <![CDATA[
                var clicked:Boolean=true;
                protected function clickHandler(event:MouseEvent):void
                        clicked?labelRender.setStyle("color","0x00FF00"):labelRender.setStyle("color","0xFF0000") ;
                        clicked=!clicked;
            ]]>
        </fx:Script>
        <s:Label  id="labelRender" text="{data}" color="0xFF0000" click="clickHandler(event)"/>
    </s:ItemRenderer>
    //Code Ends
    In the above example the colour toggles on each click. So, you can apply anything. assume you have a property called color in your array collection, you can access it as data.color and then set the text to that color when it is clicked. I hope this helps. Do write back if you have any issues.
    Nishad

  • In a Regular expressions I can set up an "OR" statement?

    HI, I'm using e-tester version 8.2..My problem is about regular expessions.
    I need to catch a dynamic value from a Form Field (My-TxtBox).. this textbox gets pre populated data ( when the customer has info in the database).. this is the code:
    *<input name="My-TxtBox" type="text" value="XXXX" id="ID-TxtBox"*
    ---- ( XXXX = dynamic number prepopulated by the web app)
    So, I'm using this regular expression:
    *<input name="My-TxtBox" type="text" value="(.+?)" id="ID-TxtBox"*
    -----At this point, everything is fine.. but there is an exception
    I'm getting a big problem when the customer doesn't have data in the server, the code is NOT like this
    <input name="My-TxtBox" type="text" value="" id="ID-TxtBox"
    When the customer doesn't have data in the server, the code is more like this:
    *<input name="My-TxtBox" type="text" id="ID-TxtBox"*
    ---- (please note that there is not a value parameter now)
    So, I think there is no way to create a CDV that will work for both cases? any idea to solve this?
    i was thinking that maybe in the reg exps sintax you can create an "OR" statement.. my idea was to create a CDV
    that works for both cases.. when there is the "value=" string and when there is not.
    something like this
    This CDV returns the dynamic value when there is the "value=" string =
    <input name="My-TxtBox" type="text" value="(.+?)" id="ID-TxtBox"
    And this CDV returns "" when there is no "value=" string = Without value:
    <input name="My-TxtBox" type="text" (.*?)id="ID-TxtBox"
    My idea is to place something like this in some point of the CDV = *{* value="(.+?)" *OR* (.*?) *}*
    so my dream is to create a CDV similar to this:
    <input name="My-TxtBox" type="text" { value="(.+?)" *OR* (.*?) }id="ID-TxtBox
    I was searching on google but I simply don't get an answer....it is posible to place an OR statement into a Reg Exp and how the sintax is? ..
    Regards.. I appreciate your time.

    Hola,
    You can use a regular expression such as:
    <input name="My-TxtBox" type="text" ?v?a?l?u?e?=?"?(.*?)"? id="ID-TxtBox"
    Note that:
    * Note that there is a question mark sign (?) after each letter that may appear in the string. This means that the letter may or may not appear.
    * Note that instead of using (.+?) you should use (.*?).
    This means that will match any character that appears zero or mutliple times. The question mark here means that is non-greedy, meaning that it will not include in the .* matching anything like the rest of the pattern (in this case the rest of the pattern is "? id="ID-TxtBox").
    * Note that the question mark in front of the v of value is there to match a space that may or may not exists.
    Few other facts:
    * In regular expressions the parenthesys determine sequence of operations and mark groups. Such groups can be referenced in code (not in etester but in general). In eTester it will always get the value of the first group (first group = first set of parenthesys).
    * ORs in regular expressions can be expressed with the pipe "|" (without the quotes), but you will need parenthesys in this case which would not allow you to capture the group of characters that you want.
    Regards,
    [Z]{1}uriel C?
    Edited by: Zuriel on Oct 5, 2009 3:07 PM
    Edited to avoid having the text changed by the forum formatting options.

Maybe you are looking for

  • Problem with 5.2 install - idsgroup does not exist

    All, I am trying to install Sun ONE Directory Server 5.2 on a new Cluster. The idsuser and idsgroup have been both setup with the id 10000. I have created a silent install file to work with the ./setup -noconsole -nodisplay -state silent.inf command.

  • OIM 9.1.0 installation- Unable to access Admin console

    Hello OIM Gurus, I'm new to OIM. I am trying to setup OIM 9.1.0 one of windows VM. After the installation i'm unable to access to oim admin console using link http://localhost:8080/xlWebApp If I try to access the above URL i get "The requested resour

  • I can no longer change the volume, anyone know why?

    when i use the volume keys nothing happens. its blocked i cant change it in system preference eather i can mute or have the sound at the loudest. can any one tell me how to fix this?

  • Java Document Paragraph Colors

    Hi, I want to change Background color of Styled Document. I am able to change text color through StyleConstants.setForeground(styles, Color,RED); Its changing background color for text. If text ends at middle of line then color applied to half line o

  • Is there any provesion to convert  multiple planned order to one PR

    hi,,      i want to know is there any provesion to convert multiple planned orders to one PR .let it may create as different line item in PR. if is there please let me know thanks in advance regards madan