Datagrid and Labels

I am using this example found here:
http://www.flash-creations.com/notes/servercomm_database.php
I am having problems with labels and a datagrid. When an item is
selected I would like for the Invoice number to appear in the label
box/text box. Using the code below and selectItem/selectIndex how
could I create a label for the Invoice field of the datagrid?
http://img369.imageshack.us/img369/4995/43098014rx0.th.jpg

I tried the following sample and it seems to work.
quote:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical"
creationComplete="populateCanvas()">
<mx:Script>
<![CDATA[
import mx.containers.VBox;
import mx.containers.Canvas;
import mx.printing.FlexPrintJob;
import mx.controls.Button;
var printable:Canvas;
private function populateCanvas():void
printable = new Canvas();
var b1:Button = new Button();
b1.label = "MyButon";
b1.x = 10;
b1.y = 10;
b1.width = 150;
b1.height = 25;
printable.width = 500;
printable.height = 500;
printable.addChild(b1);
//these can be uncommented
//printable.visible = false;
//printable.includeInLayout = false;
addChild(printable);
private function printCanvas():void
var fp:FlexPrintJob = new FlexPrintJob();
if(fp.start())
printable.width = fp.pageWidth;
printable.height = fp.pageHeight;
printable.validateNow();
fp.addObject(printable);
fp.send();
]]>
</mx:Script>
<mx:Button label="Print" click="printCanvas()" />
</mx:Application>

