[flexcoders] horizontal scrolling using keyboard

2010-06-03 Thread nhid
Hello,

Does anyone has an idea how to implement horizontal scrolling on a datagrid
using the keyboard?

Thank you...


Re: [flexcoders] Bringing application to front

2009-09-16 Thread nhid
Ian,

No, it's not an AIR application.  I'm using Flexbuilder 3, lifecycle 2.5.
Is there a way to get around to it?

Thanks
nhid

On Tue, Sep 15, 2009 at 6:19 PM, Ian Thomas i...@eirias.net wrote:



 If it's an AIR application, you can use the .orderToFront() method of your
 WindowedApplication.


 http://livedocs.adobe.com/flex/3/langref/mx/core/WindowedApplication.html#orderToFront%28%29

 Ian


 On Tue, Sep 15, 2009 at 10:03 PM, nhid nhi...@gmail.com wrote:



 Hi,

 How should I go about implementing the following case:

 There's a timer on my application which will give an alert to the user 5
 minutes before the session times out.  It's working, but the problem is
 since the alert is a popup window, it appears inside the application and
 when the application is behind another application (browser, etc) or is
 minimized, the user won't see the alert and the applicaiton logs the user
 out because no action was taken.  How can I bring the application to the
 front (to focus) or maximize it so the user will see the alert?

 Any suggestion is appreciated.  Thank you!


  



[flexcoders] Bringing application to front

2009-09-15 Thread nhid
Hi,

How should I go about implementing the following case:

There's a timer on my application which will give an alert to the user 5
minutes before the session times out.  It's working, but the problem is
since the alert is a popup window, it appears inside the application and
when the application is behind another application (browser, etc) or is
minimized, the user won't see the alert and the applicaiton logs the user
out because no action was taken.  How can I bring the application to the
front (to focus) or maximize it so the user will see the alert?

Any suggestion is appreciated.  Thank you!


[flexcoders] Getting session in Flex

2009-06-08 Thread nhid
Hello,

How do I get an HttpSession from Flex to pass to the java backend?

Thank you for your help.


Re: [flexcoders] Re: Validating items in DataGrids

2009-05-14 Thread nhid
Hi

I also need to show the applicable error message to each of the error cell.
So I use a renderer that extends Label since there's a errorString attribute
for label.  However, I keep getting dumped (application freezes) when I add
in errorString.  Any idea why?
*

package* {

*import* mx.controls.Label;

*import* mx.controls.listClasses.*;

*public* *class* PriceLabel *extends* Label {

*private* *const* POSITIVE_COLOR:uint = 0x00; *// Black
*

*private* *const* NEGATIVE_COLOR:uint = 0xFF; *// Red
*

*override* *protected* *function* updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):*void* {

*super*.updateDisplayList(unscaledWidth, unscaledHeight);

*/* Set the font color based on the item price. */
*

setStyle(*color*, (da...@price = 0) ? NEGATIVE_COLOR : POSITIVE_COLOR);

this.errorString=err;

  }

   }
}



?xml version=1.0 encoding=utf-8?

!--
http://blog.flexexamples.com/2007/08/20/formatting-a-flex-datagrid-control-using-a-custom-item-renderer/--

mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;

layout=vertical

verticalAlign=middle creationComplete=setErrorString()

backgroundColor=white

mx:Script

![CDATA[

*import* mx.controls.dataGridClasses.DataGridColumn;

*import* mx.utils.ObjectUtil;

*private* *function* price_labelFunc(item:Object,
column:DataGridColumn):String {

*return* currencyFormatter.format(it...@price);

}

*private* *function* price_sortCompareFunc(itemA:Object, itemB:Object):int {

*return* ObjectUtil.numericCompare(ite...@price, ite...@price);

}

*private* *function* setErrorString():*void*{

}

]]

/mx:Script

mx:XML id=itemsXML

items

item name=Item 1 price=1.32 error=my Error/

item name=Item 2 price=-12.23 error=my Error /

item name=Item 3 price=4.96 error=my Error /

item name=Item 4 price=-0.94 error=my Error /

