setCurrentState() substitute within the itemRenderer

Well, as advised, I split separated the itemRenderer in a few VGroups, each with an includeIn = "stateName" attribute, in addition, there are a few defined States (im not not using standard names for the States). In the data property of the converter, I use a field of the object provided to decide which State to use, and I put the State using setCurrentState (stateName", false). When running, this will raise an error as soon as I have to refer to a component of a particular State (which must have been defined) because all references are null, so I googled and learned that I need some kind of substitute for setCurrentState() method and perhaps also the getCurrentState method. Don't know what im supposed to put into substitutions.

Any ideas?

Thank you

Forget it, I'm going with itemRendererFunction

Tags: Flex

Similar Questions

  • Flex Mobile: View parent access within the itemrenderer component Variable

    I have several images in a list and I want to display 4 of them both on the screen with a provision in mosaic with the width of each image = 50% of the height and width of screen = 50% screen height.

    I was able to do this with the code below.

    < s:List id = "list1" width = "100%" height = "100%" >

    < s:ArrayCollection >

    < fx:Object id = "img1" img_url = ' assets/1 - 1.png' title = "Image 1" / >

    < fx:Object id = "img2" img_url = "assets/1 - 2.png" title = "Image 2" / >

    < fx:Object id = "img3" img_url = "assets/2 - 1.png" title = "Image 3" / >

    < fx:Object id = "img4" img_url = "assets/2 - 2.png" title = "Image 4" / >

    < / s:ArrayCollection >

    < s:layout >

    < s:TileLayout

    columnAlign = "justifyUsingWidth" horizontalAlign = "center" verticalAlign = "middle".

    paddingBottom = paddingLeft '0' = '0' paddingRight = paddingTop = "0" "0".

    horizontalGap = "0" verticalGap = "0".

    / >

    < / s:layout >

    < s:itemRenderer >

    < fx:Component >

    < s:ItemRenderer >

    "< s:Group width ="160"height ="240">" "

    < s:BitmapImage source = "{data.img_url}" scaleMode = "stretch" smooth = 'true' "

    Width = "100%" height="100%"/ >

    < s:Label text = "{data.title}" left = low "0" = "0" width = "100%" / > "

    < / s:Group >

    < / s:ItemRenderer >

    < / fx:Component >

    < / s:itemRenderer >

    < / s:List >

    However, I don't want to hard code the width and height values.

    I am able to get the screen specify height and width in the event viewAcivate of the view, as shown below.

    protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void

    {

    ScreenWidth = screen.width;

    ScreenHeight = screen.height;

    }

    How to apply these values for width/height of the group properties in the itemrenderer?

    Something like...

    < s:ItemRenderer >

    "< s:Group width ="{ScreenWidth/2}"height ="{ScreenHeight/2}' > ' "

    < s:BitmapImage source = "{data.img_url}" scaleMode = "stretch" smooth = 'true' "

    Width = "100%" height="100%"/ >

    < s:Label text = "{data.title}" left = low "0" = "0" width = "100%" / > "

    < / s:Group >

    < / s:ItemRenderer >

    parentDocument.height

  • How to use methods within the itemRenderer

    Hello

    I have basic itemRenderer as a component:

    < mx:Component id = "ColorRenderer" >
    < mx:Label
    Text = "{rgb2hex (255,100,50)} ' / / this gives error: 1180: call to a method may be undefined rgb2hex"
    / >
    < / mx:Component >

    My method works if I use it with a 'normal' tag < mx:Label = "22" x = "12" text = "{rgb2hex (255,100,50)}" width = "150" / > "
    but it does not work inside the itemRenderer?

    What I'm missing here?

    When you use the tag you define a new variable scope. In this context, the rgb2hex does not exist. You need to qualify: { outerDocument.rgb2hex (255,100,50)}

  • Trainer to date within the ItemRenderer list...

    I am trying to format the date timestamp of a mySQL database that I display within a list in a mobile application. The trainer also works perfectly... However, when I call in the item list converter, no dice... I'm sure it's a syntax error, but I don't seem to be able to understand:

    Here is my IconItemRenderer for the list:

    <s:IconItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:s="library://ns.adobe.com/flex/spark"  labelField="displayLongDTF.format(date)" 
                        messageField="username" iconWidth="32" iconHeight="32" decorator="@Embed('assets/button-help-32x32.png')" >
    </s:IconItemRenderer>
    

    Here's my decleration of rendering engine:

    <s:DateTimeFormatter id="displayLongDTF" dateTimePattern="EEE, MM / dd, yyyy h:mm a"/>
    

    And when I run... It is simply void where the date should be...

    Yes, you need something like this:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    labelFunction = "dateLabelFunction."

    ... >

    private void dateLabelFunction(item:Object):String

    {

    Return someformatter.format (item.date);

    }

    ]]>

  • How to get individual columns within an itemrenderer?

    Hey,.

    I was wondering if it is possible to get the column of a datagrid in an itemrenderer? I have a datagrid with 4 columns. I would use an itemrenderer for each of them. Is it possible within the itemrenderer which gets the individual column for me. For example

    ItemRenderer:

    DataGrid1 = datagrid (parentDocument as file name);

    If (datagrid1. "selectedColumn"(==0) {} "

    doThis();

    }

    If (datagrid1. "selectedColumn"(==1) {} "

    doThat();

    }

    Is something like this?

    Thank you!

    Concerning

    Kat

    If your converter implements the IDropInListItemRenderer, you can figure out the column that you represent by examining the listData property

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Integrated within the DataGrid item renderer.

    Hello

    Please find the page attached with this thread.
    The data are filled in the DataGrid to database using ArrayCollection as a DataProvider collection.

    Now, I want to have the Radio buttons displayed at the begning of the each row of the column names.


    When I tried to use, itemRenderer integrated as mx.controls.RadioButton inside DataGridColumn column "Names" of DataGrid, data appeared so that all the data within the column names is replaced by showing only option button.

    Please tell me if this is possible using integrated point rendering itself? (As custom rendering seems difficult for me rigjt now)

    Or suggest me an easy approach, basically, my requirement is I want to get the selected value in a function object to do the installation Upadate and Delete.

    Help, please


    Thanks in advance.

    DataGrid.jpeg

    Hello

    Try this

    
         
              
         
    
    
  • Cannot access the itemrenderer methods

    Hello guys, I have this custom with an element of rendering components

    <mx:TileList xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mgs="componentes.*">
       <mx:itemRenderer>
       <mx:Component>
          <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" paddingBottom="0" paddingTop="0" width="100%">
             <mx:Script>
                <![CDATA[
                   public function get cyclesValue():uint
                   {
                      return cycles.value;
                   }         
    
                   public function set cyclesValue(repeat:uint):void
                   {
                      cycles.value=repeat;
                   }         
                ]]>
             </mx:Script>
                <mx:VBox width="225" verticalScrollPolicy="off" horizontalScrollPolicy="off">
                   <mx:Label text="Video: {data.nombreVideo}" />
                   <mx:Label text="Sonido: {data.nombreSonido}" />
                </mx:VBox>
                <mx:VBox width="45" height="100%" horizontalAlign="center">
                   <mx:Label text="Repetir"  fontFamily="Verdana" fontSize="10" fontWeight="bold"/>
                   <mx:NumericStepper width="45" minimum="0" value="1" maxChars="2" maximum="99" id="cycles"/>
                </mx:VBox>
          </mx:HBox>
       </mx:Component>
       </mx:itemRenderer>
    </mx:TileList>
    

    Arrises them problem when I want to call the methods within the component, my main actionscript, like this file:

    private function up():void
    {
           var item:IListItemRenderer = playlist.indexToItemRenderer(playlist.selectedIndex);
          item.cyclesValue(item.cyclesValue()+1);
    }
    
    private function down():void
    {
           var item:IListItemRenderer = playlist.indexToItemRenderer(playlist.selectedIndex);
          item.cyclesValue(item.cyclesValue()-1);
    }
    

    This arrises this error

    1061: Call to a possibly undefined method cyclesValue through a reference with static type mx.controls.listClasses:IListItemRenderer

    Any ideas on what I m doing wrong here?

    Thank you very much!

    You use the set for cyclesValue method incorrectly.

    Try:

    item.cyclesValue = miniaturas.getItemAt(playlist.selectedIndex).ciclos;
    
  • data not passed to the ItemRenderer

    Because my itemrenderer is not working properly when scrolling, I wanted to use ' override public function set data(value:Object):void "so he can show the appropriate image. But I found that it is not called. So I tried a track on data.removable (I know for sure that this value exists) to the inside of my itemrenderer component and apparently data = null.
    I have no idea why it is not be transmitted. Until now, I just forwarded the data inside the element with the datagrid to a public string within the element.

    Corrected it as follows:

    Main component with datagrid (snippet):

    Component with the itemrenderer (snippet):

    private function checkIfRemovable (): void
    {
    If (removable) / / check if it has helped remove
    {
    This.source = Vars.rooturl + "images/delete.gif";
    this.toolTip = 'delete project ';

    this.addEventListener (MouseEvent.MOUSE_OVER, MousePointers.showHand);
    this.addEventListener (MouseEvent.MOUSE_OUT, MousePointers.clearPointers);
    this.addEventListener (MouseEvent.CLICK, askDeleteProject);
    } else {/ / is not allowed to delete}
    This.source = Vars.rooturl + "images/delete_gray.gif";
    this.toolTip = "Cannot delete"

    this.removeEventListener (MouseEvent.MOUSE_OVER, MousePointers.showHand);
    this.removeEventListener (MouseEvent.MOUSE_OUT, MousePointers.clearPointers);
    this.removeEventListener (MouseEvent.CLICK, askDeleteProject);
    }
    }

    private function onCreationComp (): void
    {
    checkIfRemovable();
    }

    override public function set data(value:Object):void
    {
    Super.Data = value;
    PID = value.ID;
    removable = value. Removable;
    checkIfRemovable();
    }

  • What is a substitute for the migration assistant? I tried in vain for three hours to migrate files from a macbook pro to each other so that even if connected with the ethernet cable the computers never see each other.

    What is a substitute for the migration assistant? I tried in vain for three hours to migrate files from a macbook pro to each other so that even if connected with the ethernet cable the computers never see each other.

    You can connect otherwise?  USB or FireWire or love at first sight?  You can connect both machines and start the one you want to transfer to target disk mode.  If your other machine is up and running with an account on it and you just want to move files, you can simply drag and drop the FRO the machine mounted TDM, or you can use the migration wizard.

    Or, if the other machine still starts and runs, you can start both computers and connect to the same wifi network and share the hard drive like machines on the network.  Access them in the finder on the new machine files and drag-and - drop, or use the wizard migration, on wifi.

  • Free app from Merriam Webster found within the Starbucks App

    Hello, the starbucks in messages app, it is supposed to be an application of Merriam Webster's dictionary for free (value of $3,99 otherwise). By starbucks, this free app is available until May 24, 2016. I have nothing in the messages. I deleted the app off my iphone for a few minutes, turned the phone back, re-installed the app, signed on my account of starbucks in the starbucks app and still nothing. I called the service customer starbucks, and they suggested that contact iTunes or the App Store for resolution. Can anyone help to understand why the dictionary app does not appear within the app from the SB?  Thank you.

    I suggest you contact the support for the app of Starbuck. He is not an apple product.

  • ATL-TAB within the APPLICATION does not work

    I'm a convert from windows and love the mac but Alt - Tab within the application does not work - very annoying. I often have multiple windows in the same application, and if the only way to go is to use 4 fingers Mission control, it's terrible because Mission control lists all windows in a small size and pain to know that you want to go. While with alt - tab, I can quickly cycle or just go to the last which is often I want to go to.

    It is one of the major issues Mac usability for me.

    Any tips? or addons?

    Thank you.

    Cmd -'

    Curiously, this document has the wrong shortcut. Keyboard shortcuts in Mac - Apple Support

    They have to move to the next application window is to go to the previous application window.

  • How to insert as an entry within the formula variable, the total time on the scope window?

    How to insert, as an entry within the formula variable, the window of total time on the scope (i.e. of 20ms/div x 10 div = 200ms)?

    HERE'S A SAMPLE QUESTION:

    FORMULA FOR INTEGRAL ACTION:

    STATISTICS:

    Input variable: DPO4034 (CH1);

    Box: number of samples.

    FORMULA

    Input variable 0: DPO4034 (CH1); alias: x 0

    Input variable 1: 'time window Total out of scope?. " alias: x 1

    Input variable 2: number of samples (CH1); alias: x 2

    Under the operation Configuration: formula

    Y = (x 0 ^ 2) *(x1/x2)

    Output: Data 1 (CH1)

    THEN, WITH THE HELP OF STATISTICS:

    Input signal: data processing 1 (CH1)

    Checkbox: SUM

    Output: CH1 integral Action [has ^ 2s].


  • Read command line arguments to TestStand sequence start, moving within the sequence

    Start a sequence by using a batch file and add command line arguments. Example: "MySequence.seq Arg1.

    Now, within the sequence I want to read this first (and another) argument "Arg1".

    There is a stage in the ActiveX for that, giving a type (object reference) channels, see screenshot.

    Question: How to use this reference to read the argument?

    Honestly I don't think that you are using it correctly.  I think that your application in your UI Manager must handle this.  However, to answer your question:

    According to the TestStand help CommandLineArguments property is of type string.  It comes to aid of TestStand as well:

    Channels
    A collection of strings. You can get a reference to the collection of the ApplicationMgr.CommandLineArguments property, the ExpressionEdit.GetValidEvaluationTypes and ExpressionEdit.SetValidEvaluationTypes methods and the ApplicationMgr.ProcessUserCommandLineArguments event.

    Properties
    Count (read-only)
    Agenda

    Methods
    Add
    Claire
    Insert
    Delete

    Looks like you can use activeX not use Count or properties of the element to retrieve a single argument.

    Hope this helps,

  • Structure of the event within the structure of the case run once

    Hi all

    I am a controller using myRIO and labview where the program compares a value of the probe in a "Preset" and then choose a structure case depending on what type of air supply is required. What can be seen on the picture, for example, is 0 if saturated air supply is necessary.

    The structure of the event is used to send a signal to step to the stepper motors to open the valves (closing is still pretty much in the same way). In any case, the event turns my valves 90 degrees. I read the sensor all a second, however, when the case remains unchanged, the case runs the event again causing my engines running at 90 degrees per second (essentially continuously). What I'm looking for is a way to send the signal to step only once until a new case is selected.

    He is not on the photo, but this is all within the large loop.

    Apologies for any bad/cringeworthy coding, it is literally my first program always using labview. I can post the full VI if you need.

    Any ideas would be very appreciated! Thank you

    Simos wrote:

    crossrulz you have a simple example by chance that uses the feedback node?

    See if that helps

  • deploy programmatically variable shared within the standalone version of RT (cRIO-9014)

    Hello

    I have a question about here to use variables shared single process within the standalone version of RT for the cRIO-9014

    I simplified my request of LV (LV2010) in two to test the use of shared variables.  See the attached file.

    (1) only run on the host PC: testHost
    (2) only works on the cRIO-9014: testRTcRIO

    for both, I packed stand-alone executable and source distribution.

    for testHost,.
    (a). I copied \builds\testcRIO\Host to d:/or-rt/xmlrpcFEU source Distribution...
    (b) I run... \builds\testcRIO\Host.exe
    (c) xmlrpcFEUlog - host.txt is generated.

    for testRTcRIO,.
    (a) .d FileZilla to connect to the target of RT on network, I copied... \builds\testcRIO\Source Distribution\c\ni - rt\xmlrpcFEU

    to/or-rt/xmlrpcFEU on the target of RT
    (b) I copied also... \builds\testcRIO\Real-Time Application\c\ni - rt\startup to/or-rt/startup on the target of RT
    (c) Max, I restarted the cRIO-9014.
    (d) xmlrpcFEUlog - RT.txt is generated.

    We see that the shared variable does not work inside the RT target. but worked well on PC. the deployment programmatically method does not work.  any suggestion?

    Another thing is:
    can I use telnet for the RT 9014 target and start the RT app directly? What is the command inside the terminal telnet RT?

    Currently, I can telnet into the cRIO-9014, but, what I can do with it?

    ================
    220-national Instruments FTP
    220 service Ready

    530 journal please with USER and PASS
    USER
    331 user name okay, need password
    PASS
    230 user logged
    Help
    211 - USER PASS ACCT STRU TYPE
    211-MODE CWD XCWD PWD XPWD
    211 CDUP XCUP PASV, RETR, REST
    211-PORT LIST NLST QUIT SYSTEM
    211 STAT HELP NOOP STOR, APPE
    211 STOU HELLO MKD XMKD RMD
    211 XRMD DELE, RNFR TRAVEL SIZE
    211 MDTM
    ===========================

    Concerning

    Xiaofeng


Maybe you are looking for