Similar Messages

  • ItemRenderer Issue with DataGrid and Label

    <mx:DataGrid width="100%" height="100%" rowCount="5" dataProvider="{publish_status}">
         <mx:columns>
              <mx:DataGridColumn dataField="status" headerText="Status">
                   <mx:itemRenderer>                        
                        <fx:Component>
                             <mx:Label text="{data.status}" fontSize="12">
                                  <fx:Script>
                                       <![CDATA[
                                       override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                                       super.updateDisplayList(unscaledWidth, unscaledHeight);
                                       if(this.text == "A"){
                                            setStyle("color", "blue");
                                       else if(this.text == "B"){
                                                 setStyle("color", "green");
                                       else if(this.text == "C"){
                                            setStyle("color", "red");
                                       else{
                                            setStyle("color","white");
                                       ]]>
                                  </fx:Script>
                             </mx:Label>                                            
                        </fx:Component>                             
                   </mx:itemRenderer>
              </mx:DataGridColumn>
         </mx:columns>
    </mx:DataGrid>
    I created an inline ItemRenderer as above. I understand that it gets recycled and have included the last "else" statement to return color to default if all tests fail.  The problem is that the text is still showing up in the wrong colors.  I have done a lot of reading on the forums but I can't figure out what I'm missing.
    Thanks.
    Btw, I am using Flash Builder 4.

    Hi ,
    Try changing the color in set data function override method instead of updateDisplayList override.
    override public function set data(value:Object):void
         if(this.text == A){
            setStyle(color, blue);
       else if(this.text == B){
            setStyle(color, green);
       else if(this.text == C){
            setStyle(color, red);
       else{
            setStyle(color,white);
    Thanks,
    Bhasker

  • Rating and labelling images is not working in Photoshop Bridge CS6. The Rating and Label headings in the Label menu are greyed out. Any ideas for correcting this would be appreciated.

    Any suggestions for restoring the Rating and Label options in Photoshop Bridge CS6 would be appreciated.

    Please post Bridge related queries over at
    http://forums.adobe.com/community/bridge
    Maybe it’s permissions issue … what volume are the files on?

  • Printing cards and labels on Photosmart C4580 printer

    I couldn't find my particular problem using the search so I'm hoping for some answers here. I have a Photosmart C4580 printer connected to a Toshiba laptop running Vista with all the current updates. My problem is that I can't seem to get it to print on business card stock or addrress label stock. Here's the issue:
    I use Word to create business cards to print onto business card stock. The instructions that came with the card stock say to do a test page on regular paper first to verify placement, which I do - everything looks perfect so I put a page of card stock in the feeder. The printer grabs the page and prints with the image offset towards the top of the page by about 1/4" so that the top of the card is above the edge of the cards. As the cards are repeated down the page, it shifts down slightly so that by the time it gets to the bottom of the page it's almost on the card, but still overlaps the top edge slightly. Printing onto regular paper works perfectly every time.
    A similar thing happens printing address labels - again using Word to create the labels for either Avery 5267 or Avery 8161 label stock. On regular paper everything looks perfect, but feed a sheet of label stock in and the text is offest toward the top of the page. The last time I needed labels I was able to get it to print properly by printing one label at a time, then refeeding the page and printing the next one, then repeating until each label on the page was printed. When you're printing several pages of labels that takes a lot of time!
    Is there something I need to do to get this printer to print cards and labels?
    Alan Hepburn
    Alan Hepburn
    Proud to be a Blue Star Family

    @ deblois 1089 - I will need a little more information to help out. What are the specifications of the labels? Do you have the measurements and the weight of the paper type? Thanks
    I am a former employee of HP...
    How do I give Kudos?| How do I mark a post as Solved?

  • How to delete a selected row from datagrid and how to create a datagrid popup

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when  i selected a partiuclar row from a datagrid and click delete button  means that record will delete from the datagrid and DTO from the cloud  tables also.
                Ques 2: when i save  the data grid values using save button means that data will store in  respective cloud DTO which is related to the datagrid,
                     My requirement is i am using a search button when i click the search  button it will show a datagrid that datagrid will contain the previous  datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen:           i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen:                search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • How to delete a Selected row from datagrid and how to create a datagrid popup with saved values

    hi friends,
                  I am new to flex.i am doing a flex4 application,i need help for this.
                i am having a data grid with columns.i have two questions.
               Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
                Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
                    My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
    REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
    Second screen: search button ----> it need show  datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
    This is my requirement.
    Any suggession welcome.
    Thanks in advance.
    B.Venkatesan

    Lets break the problem statement in multiple steps
    1. We need a way to know the selection on all rows.
    2. We need the association of the checkBox with the data
    The  solution is to use a arrayCollection/array that holds all the instances  created for checkbox.This collection should be a property of component  containing the datagrid. We need to use a custom component  implementation or inline ItemRenderer. The way you have used is called  dropinItemRenderer. Preferaly use custom component implementation and  add the instance to the arrayCollection at CreationComplete. Make sure  you use addItemAt so that you add the instance in the same row as the  data. To get rowIndex the custom Checkbox should implement  IDropInListItemRenderer. You could iterate this collection to check all  the instances that are checked.
    Note: This is the approach considering your dataprovider doesnt have a selection field.
    Nishant

  • What's the difference between tags and labels?

    What's the difference between message tags and labels?
    Solved!
    Go to Solution.

    Indeed tags are freeform and can be added and created by anyone. Labels follow a stricter hierarchy and are usually defined on the individual community level (e.g. per ideation section, or specific to a discussion board).
    Labels are used as a filter by the community team to more easily look at specific sub-sections of content.
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Report with a break above and labels

    We want to create a Report with a break above and labels. There are examples for each of these, but I do not see an example of both in the same Report. Hopefully this is possible?? What can you tell us?
    Thanks, Wayne

    Thanks for the reply. I have the columns set up just as you have suggested. I even created a new report with form wizard and tried to update those two questionable columns.
    If the columns are null, and I add values, they save. But then when I go back and update the record, but different columns, it nulls out the two I am talking about. I am wondering if a trigger is out there someplace that is causing them to get nulled out.
    Regards,
    Jeff

  • How to keep form field and label together?

    In InDesign Creative Cloud (ID CC), I need to create a 20 page form (a type of questionnaire). As a prelude to doing this, I created a one page form. I am trying to keep labels (text) and fields together, so that if I add a question in the middle of the form, everything else moves down and stays in the correct alignment and relationship. Here is what I tried.
    Option 1: Anchored Fields. I created fields on a "fields" layer and labels on a "text" layer. The text layer generally had tables to help me see where fields should be placed. However, to keep fields and text in the same relationship on the page, I anchored the field to the text. Hoewever, this has the effect of moving the field object into the same layer as the text. When I tried to use the Articles panel to put the fields in correct tab order, I discovered that only fields (unanchored) that were in the forms layer could be dragged into the Articles panel; anchored fields (now in the text layer) could not be dragged into the Articles panel. Why?
    I know that I could also use the Object / Interactive / Set Tabs Order command, but I wanted to use Articles to see how that works.
    In this approach, I also could not figure out how to put underline the text form field
    Option 2: Tabs and Character Styles. I used character styles for underlining by not using tables, but using paragraphs and tabs to align where the fields should be. I applied a character style to a right-justified tab to get the underline. However, using this option, whenever I add a new question (field + label or instruction) in the middle of the form, everything else down on the page goes out of alignment.
    What recommendations do other form designers have? I have been trying to think of how IRS has "dense" or "complex" forms, and how these might be designed in InDesign CC. in order to apply similar techniques to my form design.
    I am running on a Mac, OS X 10.8.4, InDesign CC.

    Unless I am gravely mistaken, isnt this what you want?
    for (int i = 0; i < folderList.size(); i++) {
       String folder = (String) folderList.get(i);
        System.out.println("Folder: " + folder);
        System.out.println ("Messages: " + folderMap.get (folder));
    }

  • How to get datatype and label of columns in a record group

    Hi all,
    I need to create a generic block which displays data of any query. For this, I was thinking at runtime I'll create a recordgroup. For this I was hoping to get the datatypes and label of various columns in the records.
    Please help me in this regard
    Thanks

    Hi everyone,
    Can you please tell me that Is it possible to get the datatype and name of columns of a recordgroup during run-time or not. So that I don't waste my time in searching for this solution. If you are not getting my question then please let me know but I need this help very badly.
    Thanks
    Subodh

  • Issue with setting ratings and labels

    Greetings all. I am having an issue with setting ratings AND labels on image files at the same time. If the script sets the label first then the rating, the label doesn't show in Bridge. If the script sets the rating first then the label, the rating doesn't show in Bridge.
    Is there a workaround for this? Here is my script function for doing this. file=filename minus extension. Rating is a number for the desired rating. lab is a number for the level of Label I wish to set. Everything works great except that I can't set both Rating and Label with the script as shown. In this instance, only the Ratings will show up in Bridge after running the script. If I move the x.label=Label line under the x.rating=Rating line, then the ratings only show for those images with no label (lab=0). Any image that gets a label receives no rating.
    If you're going to test this, you may want to comment out the Collections part. That's the part within the "switch(Number(Rating))" block.
    function setRating(file,Rating,lab) {
        try{
            cr=File(file+"CR2");
            psd=File(file+"psd");
            jpg=File(file+"jpg");
            tif=File(file+"tif");
            switch(lab) {
                case 0: Label = ""; break;
                case 1: Label = "Select"; break;
                case 2: Label = "Second"; break;
                case 3: Label = "Approved"; break;
            if (cr.created) {
                var c=new Thumbnail(cr);
                c.label=Label;
                c.rating=Rating;
                if (psd.created) {
                    p=new Thumbnail(psd);
                    p.label=Label;
                    p.rating=Rating;
                    if (jpg.created) {
                        var j=new Thumbnail(jpg);
                        j.label=Label;
                        j.rating=Rating;
                        Rating=0;
                    else addFile=psd;
                else addFile=cr;
            switch(Number(Rating)){
                case 0 : break; /* No Rating */
                case 1 : if(!app.isCollectionMember(OneStar,new Thumbnail(addFile))) app.addCollectionMember(OneStar,new Thumbnail(addFile)); break;
                case 2 : if(!app.isCollectionMember(TwoStars,new Thumbnail(addFile))) app.addCollectionMember(TwoStars,new Thumbnail(addFile)); break;
                case 3 : if(!app.isCollectionMember(ThreeStars,new Thumbnail(addFile))) app.addCollectionMember(ThreeStars,new Thumbnail(addFile)); break;
                case 4 : if(!app.isCollectionMember(FourStars,new Thumbnail(addFile))) app.addCollectionMember(FourStars,new Thumbnail(addFile)); break;
                case 5 : if(!app.isCollectionMember(FiveStars,new Thumbnail(addFile))) app.addCollectionMember(FiveStars,new Thumbnail(addFile)); break;
                default : break;
        }catch(e){
              alert(e);
              return -1;

    Afew errors to start with, you were not creating a proper file as there wasn't a fullstop in the filename.
    If a CR2 file didn't exist no other file was looked for, you were using "created" and should have been "exists"
    This now labels and rates....
    setRating("/C/Test Area/NEF/z",2,1);
    function setRating(file,Rating,lab) {
        try{
            cr=File(file+".CR2");
            psd=File(file+".psd");
            jpg=File(file+".jpg");
            tif=File(file+".tif");
            switch(Number(lab)) {
                case 0: Label = ""; break;
                case 1: Label = "Select"; break;
                case 2: Label = "Second"; break;
                case 3: Label = "Approved"; break;
            if (cr.exists) {
                var c=new Thumbnail(cr);
                c.label=Label;
                c.rating=Rating;
                if (psd.exists) {
                    p=new Thumbnail(psd);
                    p.label=Label;
                    p.rating=Rating;
                    if (jpg.exists) {
                        var j=new Thumbnail(jpg);
                        j.label=Label;
                        j.rating=Rating;
                        Rating=0;
            switch(Number(Rating)){
                case 0 : break;
                case 1 : if(!app.isCollectionMember(OneStar,new Thumbnail(addFile))) app.addCollectionMember(OneStar,new Thumbnail(addFile)); break;
                case 2 : if(!app.isCollectionMember(TwoStars,new Thumbnail(addFile))) app.addCollectionMember(TwoStars,new Thumbnail(addFile)); break;
                case 3 : if(!app.isCollectionMember(ThreeStars,new Thumbnail(addFile))) app.addCollectionMember(ThreeStars,new Thumbnail(addFile)); break;
                case 4 : if(!app.isCollectionMember(FourStars,new Thumbnail(addFile))) app.addCollectionMember(FourStars,new Thumbnail(addFile)); break;
                case 5 : if(!app.isCollectionMember(FiveStars,new Thumbnail(addFile))) app.addCollectionMember(FiveStars,new Thumbnail(addFile)); break;
                default : break;
        }catch(e){
              alert(e);
              return -1;

  • The Keynote icon is dimmed and labeled as "waiting..." on Home screen

    The Keynote icon is dimmed and labeled as "waiting..." on Home screen. I've tried restart but it still "waiting...". Keynote app not load when I tap its icon too (however I can open .PPT file by Keynote from Safari, using "Open in..."). How can I fix it?
    iPad Air 7.0.4 (no jailbreak)

    A few more suggestions.....
    Have you tried deleting the app by going to Settings>General>Usage>Storage. Tap the arrow next to the app name and then tap Delete App in the next screen?
    Another thing that you can try is to sign out of your account, restart the iPad, then sign in again. Settings>iTunes & App Stores. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button. Go back to Settings>iTunes & App Stores>Apple ID. Sign in again. See if you can resume the download.
    Turn WiFi off in Settings>WiFi>Off. Restart the iPad as described above. Go back to Settings>WiFi>On. See if the download will resume.
    You could also try resetting your router by unplugging it from power for about 30 seconds and then plug it in again. After the router resets, try to resume the download.

  • How can I play Reverse between label A and label B

    hi again~
    I have a symbol,some timaline and labels in it.
    so now I want to play reverse between the Label A and Lable B
    but the action syntax is like
    test1_play.playReverse();
    so how can I play reverse rom LableB to LableA?
    I found this information, I am fresh in edge animate, so I can't figure out the issue.
    anybody help?
    sym.playReverse ( position, executeTriggers )
    position defaults to the current playhead position (which defaults to 0); If play is issued and the playhead is at the end of the timeline, play from the end.
    executeTriggers can be true, false, or null and indicates whether triggers at the starting position are fired:
    true - all triggers at the starting position are fired.
    false - no triggers are fired at the start point.
    null, undefined or omitted - triggers are fired at the starting position only if the timeline is being played for the first time, or if the starting position is different than the current playhead position as returned by getPosition().
    Description: Play the default timeline in reverse from the given position given in milliseconds (if position is a number) or as a label (if position is a string).

    Hi again
    See that thread (you'll find a downloadable example) : http://forums.adobe.com/message/5347434#5347434
    Gil

  • What is "List and Labels"

    Hi,
    I heared like SBO Report Editor is Replaced by "List and Labels".
    what is "List and Labels"  and what are the uses.
    bcoz i am trying to use crystal Reports.
    plz help me asap.
    Regards,
    Anand

    Hi Anand,
    If you look at the www.combit.com website you should be able to find out all the info you need regarding list and labels as its an application from them.
    Regards,
    Adrian

  • How to Create Legend and Label Graph using VBS

    Hi,
    I've scoured the internet before I had to resort to asking my question here. I hope someone can answer my question.
    Using VBS, how can I create a legend of the channels used in the graph and label the axis in the graph? Thanks in advance!
    Solved!
    Go to Solution.

    I've managed to figure out how to create the labels...
    Call GraphObjOpen(D2AxisXObj(1))
    D2AxisXTxt = "@@ChnName(CurrChnNo)@@ [@@ChnDim(CurrChnNo)@@]" ' Defines the x-label
    Call GraphObjClose(D2AxisXObj(1))
     Now to figure out how to create the legend. If anyone can help me, that'd be great.
    ...And now I feel like a downright idiot.
    After more scouring I managed to find what I need
    Call GraphObjOpen("2D-Axis1")
    '------------------- Swith legend on -------------------------------
    D2LEGDRAW =1
    D2LEGTXTTYPE ="Free text" ' "ChannelName" or other keywords
    D2LEGTXTFREE ="My free legend"
    Call GraphObjClose("2D-Axis1")
    'redraw
    Call Picupdate()

Maybe you are looking for