/items

/mx:XML

mx:Style

.centered {

text-align: center;

}

/mx:Style

mx:CurrencyFormatter id=currencyFormatter

precision=2

useNegativeSign=false /

mx:DataGrid id=dataGrid dataProvider={itemsXML.item}

mx:columns

mx:DataGridColumn dataField=@name

headerText=Name:

headerStyleName=centered /

mx:DataGridColumn dataField=@price

headerText=Price:

textAlign=right

headerStyleName=centered

labelFunction=price_labelFunc

sortCompareFunction=price_sortCompareFunc

itemRenderer=PriceLabel

/

/mx:columns

/mx:DataGrid

mx:Label text=my label errorString=my error/

/mx:Application


On Wed, May 13, 2009 at 5:57 PM, foobone9 foobo...@yahoo.com wrote:



 I would just create a custom item renderer who examines its own data and if
 it finds something it doesn't like it draws a red bordering using the
 drawing API in updateDisplayList.

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, nhid
 nhi...@... wrote:
 
  Hi,
 
  I am also working on this problem, does anyone has an idea how to draw
 the
  red border when validation failed on a field in the datagrid?
 
  Thanks for any help.
  Nhi
 
  On Fri, May 8, 2009 at 2:50 PM, Ravi Suda sudaraviku...@... wrote:
 
  
  
   John,
   I am working on a similar requirement. I want to show the mandatory
 fields
   in datagrid as a validation error(red border). Could you provide your
 custom
   item renderer that you created.
  
   Thanks in Advance
   Ravi
  
  
   --- In flexcoders@yahoogroups.com 
   flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com,
   j_lentzz jelentz@ wrote:
   
True. Good idea. I've already coded the method to increment a
counter to display number of failed items. I'll modify the item
renderer too and see what appears.
   
Thanks,
   
John
--- In flexcoders@yahoogroups.com 
flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com, Roman
   Protsiuk
roman.protsiuk@ wrote:

 Then all you need is dataProvider. Validate items held in there.
 And
change
 some property of the item that indicates whether it's valid or not.
   Then
 item renderer easily can draw something bad basing on that info.

 R.

 On 9/19/07, j_lentzz jelentz@ wrote:
 
  I'm doing something like that right now for the individual cells.
  I've integrated a validator into the cell object. However, I need
 to
  be able to validate the complete datagrid when the save button is
  pressed. If the user never moves to a cell, I can't use the
  itemEditEnd to validate, I need to move through the data and
 check.
  Using the itemEditor.newInstance() and calling my validation
 routine,
  I can detect that a validation fails. Now I'm going to try to use
 the
  itemRenderer property to indicate the nice red boxes.
 
  John
  --- In flexcoders@yahoogroups.com 
  flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.comflexcoders%

   40yahoogroups.com,
