4 Replies Latest reply on Apr 29, 2009 11:43 AM by Roni.Nair

    How to make itemRenderer editable

    Roni.Nair

      Hi All,

      I have a screen with a tile list and a button above it.

      Tile list has an item renderer, which is a vbox with an image and a text ( Pl see code below)

      I wanted this text to be editable so I used a TextInput with backgroundalpha = 0, so it appears as a label and becomes a textbox when clicked on.


      Now my problem is this - I mentioned I have a button above the Tilelist - when this button is clicked I want the label ( or text) in the slected item of the tilelist to become editable.This is just like how someone would click on a button and make something inplace editable. Hope you got the idea -

      How can I make this happen ?


      Here is my ItemRenderer component -

       

       

      <?xml version="1.0"?>
          <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
              horizontalAlign="center"
              verticalAlign="middle"
              borderStyle="none"
              width="100%"     
          >

       

          <mx:Image id="image" source="@Embed('/assets/embed/community.png')" width="32" height="32"    horizontalAlign="center" />


          <mx:TextInput text="{data.name}" change="textChanged(event);"
              id="labelEditor"
              textAlign="center"
              cornerRadius="0"
              backgroundColor="#FFFFFF"
              borderStyle="none"
              backgroundAlpha="0"
              color="{data.selected ? 0x491D1D : 0x666666}"          
              xmlns:framework="com.cisco.cp.gui.framework.*"
              width="120"
              height="22"      
              toolTip="{data.name}"       
              keyDown="keyUp(event)"              
              fontWeight="{data.selected ? 'bold' : 'normal'}"           
          />
      </mx:VBox>

       

      Thank you very much for your time and help