wood burning stoves 2.0*
The moose likes Flex and the fly likes having components based on Data Grid's column value. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Flex
Bookmark "having components based on Data Grid Watch "having components based on Data Grid New topic
Author

having components based on Data Grid's column value.

Steven Rodeo
Ranch Hand

Joined: Mar 06, 2008
Posts: 72

I have the following code snippet, here I am able to change the label of the button based on the Data Grid's Column value. I am unable to think of a way where I can add two completely different buttons, based on Data Grid's value. Any help will be greatly appreciated.

_SM



Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

Where do you want to add the two buttons. Can you elaborate further


Ashwin Sridhar
SCJP | SCWCD | OCA
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

I hope you want to implement two different functionalities based on status of iflag.
I such is the case, you neednt have to go in for two different buttons as one could do the job.
Steven Rodeo
Ranch Hand

Joined: Mar 06, 2008
Posts: 72
Basically I have two buttons X and Y, all I want to do is, if the value is true I would like to show ButtonX / if false I want to show ButtonY

Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

I suppose the two buttons you use are the 'check' and 'delete' buttons.
Why don't you use single button with different functionalities for true and false cases.
this approach might be easy to implement i guess
Steven Rodeo
Ranch Hand

Joined: Mar 06, 2008
Posts: 72

I don't know how to do that, I tried but doesn't work for me. I mean the same button with different functionalities
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

You could easily do it by using a if condition. You can use then MouseEvent for the same.



I have written this code according to your code snippet. It Works for me. hope this would be helpful to you
Steven Rodeo
Ranch Hand

Joined: Mar 06, 2008
Posts: 72

Thank you soo much!. that works great.

I have a follow up question, what's wrong with this code ?





Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

what is your issue with this code.
Steven Rodeo
Ranch Hand

Joined: Mar 06, 2008
Posts: 72
Wont' compile
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

You have messed up with Single quotes i guess.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: having components based on Data Grid's column value.