Roman
  Protsiuk
  roman.protsiuk@ wrote:
  
   I remember I did it like this:
  
   public class FilesDataGridColumnEditor extends TextInput {
  
   public function

Re: [flexcoders] Re: Validating items in DataGrids

2009-05-13 Thread nhid
Hi,

I am also working on this problem, does anyone has an idea how to draw the
red border when validation failed on a field in the datagrid?

Thanks for any help.
Nhi

On Fri, May 8, 2009 at 2:50 PM, Ravi Suda sudaraviku...@yahoo.com wrote:



 John,
 I am working on a similar requirement. I want to show the mandatory fields
 in datagrid as a validation error(red border). Could you provide your custom
 item renderer that you created.

 Thanks in Advance
 Ravi


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 j_lentzz jele...@... wrote:
 
  True. Good idea. I've already coded the method to increment a
  counter to display number of failed items. I'll modify the item
  renderer too and see what appears.
 
  Thanks,
 
  John
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Roman
 Protsiuk
  roman.protsiuk@ wrote:
  
   Then all you need is dataProvider. Validate items held in there. And
  change
   some property of the item that indicates whether it's valid or not.
 Then
   item renderer easily can draw something bad basing on that info.
  
   R.
  
   On 9/19/07, j_lentzz jelentz@ wrote:
   
I'm doing something like that right now for the individual cells.
I've integrated a validator into the cell object. However, I need to
be able to validate the complete datagrid when the save button is
pressed. If the user never moves to a cell, I can't use the
itemEditEnd to validate, I need to move through the data and check.
Using the itemEditor.newInstance() and calling my validation routine,
I can detect that a validation fails. Now I'm going to try to use the
itemRenderer property to indicate the nice red boxes.
   
John
--- In flexcoders@yahoogroups.com 
flexcoders%40yahoogroups.comflexcoders%
 40yahoogroups.com,
  Roman
Protsiuk
roman.protsiuk@ wrote:

 I remember I did it like this:

 public class FilesDataGridColumnEditor extends TextInput {

 public function SomeDataGridEditor() {
 _validator.source = this;
 _validator.triggerEvent = change;
 _validator.required = true;
 _validator.property = text;
 }

 private var _validator : Validator = new SomeValidator();
 }

 It's not the best practices, but as far as I remember it
  worked. :)

 R.

 On 9/18/07, merelypixels merelypixels@ wrote:
 
  seems to me that no mucking about with itemEditors is
 necessary...
  extract the data you need from your dataProvider and then
 validate
  that data directly before sending it on. If you want the
  little red
  validation things, you should probably validate on a field by
  field
  basis using the dataGrids itemEditEnd event, validating using
  dg.itemEditorInstance and doing e.preventDefault() if the field
 is
  invalid.
 
  Hope that helps!
  -Pixels
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
  flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com,
   
  j_lentzz jelentz@ wrote:
  
   Hi,
  
   I'm now trying to validating the contents of a datagrid and
  I was
   wondering if there is an established way to do this. It
  seems like I
   would need to get an instance of the itemEditor and somehow
  pass it
   the value on that row. Then I would either call a validator
  against
   that editor, or call a method contained in the itemEditor to
  do the
   validation. I can get the itemEditor to do validation when
  the user
   is entering data, but I need to be able to do validation on
  all the
   entries in the datagrid when the save button is pressed - to
  handle
   the cases of missing data in required datagrid fields. I've
  found
   some examples of how to validate when the user is entering
  data for
   that field, but not for validating the complete datagrid. Any
help or
   ideas would be greatly appreciated.
  
   John
  
 
 
 

   
   
   
  
 

  



[flexcoders] Text Change Tracking

2008-11-10 Thread nhid
Hello,

We need to implement a tracker on the text being changed within a textarea.
For example, when any word is deleted, that word is shown as striked
out, similar to MS Word Track Changes feature, rather than actually removing
the word.  Has anyone done this or seen something like this in Flex?  Any
pointers will help.

Thank you!


[flexcoders] Compare text and highlight the differences

2008-11-04 Thread nhid
Hello,

We're trying to do a text comparision between 2 paragraphs and highlight
only the words that are different in the paragraphs.  How we are trying to
accomplish this is by comparing the words from paragraph 1 to those in
paragraph 2, keeping track of the matches as in a matrix, then use the
sentence with the highest matches as the base sentence, then highlight the
remaining words in that sentence in paragraph 2.  This method seems to be
cumbersome and not working properly at the moment.

Any other suggestions how or has anyone seen a sample to do this?

Thank you.


[flexcoders] Compare text and highlight the differences

2008-11-03 Thread nhid
Hello,

We're trying to do a text comparision between 2 paragraphs and highlight
only the words that are different in the paragraphs.  How we are trying to
accomplish this is by comparing the words from paragraph 1 to those in
paragraph 2, keeping track of the matches as in a matrix, then use the
sentence with the highest matches as the base sentence, then highlight the
remaining words in that sentence in paragraph 2.  This method seems to be
cumbersome and not working properly at the moment.

Any other suggestions how or has anyone seen a sample to do this?

Thank you.


Re: [flexcoders] Disable/enable menuBar menuItem

2008-04-02 Thread nhid
Got it working, Tracy.  Thanks a lot.

