It seems like the license number is not just a button label--it's
actually a part of your model. Perhaps that column should render the
number associated with each user (if any). If there's a number, display
that. If it's NaN (or -1, or whatever invalid number you choose),
display it as a 'Generate' button and on click, update the model with
the number, and update the display of the renderer.


-----Original Message-----
From: Pilby <i...@pilby.us>
Reply-to: flexcoders@yahoogroups.com
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Datagrid question
Date: Mon, 20 Apr 2009 10:59:20 -0700



Thanks for responding, Tracy.

Let's say this is an application that allows generation of license
numbers. Imagine this:

You have 3 columns in the datagrid. The first and second columns are the
first and last names of a person. The third column is a button (which is
really part of an MXML component) that has it's 'label' set as "Click to
generate license number". When the user clicks the button, the logic to
generate the license number is within the component and will be output
to the label property of the button, and the button will no longer be
clickable. The application allows multiple people to be listed in the
datagrid. Outside the datagrid, there is a button that says "Click to
print all".

Given the specs I described so far, it's clear that I have to be able to
iterate through each row in the datagrid, extracting the data from each
column of each row. Typically, I would just get the dataProvider array
collection object, and the problem would be solved. But because the
license number is being output through the label property of the button
(which is part of a MXML component) and is not part of the original
dataProvider data, I can't go that route.

I figured I now have to somehow iterate through each row, grabbing the
data of each column of the row and storing it somehow. Is there a way
for me to get the license number from the label property of the buttons?




Reply via email to