On 4/1/08, Tracy Spratt [EMAIL PROTECTED] wrote:

In literal xml declarations, the braces do not create a binding.  They
 simply give access to the members of the parent scope.



 To do what you want, use an e4x expression to find the menuitem node you
 need, then set the attributes as desired.



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *nhid
 *Sent:* Tuesday, April 01, 2008 2:00 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Disable/enable menuBar menuItem



 Hello,



 My menubar is like the following:



 

 In mxml file, *myFile.mxml*, I have:

 mx:Application 
 xmlns:mx=http://www.adobe.com/2006/mxmlcreationComplete=initCollections(); 

 mx:Script

 ![CDATA[

 import mx.collections.*;

 [Bindable] public var menuBarCollection:XMLListCollection;

 [Bindable] public var model:MyModelLocator = MyModelLocator.getInstance();

 private var menubarXML:XMLList =

 

 menuitem label=Menu1

 menuitem label=MenuItem 1-A data=1A
 enabled={model.menuEnabledFlags[0]}/

 menuitem label=MenuItem 1-B data=1B
 enabled={model.menuEnabledFlags[1]}/

 /menuitem

 menuitem label=Menu2

 menuitem label=MenuItem 2-A data=2A/

 menuitem type=separator /

 menuitem label=MenuItem 2-B 

 menuitem label=SubMenuItem 3-A data=3A/

 menuitem label=SubMenuItem 3-B data=3B/

 /menuitem

 /menuitem

 /;

 // Event handler for the MenuBar control's itemClick event.

 private function menuHandler(event:MenuEvent):void {

 Alert.show(Label:  + [EMAIL PROTECTED] + \n +

 Data:  + [EMAIL PROTECTED], Clicked menu item);

 }

 // Event handler to initialize the MenuBar control.

 private function initCollections():void {

 menuBarCollection = new XMLListCollection(menubarXML);

 }

 private function changeMenu():void {

 menuEnabledFlags[0] = true;

 menuEnabledFlags[1] = false;

 }

 ]]

 /mx:Script

 mx:MenuBar labelField=@label itemClick=menuHandler(event);
 dataProvider={menuBarCollection} /

 mx:Button label=Change Enabled/Disabled Menu click=changeMenu()/
 /mx:Application

 ---

 In *MyModelLocator.as* file, I have:

 public var menuEnabledFlags:Array = [false, true];

 

 Initially, when the application is loaded, MenuItem 1-A is disabled, and
 MenuItem 1-B is enabled as the flags are defined in MyModelLocator.as

 I want to dynamically change enable/disable flags for the item MenuItem
 1-A and MenuItem 1-B in .as (Script) file. So I changed the value of
 menuEnabledFlags as such menuEnabledFlags[0] = true; menuEnabledFlags[1] =
 false;

 I expected MenuItem 1-A will be enabled and MenuItem 1-B will be
 disabled.

 However, the change didn't reflect on the menubar.

 How can I dynamically enable/disable MenuItem 1-A and MenuItem 1-B?

 Please advise

 Thanks!

 



[flexcoders] Disable/enable menuBar menuItem

2008-04-01 Thread nhid
Hello,

My menubar is like the following:



In mxml file, *myFile.mxml*, I have:

mx:Application
xmlns:mx=http://www.adobe.com/2006/mxmlcreationComplete=initCollections();


mx:Script

![CDATA[

import mx.collections.*;

[Bindable] public var menuBarCollection:XMLListCollection;

[Bindable] public var model:MyModelLocator = MyModelLocator.getInstance();

private var menubarXML:XMLList =



menuitem label=Menu1

menuitem label=MenuItem 1-A data=1A enabled={model.menuEnabledFlags
[0]}/

menuitem label=MenuItem 1-B data=1B enabled={model.menuEnabledFlags
[1]}/

/menuitem

menuitem label=Menu2

menuitem label=MenuItem 2-A data=2A/

menuitem type=separator /

menuitem label=MenuItem 2-B 

menuitem label=SubMenuItem 3-A data=3A/

menuitem label=SubMenuItem 3-B data=3B/

/menuitem

/menuitem

/;

 // Event handler for the MenuBar control's itemClick event.

private function menuHandler(event:MenuEvent):void {

Alert.show(Label:  + [EMAIL PROTECTED] + \n +

Data:  + [EMAIL PROTECTED], Clicked menu item);

}

// Event handler to initialize the MenuBar control.

private function initCollections():void {

menuBarCollection = new XMLListCollection(menubarXML);

}

private function changeMenu():void {

menuEnabledFlags[0] = true;

menuEnabledFlags[1] = false;

}

]]

/mx:Script

mx:MenuBar labelField=@label itemClick=menuHandler(event);
dataProvider={menuBarCollection} /

mx:Button label=Change Enabled/Disabled Menu click=changeMenu()/
/mx:Application

---

In *MyModelLocator.as* file, I have:

public var menuEnabledFlags:Array = [false, true];



Initially, when the application is loaded, MenuItem 1-A is disabled, and
MenuItem 1-B is enabled as the flags are defined in MyModelLocator.as

I want to dynamically change enable/disable flags for the item MenuItem
1-A and MenuItem 1-B in .as (Script) file. So I changed the value of
menuEnabledFlags as such menuEnabledFlags[0] = true; menuEnabledFlags[1] =
false;

I expected MenuItem 1-A will be enabled and MenuItem 1-B will be
disabled.

However, the change didn't reflect on the menubar.

How can I dynamically enable/disable MenuItem 1-A and MenuItem 1-B?

Please advise

Thanks!


Re: [flexcoders] Error #2038: File I/O Error when uploading file

2008-01-15 Thread nhid
I'm using jsp server script for the upload and also getting the same error.
Which server script are you using?

Any suggestions anyone?   thanks.

On 1/14/08, tuomas.glad [EMAIL PROTECTED] wrote:

   Hi,

 I'm trying to upload file to server with Firefox and I'm getting error
 2038. With IE everything seems to be fine.

 Any ideas what might cause this?

 Thanks,
 Tuomas

 



[flexcoders] File upload with jsp

2008-01-07 Thread nhid
Hi all,

I'm looking for a sample of uploading a file to the server using jsp from a
flex application.  Any help is appreciated.

Thank you!


[flexcoders] Configuring message channels - RTMP

2007-12-18 Thread nhid
Hi,

Our system has a messaging broadcasting feature for timeout.  When it times
out an alert pops up to the user.  It seems to be after we have installed a
firewall in the network, this feature stopped working, the alert doesn't pop
up anymore.  What properties should be used or what should be added to fix
this problem?

This is what we have:

channel-definition id=my-rtmp class=mx.messaging.channels.RTMPChannel
 endpoint uri=http://{server.name}:2296/; class=
flex.messaging.endpoints.RTMPEndpoint/
 properties
 idle-timeout-minutes20/idle-timeout-minutes

websphere-workmanager-jndi-namejava:comp/env/wm/MessagingWorkManager/websphere-workmanager-jndi-name
 client-to-server-maxbps100K/client-to-server-maxbps
 server-to-client-maxbps100K/server-to-client-maxbps
 /properties
/channel-definition


Thank you.


[flexcoders] Tree - Open all child layers when open branch

2007-12-05 Thread nhid
Hi,

I have this tree structure:

   Branch1
  ChildA
  Child1
  Child1.1
  Child1.2
  Child1.2.1
  Child2
   Child2.1
  Child2.1.1
  Child2.1.2
  Child2.2
  Child2.2.1

How can I open all the child layers at once when I click on the folder icon
of Branch1?

Thanks!


[flexcoders] Manipulating tree label programmatically

2007-09-26 Thread nhid
Hi,

I am trying to change the label of a tree item for when the item is
selected.

branch1
 child1A
branch2
 child2A
  child2Aa
  child2Ab

First problem is I need to add a character, lets say #, to the label, so
when I click on child1A, it should now display #child1A.

Second problem is changing the style of the label, bolding it, to the label,
so when I click on branch2, it should now display *branch2*.

Any idea is greatly appreciated.


Re: [flexcoders] Manipulating tree label programmatically

2007-09-26 Thread nhid
I'm sorry, I misinterpreted the requirements.  The labels should display
with # or bold if they meet a particular condition when the tree is being
populated, not when the item is clicked.

Alex,
I'm not using TreeItemRenderer, just the tree control.


On 9/26/07, Alex Harui [EMAIL PROTECTED] wrote:

You can subclass TreeItemRenderer and do those things in
 updateDisplayList

  --
 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *nhid
 *Sent:* Wednesday, September 26, 2007 7:48 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Manipulating tree label programmatically



 Hi,

 I am trying to change the label of a tree item for when the item is
 selected.

 branch1
  child1A
 branch2
  child2A
   child2Aa
   child2Ab

 First problem is I need to add a character, lets say #, to the label, so
 when I click on child1A, it should now display #child1A.

 Second problem is changing the style of the label, bolding it, to the
 label, so when I click on branch2, it should now display *branch2*.

 Any idea is greatly appreciated.




  



[flexcoders] Overriding ValueObjects class

2007-09-17 Thread nhid
Hello,

Lets say I have a VO class Bar.as to be extended from Foo.as VO class.  I
get this error at variable title (see code below):

Overriding a function that is not marked for override.

How do I resolve this?  I saw Adobe's link saying I should remove [Bindable]
from base class, I did but that did not resolve the problem.  Any suggestion
is appreciated.

thank you.

**
// Foo.as
package com.xyz
{
  [Bindable]
  public class Foo
  {
public var title:String;
  }
}

// Bar.as
package com.xyz
{
  [Bindable]
  public class Bar extends Foo
  {
public var description:String;
public var title:String;
  }
}


[flexcoders] Detecting itemOpen event of a Tree

2007-09-12 Thread nhid
Hi,

I have a tree with multiple root nodes, where the leaves will be populated
only when I click on the folder icon using the itemOpen event.  That call
needs to pass the information of that particular root node to the backend,
how do I detect which root node I clicked?

Thank you!


Re: [flexcoders] DataGrid CheckBox itemRenderer select all

2007-05-03 Thread nhid

Yes, it does set the state based on passed in item data.  I got it to work
now by assigning each of the object into a new arraycollection and reassign
it back to the original.

Thanks Tracy.


On 5/2/07, Tracy Spratt [EMAIL PROTECTED] wrote:


   Does your itemRenderer override the set data() function and set the
state of the checkbox based on the passed in item data?



Tracy


 --

*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *nhid
*Sent:* Tuesday, May 01, 2007 5:44 PM
*To:* flexcoders@yahoogroups.com
*Subject:* Re: [flexcoders] DataGrid CheckBox itemRenderer select all



Hi all,



I have code similiar to this, where it checks all the checkboxes when I
click on a button Check All and unchecks all when I click on Uncheck All.



However, after I sort any of the columns in the datagrid, clicking Check
All will miss 1 or more boxes, then when I click on Uncheck All, the
currently checked boxes unchecks and the missed boxes become checked.



Any ideas?  Thanks.


*

mx:DataGridColumn dataField=Check itemRenderer=CheckRenderer
headerText=Option 

private function checkAll():void
{
   var obj:Object = new Object();

   for (var i:int = 0; i  dg.dataProvider.length; i++) {
   obj= dg.dataProvider[i];
   obj.Check = true;  // = false for uncheckAll()
   dg.dataProvider.itemUpdated(obj);
   }
}




On 10/17/06, *Tommy Mestdagh* [EMAIL PROTECTED] wrote:

 I also need to be able to check which CheckBoxs are selected



This is wath you are looking for.  I have a grid with a column named
deleted .  By clicking the checkbox you mark the item to delete (webmail
style)

This method pushes all marked items from the grid into a new array
todelete.

all items in the array todelete will be deleted later on.



Good luck .

  Tommy









private function collectForDelete():Array{
   var todelete:Array = new Array();
   var obj:Object = new Object();



 for (var i:Number =0  ; i  table_grids.datagrid.dataProvider.length ; i
++){
obj = table_grids. datagrid.dataProvider[i];
if (obj.deleted)  {
 var record:RecordDTO = new RecordDTO();
   record.setColumns(obj);
   todelete.push( record );
   }
}
return todelete;
}


 --

*Van:* flexcoders@yahoogroups.com [mailto: [EMAIL PROTECTED] *Namens
*Chad Callahan
*Verzonden:* dinsdag 17 oktober 2006 16:52
*Aan:* [EMAIL PROTECTED] ups.com
*Onderwerp:* [flexcoders] DataGrid CheckBox itemRenderer select all



I have a DataGrid and the first column's item renderer is mx.controls.CheckBox.
I would like to be able to have a select all button that sets all of the
CheckBox selected = true.  I also need to be able to check which CheckBoxs
are selected.  Any suggestions?





 CHAD CALLAHAN
PROGRAMMER

T8DESIGN.COM http://t8design.com/| P 319.266.7574 - x195 | 877.T8IDEAS |
F 888.290.4675




This e-mail, including attachments, is covered by the Electronic
Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential, and may
be legally privileged. If you are not the intended recipient, you are hereby
notified that any retention, dissemination, distribution, or copying of this
communication is strictly prohibited. Please reply to the sender that you
have received the message in error, and then please delete it. Thank you.
 --







inline: image001.jpg

Re: [flexcoders] DataGrid CheckBox itemRenderer select all

2007-05-01 Thread nhid

Hi all,

I have code similiar to this, where it checks all the checkboxes when I
click on a button Check All and unchecks all when I click on Uncheck All.

However, after I sort any of the columns in the datagrid, clicking Check All
will miss 1 or more boxes, then when I click on Uncheck All, the currently
checked boxes unchecks and the missed boxes become checked.

Any ideas?  Thanks.

*
mx:DataGridColumn dataField=Check itemRenderer=CheckRenderer
headerText=Option 

private function checkAll():void
{
  var obj:Object = new Object();

  for (var i:int = 0; i  dg.dataProvider.length; i++) {
  obj= dg.dataProvider[i];
  obj.Check = true;  // = false for uncheckAll()
  dg.dataProvider.itemUpdated(obj);
  }
}


On 10/17/06, Tommy Mestdagh [EMAIL PROTECTED] wrote:


I also need to be able to check which CheckBoxs are selected

This is wath you are looking for.  I have a grid with a column named
deleted .  By clicking the checkbox you mark the item to delete (webmail
style)
This method pushes all marked items from the grid into a new array
todelete.
all items in the array todelete will be deleted later on.

Good luck .
  Tommy




private function collectForDelete():Array{
   var todelete:Array = new Array();
   var obj:Object = new Object();

 for (var i:Number =0  ; i  table_grids.datagrid.dataProvider.length ; i
++){
obj = table_grids.datagrid.dataProvider[i];
if (obj.deleted)  {
 var record:RecordDTO = new RecordDTO();
   record.setColumns(obj);
   todelete.push( record );
   }
}
return todelete;
}

 --
*Van:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *Namens
*Chad Callahan
*Verzonden:* dinsdag 17 oktober 2006 16:52
*Aan:* flexcoders@yahoogroups.com
*Onderwerp:* [flexcoders] DataGrid CheckBox itemRenderer select all



I have a DataGrid and the first column's item renderer is mx.controls.
CheckBox.  I would like to be able to have a select all button that sets
all of the CheckBox selected = true.  I also need to be able to check
which CheckBoxs are selected.  Any suggestions?





 CHAD CALLAHAN
PROGRAMMER

T8DESIGN.COM http://t8design.com/ | P 319.266.7574 - x195 | 877.T8IDEAS| F
888.290.4675


This e-mail, including attachments, is covered by the Electronic
Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential, and may
be legally privileged. If you are not the intended recipient, you are hereby
notified that any retention, dissemination, distribution, or copying of this
communication is strictly prohibited. Please reply to the sender that you
have received the message in error, and then please delete it. Thank you.
 --





inline: image001.jpg