[flexcoders] Re: debugger blows by breakpoints in component

2006-07-07 Thread Scott Romer
We had the same issue when we imported our Beta projects to the GA
release.  After much struggling, I finally figured it out!  You need
the source directory icon to look like a folder with an orange/yellow
target symbol, rather than an arrow/link symbol.

To do this, I deleted the link to the additional source directory and
re-added them through project properties (source paths).  Now
debugging works fine for me.  

This has consistently been fixed the same way for all of our team
members.  So you may want to give that a try...

-Scott

--- In flexcoders@yahoogroups.com, Lisa Nelson [EMAIL PROTECTED] wrote:

 Hmm.  Well one of my coworkers has the problem as well.  (So it's not
 just me!)  My other coworker does not have the problem (yet).  Flex
 knows about my breakpoints.  They all show up in the breakpoints tab in
 the Flex Debugging perspective.  But it just blows right by them.
  
 -- Lisa
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Tracy Spratt
 Sent: Friday, July 07, 2006 14:24
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] debugger blows by breakpoints in component
 
 
 
 Yes that definitely was for Flex Builder 1.5 (I wrote it), and it does
 not apply to 2.0.  I have not had this problem that I noticed, but I
 have not worked on much modular code in 2.0 yet.
 
  
 
 Tracy
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Lisa Nelson
 Sent: Friday, July 07, 2006 4:34 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] debugger blows by breakpoints in component
 
  
 
 For the life of me I can't figure out why the debugger blows by all my
 breakpoints in my component. I found this in a FAQ:
 
 The safest way to set breakpoints in component files is to use the
 Files list. Start the debugging session, nav you app to where you want
 to start debugging. Click the Files button on the Debug Toolbar, or go
 Menu Debug\Files. Select the component you want, usually the .mxml or
 .as files. The list strips out underscores in filenames, and can be very
 long, but this method always works. FB will open a temporary file, set
 the breakpoints, and away you go. 
 
 But I don't see any Debug\Files option anywhere, and I'm starting to
 wonder if this FAQ had to do with Flex 1.5 and not 2.0.
 
 Has anyone had this problem in 2.0? And if so, how did you solve it?
 
 --Lisa








 Yahoo! Groups Sponsor ~-- 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Shift-tabbing not working in Firefox with wmode=opaque

2006-07-06 Thread Scott Romer
FYI: I have a logged a bug with Adobe, and given them sample
application demo for testing.  

--- In flexcoders@yahoogroups.com, Angus Johnson [EMAIL PROTECTED] wrote:

 I built an IFrame app about a month ago using the excellent examples
that
 others on this list provided.
 
 The one thing I found with firefox is that you have to have wmode
otherwise
 the browser content will flicker. Sometimes the browser content will
appear
 blank until you resize or scroll.
 
 I haven't found a work around for the key issues though.
 
 Angus
 
 
 On 06/07/06, Scott Romer [EMAIL PROTECTED] wrote:
 
 An additional problem that I noticed... droplists don't seem to use
  the correct key functions when wmode=opaque. For instance, the
  default key combination of using Ctrl-[Down Arrow] should open up a
  droplist on a combobox. When wmode=opaque, Ctrl doesn't seem to be
  recognized, but the Alt key seems to open the dropdown?
 
  I'm confused at why this has an impact.
 
  I'm going to try to convince team that we should not need
  wmode=opaque, but would still be nice to have a different work around.
 
  Thanks for any ideas.
  -Scott
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
Scott
  Romer swromer@ wrote:
  
   I have wmode=opaque in my Object/Embed tag. When I tab through the
   dataGrid everything works fine. However, when I try to shift-tab (to
   tab backwards), it only tabs forwards (as if the shift key is not
   being held down).
  
   This seems to only be reproducible on FireFox (have not tried other
   Mozilla browsers). This is not a bug on Internet Explorer...
   (Tested on Windows XP)
  
   It sounds similar to someone else's issue about the mouse
scrollWheel
   not working. (I'm guessing on the correlation here though)
  
   Any ideas?
  
 
   
 











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] DataGrid with dependent columns... recommendation on implementation?

2006-07-06 Thread Scott Romer
Hi All - 

We have a dataGrid setup with an ArrayCollection as the dataProvider.
 In addition, we are making this dataGrid editable with ComboBoxes.  
Does anyone have any recommendations as to what would be a GREAT
approach to setup this with dependent columns?

i.e. Depending on what you choose from column 1, column 2's options
are changed.. similar with column 3 depending on column 2...

We have an implementation running, but has been troublesome with
workarounds for this and that.. so I am wondering if anyone wanted to
share ideas with alternate strategies..  

For instance, itemUpdated events are not listened to while editing the
same row when you tab through the columns.  This means that the
renderers are not updated while you tab.  If we extend the
ArrayCollection to override the enable/disableAutoUpdate methods, then
the rows are going to jump during sorting.  (This was the whole reason
that the itemUpdated events were queued..)

Looking for thoughts/ideas..
-Scott





 Yahoo! Groups Sponsor ~-- 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Using and image as a link

2006-07-06 Thread Scott Romer
Can't you just set buttonMode to true on the image, and then the
handCursor automatically shows up?  (Seems to work for me...)

Just a thought.  I suppose both would work though.
-Scott

--- In flexcoders@yahoogroups.com, Rob Rusher [EMAIL PROTECTED] wrote:

 I suggest just adding a click event on you image object in which the
event
 handler uses the navigateToURL() method. You can find out how to use
 navigateToURL here:

http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=1010.html
 
 You might also change the cursor to a hand on mouseover. I blogged
this a
 while back.
 http://www.robrusher.com/1/2006/01/Using-useHandCursor-in-Flex.cfm
 
 HTH
 
 On 7/6/06, Matt Horn [EMAIL PROTECTED] wrote:
 
Link is now LinkButton. Can you send me a link to any errors in
current
  doc? Tnks,
 
 
  matt horn
  flex docs
 
   -Original Message-
   From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
   [mailto:flexcoders@yahoogroups.com
flexcoders%40yahoogroups.com] On
  Behalf Of Henry
   Sent: Thursday, July 06, 2006 2:31 PM
   To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
   Subject: [flexcoders] Re: Using and image as a link
  
   Thanks for the information. I was looking online this morning
   after i posted hoping to find something and i ran across a
   mx:Link tag that actually inherited from the button tag. Did
   that tag get taken away in Flex 2.0? I tried it this morning
   and it would throw an error and not compile when used as
   listed in the documentation.
  
   tfth!
  
   henry iii
  
   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
   mailto:flexcoders% flexcoders%2540yahoogroups.com , Matt Horn
  mhorn@ wrote:
   
You could use a button and define the skins to be the same
   graphic (so
it doesnt change like a button normally would when its
   state changes):
   
Button {
upSkin:Embed(../assets/mygraphic.jpg);
downSkin:Embed(../assets/mygraphic.jpg);
overSkin:Embed(../assets/mygraphic.jpg);
}
   
THen you just specify the click handler as you would with
   any button:
   
mx:Button id=b1 click=doSomething()/
   
Just dont specify a label for the button. That will muck up
   the sizing
of the button and the text will bleed through your image.
   
hth,
   
matt horn
flex docs
   
   
 -Original Message-
 From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
 mailto:flexcoders% flexcoders%2540yahoogroups.com
 [mailto:flexcoders@yahoogroups.com
flexcoders%40yahoogroups.com
 mailto:flexcoders% flexcoders%2540yahoogroups.com ] On
Behalf Of
  Henry
 Sent: Thursday, July 06, 2006 8:37 AM
 To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
   mailto:flexcoders% flexcoders%2540yahoogroups.com
 Subject: [flexcoders] Using and image as a link

 I have been trying to get and image to go to a URL on a
   click. I am
 sure that I am making this harder than it should be.
   However i would
 like to know how you guys/gals might be doing this. I was
   trying to
 use an actionscript function that is predefined in Flash,
   but that
 does not seem to work.

 Do I need to create my own actionscript for this?, or is there
 something i am missing that is super simple?

 Thanks so much for your help!





   
  
  
  
  
  
 
   
 
 
 
 
 -- 
 -- 
 Regards,
 Rob Rusher
 
 Adobe Certified Breeze, ColdFusion MX and Flex 2 Instructor
 m: 303-885-7044
 im: robrusher







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Shift-tabbing not working in Firefox with wmode=opaque

2006-07-05 Thread Scott Romer
An additional problem that I noticed... droplists don't seem to use
the correct key functions when wmode=opaque.  For instance, the
default key combination of using Ctrl-[Down Arrow] should open up a
droplist on a combobox.   When wmode=opaque, Ctrl doesn't seem to be
recognized, but the Alt key seems to open the dropdown?

I'm confused at why this has an impact.

I'm going to try to convince team that we should not need
wmode=opaque, but would still be nice to have a different work around.

Thanks for any ideas.
-Scott

--- In flexcoders@yahoogroups.com, Scott Romer [EMAIL PROTECTED] wrote:

 I have wmode=opaque in my Object/Embed tag.  When I tab through the
 dataGrid everything works fine.  However, when I try to shift-tab (to
 tab backwards), it only tabs forwards (as if the shift key is not
 being held down).
 
 This seems to only be reproducible on FireFox (have not tried other
 Mozilla browsers).  This is not a bug on Internet Explorer...
 (Tested on Windows XP)
 
 It sounds similar to someone else's issue about the mouse scrollWheel
 not working. (I'm guessing on the correlation here though)
 
 Any ideas?








 Yahoo! Groups Sponsor ~-- 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] IFrame, wmode, Firefox, and tabbing....

2006-06-27 Thread Scott Romer
So, recently, we were exploring options of including an IFrame on our
application to display some external content.  In doing so, one
solution that we found was to include the wmode=opaque on the
Object/Embed tag, and display an absolutely positioned IFrame that is
updated during the moving of a TitleWindow in Flex.  Everything has
worked great so far... Yeah!

But then... a problem arose.  It appears that in FireFox (at least on
XP) stops listening to the Shift key when tabbing?  (Normally, holding
down shift and clicking Tab will tab through the elements backwards. 
In this specific case, it always tabs forwards regardless of the shift
key.)

Can this be labeled as a bug?  (Even though I bet it will NEVER get
fixed, it would be nice to track it so that it gets some visibility.)

NOTE: The shift tabbing works fine in IE.
Side note:  Is there a better place to post bugs like this, rather
than sending to a message board where most people may not care about
such a specific issue?

-Scott






 Yahoo! Groups Sponsor ~-- 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] ComboBase value? Possible bug

2006-06-26 Thread Scott Romer



Hi all - I'm trying to work around an issue that I am having with a custom combo-box. It seems that it is setting the value to empty string (i.e. ""), when it should be null, which is then seen as a difference in the dataGrid itemEditEnd event, and so it tries to cast the "" String to the class type used for display in the ComboBox.It looks like it comes down to this function in ComboBase. value in this case is "", where as it is initialized as null. I'm trying to find out where value gets set to "", but it looks like it must be in the Sprite code, because I can't seem to find any other setters. Does this code make sense? Should it be setting the _selectedItem to 'data' rather than to 'value'... private function setSelectedItem(data:Object, clearFirst:Boolean = true):void { //2 code paths: one for before collection, one after if (!collection || collection.length == 0) { _selectedItem = value; selectedItemChanged = true; invalidateDisplayList(); return; } ... }Thanks much for any help.-Scott

__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___



[flexcoders] Triggering update refresh for dataGrid

2006-06-13 Thread Scott Romer
Hello - 

I have some design constraints which is forcing me to use an Array
behind the scenes for updating a dataGrid.  In either case, I have a
simpler version of the code here, that basically follows an example in
the docs except that the update is made directly to the array rather
than using the suggested addItemAt(), setItemAt() methods.

I have confirmed that addItemAt and setItemAt do cause the dataGrid to
redraw, however, I need to find what event I need to trigger and/or
listen for to get the redraw to work if I am updating the array myself.

See the following code:
[---START CODE---]
?xml version=1.0 encoding=utf-8?

mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
backgroundAlpha=0
initialize=initImpl()

mx:Script

import mx.collections.ArrayCollection;

[Bindable]
public var employees:Array = new Array();

private function initImpl():void
{
dg.dataProvider = new ArrayCollection(employees);
}

private function addRow():void
{
if (frmName.text != )
{
employees[employees.length] = {name: frmName.text,
email: email.text, phone: phone.text};
}
}

private function updateRow():void
{
if (dg.selectedIndex != -1)
{
employees[dg.selectedIndex] =  {name: frmName.text,
email: email.text, phone: phone.text};
}
}

/mx:Script

mx:HBox width=100% height=100%

mx:DataGrid id=dg width=100% height=100%
mx:columns
mx:Array
mx:DataGridColumn dataField=name
headerText=Name/
mx:DataGridColumn dataField=phone
headerText=Phone/
mx:DataGridColumn dataField=email
headerText=Email/
/mx:Array
/mx:columns
/mx:DataGrid

mx:Form width=100% height=100%
mx:FormItem label=Name
mx:TextInput id=frmName width=200
text={dg.selectedItem.name}/
/mx:FormItem
mx:FormItem label=Email
mx:TextInput id=email width=200
text={dg.selectedItem.email}/
/mx:FormItem
mx:FormItem label=Phone
mx:TextInput id=phone width=200
text={dg.selectedItem.phone}/
/mx:FormItem
mx:FormItem
mx:HBox
mx:Button label=Update click=updateRow()/
mx:Button label=Add click=addRow()/
/mx:HBox
/mx:FormItem
/mx:Form

/mx:HBox

/mx:Application

[---END CODE---]


I've tried listening for collection events and calling
invalidateDisplayList(), but that doesn't seem to work.  Any other ideas?

Thanks,
-scott






 Yahoo! Groups Sponsor ~-- 
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Triggering update refresh for dataGrid

2006-06-13 Thread Scott Romer
Thanks Mike.  You've basically come to the same conclusion I have.  I
really appreciate your time in trying to figure this out as well..

If you ever get any other ideas, feel free to let me know.  I'm just
planning to move on for now.. (the customer really won't notice they
they have to add an item twice to see it, right? hehehe)

-scott


--- In flexcoders@yahoogroups.com, Michael Schmalle
[EMAIL PROTECTED] wrote:

 Hi again,
 
 I did another test,
 
 When you add
 
 dg.invalidateList();
 
 You click addRow(), the first itme nothing happens, you click addRow()
 again, both new items show up in the dg.
 
 I havn't worked to much with the lists but, this dosn't seem like a
proper
 behavior. Bug Adobe?
 
 Peace, Mike
 
 On 6/13/06, Michael Schmalle [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I just looked at the source for the DataGrid,
 
  When you press a header, all they are doing is calling
collection.refresh
  ().
 
  I don't understand why it is not getting updated instantly.
 
  Peace, Mike
 
 
  On 6/13/06, Michael Schmalle [EMAIL PROTECTED] wrote:
  
   Hi,
  
   I tried you example
  
   this works.. kindof
  
   ICollectionView(dg.dataProvider).refresh();
  
   It dosn't seem to work until you hit a header, then it works always.
  
   Peace, Mike
  
  
   On 6/13/06, Scott Romer  [EMAIL PROTECTED] wrote:
   
   Hello -
   
I have some design constraints which is forcing me to use an Array
behind the scenes for updating a dataGrid. In either case, I
have a
simpler version of the code here, that basically follows an
example in
the docs except that the update is made directly to the array
rather
than using the suggested addItemAt(), setItemAt() methods.
   
I have confirmed that addItemAt and setItemAt do cause the
dataGrid to
redraw, however, I need to find what event I need to trigger
and/or
listen for to get the redraw to work if I am updating the array
myself.
   
See the following code:
[---START CODE---]
?xml version=1.0 encoding=utf-8?
   
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
backgroundAlpha=0
initialize=initImpl()
   
mx:Script
   
import mx.collections.ArrayCollection;
   
[Bindable]
public var employees:Array = new Array();
   
private function initImpl():void
{
dg.dataProvider = new ArrayCollection(employees);
}
   
private function addRow():void
{
if (frmName.text != )
{
employees[employees.length] = {name: frmName.text,
email: email.text, phone: phone.text};
}
}
   
private function updateRow():void
{
if (dg.selectedIndex != -1)
{
employees[dg.selectedIndex] = {name: frmName.text,
email: email.text, phone: phone.text};
}
}
   
/mx:Script
   
mx:HBox width=100% height=100%
   
mx:DataGrid id=dg width=100% height=100%
mx:columns
mx:Array
mx:DataGridColumn dataField=name
headerText=Name/
mx:DataGridColumn dataField=phone
headerText=Phone/
mx:DataGridColumn dataField=email
headerText=Email/
/mx:Array
/mx:columns
/mx:DataGrid
   
mx:Form width=100% height=100%
mx:FormItem label=Name
mx:TextInput id=frmName width=200
text={dg.selectedItem.name}/
/mx:FormItem
mx:FormItem label=Email
mx:TextInput id=email width=200
text={dg.selectedItem.email}/
/mx:FormItem
mx:FormItem label=Phone
mx:TextInput id=phone width=200
text={dg.selectedItem.phone}/
/mx:FormItem
mx:FormItem
mx:HBox
mx:Button label=Update click=updateRow()/
mx:Button label=Add click=addRow()/
/mx:HBox
/mx:FormItem
/mx:Form
   
/mx:HBox
   
/mx:Application
   
[---END CODE---]
   
I've tried listening for collection events and calling
invalidateDisplayList(), but that doesn't seem to work. Any other
ideas?
   
Thanks,
-scott
   
 
   
  
  
  
   --
   What goes up, does come down.
  
 
 
 
  --
  What goes up, does come down.
 
 
 
 
 -- 
 What goes up, does come down.







 Yahoo! Groups Sponsor ~-- 
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Triggering update refresh for dataGrid

2006-06-13 Thread Scott Romer
I think I have a solution to my refresh problem.
I had tried this in my real project, but didn't really try it in my
small example that I sent to the message group.  Perhaps I had a typo
or there was some other change that seems to make it work now, but
here is my solution:

// Basically, in the addRow function, dispatch an event that
// an item has been added to the collection.  In my project, 
// I hadn't included the event.location, but now that I include 
// that it works..  and you don't even have to click on the header
// to see it!

private function addRow():void
{
if (frmName.text != )
{
var newEmployee:Object = {name: frmName.text, email:
email.text, phone: phone.text};
var location:int = employees.length;
employees[location] = newEmployee;
var event:CollectionEvent = new
CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
event.items = new Array(newEmployee);
event.kind = CollectionEventKind.ADD;
event.location = location;
ArrayCollection(dg.dataProvider).dispatchEvent(event);
}
}


--- In flexcoders@yahoogroups.com, Scott Romer [EMAIL PROTECTED] wrote:

 Thanks Mike.  You've basically come to the same conclusion I have.  I
 really appreciate your time in trying to figure this out as well..
 
 If you ever get any other ideas, feel free to let me know.  I'm just
 planning to move on for now.. (the customer really won't notice they
 they have to add an item twice to see it, right? hehehe)
 
 -scott
 
 
 --- In flexcoders@yahoogroups.com, Michael Schmalle
 teoti.graphix@ wrote:
 
  Hi again,
  
  I did another test,
  
  When you add
  
  dg.invalidateList();
  
  You click addRow(), the first itme nothing happens, you click addRow()
  again, both new items show up in the dg.
  
  I havn't worked to much with the lists but, this dosn't seem like a
 proper
  behavior. Bug Adobe?
  
  Peace, Mike
  
  On 6/13/06, Michael Schmalle teoti.graphix@ wrote:
  
   Hi,
  
   I just looked at the source for the DataGrid,
  
   When you press a header, all they are doing is calling
 collection.refresh
   ().
  
   I don't understand why it is not getting updated instantly.
  
   Peace, Mike
  
  
   On 6/13/06, Michael Schmalle teoti.graphix@ wrote:
   
Hi,
   
I tried you example
   
this works.. kindof
   
ICollectionView(dg.dataProvider).refresh();
   
It dosn't seem to work until you hit a header, then it works
always.
   
Peace, Mike
   
   
On 6/13/06, Scott Romer  swromer@ wrote:

Hello -

 I have some design constraints which is forcing me to use an
Array
 behind the scenes for updating a dataGrid. In either case, I
 have a
 simpler version of the code here, that basically follows an
 example in
 the docs except that the update is made directly to the array
 rather
 than using the suggested addItemAt(), setItemAt() methods.

 I have confirmed that addItemAt and setItemAt do cause the
 dataGrid to
 redraw, however, I need to find what event I need to trigger
 and/or
 listen for to get the redraw to work if I am updating the array
 myself.

 See the following code:
 [---START CODE---]
 ?xml version=1.0 encoding=utf-8?

 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 backgroundAlpha=0
 initialize=initImpl()

 mx:Script

 import mx.collections.ArrayCollection;

 [Bindable]
 public var employees:Array = new Array();

 private function initImpl():void
 {
 dg.dataProvider = new ArrayCollection(employees);
 }

 private function addRow():void
 {
 if (frmName.text != )
 {
 employees[employees.length] = {name: frmName.text,
 email: email.text, phone: phone.text};
 }
 }

 private function updateRow():void
 {
 if (dg.selectedIndex != -1)
 {
 employees[dg.selectedIndex] = {name: frmName.text,
 email: email.text, phone: phone.text};
 }
 }

 /mx:Script

 mx:HBox width=100% height=100%

 mx:DataGrid id=dg width=100% height=100%
 mx:columns
 mx:Array
 mx:DataGridColumn dataField=name
 headerText=Name/
 mx:DataGridColumn dataField=phone
 headerText=Phone/
 mx:DataGridColumn dataField=email
 headerText=Email/
 /mx:Array
 /mx:columns
 /mx:DataGrid

 mx:Form width=100% height=100%
 mx:FormItem label=Name
 mx:TextInput id=frmName width=200
 text={dg.selectedItem.name}/
 /mx:FormItem
 mx:FormItem label=Email
 mx:TextInput id=email width=200
 text={dg.selectedItem.email}/
 /mx:FormItem
 mx:FormItem label=Phone
 mx:TextInput id=phone width=200
 text={dg.selectedItem.phone}/
 /mx:FormItem
 mx:FormItem
 mx:HBox
 mx:Button label=Update click=updateRow()/
 mx:Button

[flexcoders] Re: DataGrid sortCompareFunction, is this a bug???

2006-06-13 Thread Scott Romer
I'm not sure if this is a bug, but I found this situation a while ago.
 The solution that I had to use was to keep track of the column header
that is clicked on, and then use that to get the appropriate dataField
from the object so that I could compare the two objects.

This is not that elegant of a solution, but seems to be working for
me.  If there is a better way to do this, I am all ears.


--- In flexcoders@yahoogroups.com, jpwarmer [EMAIL PROTECTED] wrote:

 Hi All, 
 
 In Flex 1.5, if you want to use a custom sort for columns in dataGrid
 you could pass a function to the colunm. That function need to have
 the following signature:
 
 mySortCompareFunction(obj1 : Object, obj2 : Object, columnIndex :
 Number) : Number
 
 In this case, Flex will pass into obj1 and obj2, the data in the cells
 that need to be compared.
 
 In Flex 2, the sort function signature has change into 
 
 mySortCompareFunction(obj1:Object, obj2:Object) : int
 
 and now, Flex pass into obj1 and obj2, the entires rows (as an object,
 of course).
  
 I'm doing  a migration an that's what happening, so, is this a bug???
 o just is how it works now???










 Yahoo! Groups Sponsor ~-- 
You can search right from your browser? It's easy and it's free.  See how.
http://us.click.yahoo.com/_7bhrC/NGxNAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Re: custom formats in datagrids

2006-05-23 Thread Scott Romer



Out of curiousity:
 Is this better or worse than creating a custom renderer to format
the data? 




--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED]
wrote:

 On Tuesday 23 May 2006 13:52, Tom Chiverton wrote:
  How does one say 'for this column, use this formatter' ?
 
 dataGridColumn ... itemFunction=customFormat
 
 function customFormat(item:Object, column:DataGridColumn):String{
 var fmt:PseudoDateRenderer=new PseudoDateRenderer();
 return fmt.format(item[column.dataField]);
 }
 
 Gah.
 -- 
 Tom Chiverton
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in
England and Wales under registered number OC307980 whose registered
office address is at St James's Court Brown Street Manchester M2 2JF.
 A list of members is available for inspection at the registered
office. Any reference to a partner in relation to Halliwells LLP means
a member of Halliwells LLP. Regulated by the Law Society.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above
and may be confidential or legally privileged. If you are not the
addressee you must not read it and must not use any information
contained in nor copy it nor inform any person other than Halliwells
LLP or the addressee of its existence or contents. If you have
received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 8008.
 
 For more information about Halliwells LLP visit www.halliwells.com.
 
 We are pleased to announce that Halliwells LLP has been voted AIM
Lawyer of the Year at the 2005 Growth Company Awards











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Re: ObjectUtil.compare seems a little incorrect for Boolean values

2006-05-19 Thread Scott Romer



Thanks. I did see the documentation about the 'as' operator. And
that is why it confused me that the Flex source code did that for the
Boolean. 

I have hacked around the issue for now, by automatically casting any
Boolean's to Numbers before I pass to the ObjectUtil.compare() method.
Luckily, in searching through the source code, it appears that this is
the only place in the public view of the code that ever tries convert
a Boolean to a Number via the 'as' operator. I also assumed that I
would be able to trace the sorting calls on a data grid to this
method, but the debugger never stopped at all, (which explains why
using the default sorting on dataGrid does not show the issue). I
think it normally just falls into some generic Array sort in that
case... *guess*.



--- In flexcoders@yahoogroups.com, David Clark [EMAIL PROTECTED] wrote:

 From the help for the as operator (search for operators):
 Returns the first operand if it is a member of the data type
specified by
 the second operand.
 
 The important bit is if it is a member.
 
 Number(a) will give you 1 and 0 though. I'm not sure if this is going to
 help you much for your specific problem with compare though. I would
almost
 say that it was a bug...
 
 -- 
 david
 May the forces of evil become confused on the way to your house.











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] ObjectUtil.compare seems a little incorrect for Boolean values

2006-05-18 Thread Scott Romer



I am working to override a sortCompareFunction on a column, and in
doins so, I am handling my specific case and when applicable, just
passing to ObjectUtil.compare() so as not to reimplement all of the
simple type checking.

One case that I have is when the comparison objects are Booleans.
Looking at the source, it looks like it takes the Booleans and
performs a numericCompare on them. Makes sense to me.. assuming
that true maps to 1 and false maps to 0. However, strangely enough,
they BOTH map to 0.

I know I can handle this myself in my own code, but doesn't this seem
like a bug?

Very simply, execute this:
code
 var a:Boolean = true;
 var b:Boolean = false;
 var aNum:Number = a as Number;
 var bNum:Number = b as Number;
 Alert.show(Boolean:  + a + ,  + b + ; Number:  + aNum + , 
+ bNum);
 //var comparison:int = ObjectUtil.compare(a, b);
 // the result here is always 0;
/code

What would you expect the result to be? Personally, I would have
expected: Boolean: true, false; Number: 1, 0

Perhaps I am just getting loopy/tired in figuring this out.
Thanks for any feedback.










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Follow-up: ObjectUtil.compare seems a little incorrect for Boolean values

2006-05-18 Thread Scott Romer



So I did a few more tests...
it looks like:

var a:Boolean = true;
var b:Boolean = false;
a as Number // 0
b as Number // 0
Number(a) // 1
Number(b) // 0

>From this, I think ObjectUtil class just needs to be updated in the
internalCompare function:

 switch(typeOfA)
 {
 case boolean:
 // Looks like this should be added to the boolean case
 // rather than falling down into the number case
 {
 result = numericCompare(Number(a), Number(b));
 break;
 }
 case number:
 {
 result = numericCompare(a as Number, b as Number);
 break;
 }
 
 }











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] ObjectUtil.compare seems a little incorrect for Boolean values

2006-05-18 Thread Scott Romer



I am working to override a sortCompareFunction on a column, and in
doins so, I am handling my specific case and when applicable, just
passing to ObjectUtil.compare() so as not to reimplement all of the
simple type checking.

One case that I have is when the comparison objects are Booleans.
Looking at the source, it looks like it takes the Booleans and
performs a numericCompare on them. Makes sense to me.. assuming
that true maps to 1 and false maps to 0. However, strangely enough,
they BOTH map to 0.

I know I can handle this myself in my own code, but doesn't this seem
like a bug?

Very simply, execute this:
code
 var a:Boolean = true;
 var b:Boolean = false;
 var aNum:Number = a as Number;
 var bNum:Number = b as Number;
 Alert.show(Boolean:  + a + ,  + b + ; Number:  + aNum + , 
+ bNum);
 //var comparison:int = ObjectUtil.compare(a, b);
 // the result here is always 0;
/code

What would you expect the result to be? Personally, I would have
expected: Boolean: true, false; Number: 1, 0

Perhaps I am just getting loopy/tired in figuring this out.
Thanks for any feedback.










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Re: F2B3: Placing sort arrow on dataGrid

2006-05-12 Thread Scott Romer



The sorting of the collection is done in the headerReleaseEvent. I'd
love to try the updateSortIndexAndDirection method of DataGrid.as, but
that is marked private in beta 3 source. I even tried to call the
method in case the source was incorrect. But it looks like I don't
have access to it. 

On the flip side, I was able to see that the modelChangedHandler() in
DataGrid does call the updateSortIndexAndDirection() for me. However,
this does not work if we want secondary and tertiary sorting. (per
example from doc mentioned before). In the
vupdateSortIndexAndDirection() method, it checks to see if you have
more than one field specified in the sort. If so, then basically
break out and leave the sortIndex variable at -1 resulting in no sort
arrow appearing. Couldn't this have just put the arrow on the first
sortField rather than stopping?

So for now, if I want a sort arrow, I can only support sorting on a
single field (or I need to reimplement how the placeSortArrow()..) My
preference is to not reimplement. If you have other ideas, they are
much appreciated.

Thanks,
-scott


--- In flexcoders@yahoogroups.com, Manish Jethani
[EMAIL PROTECTED] wrote:

 On 5/12/06, Scott Romer [EMAIL PROTECTED] wrote:
  I am working on a version of adding generic sorting on my class that
  extends DataGrid. The placeSortArrow method of DataGrid is marked
  as protected, so I can call the method, but the arrow will never show
  up because sortIndex has to be set and is marked private. In
  addition, I can't set some of the other needed variables (i.e.
  sortDirection on the dataGrid).
 
 For the sort arrow to show up, you have to actually sort the
 collection. See the updateSortIndexAndDirection method in DataGrid.as











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Re: FB2B3: Transfer Focus from custom editor in dataGrid

2006-05-12 Thread Scott Romer



What kind of changes are you referring to for the StateEditor.mxml? 

I believe I need to be able to cancel the event with the
preventDefault method. My application is much more complex than this
example... The dataField I am using in my application on this column
is actually an object navigation path. Because I can't specify a
dataField to be myObj.childObj.name, I believe I need to handle it
myself to set the appropriate value. As for this example, I was just
trying to put forth a smaller test case that originated from the Flex
Docs.

I suppose my VERY UGLY workaround to this is to reimplement finding
the next cell and then dispatching an itemBeginEdit event on that
cell. But this doesn't seem logical to me in regards to code
maintenance... although, I feel that later in my code, I am going to
have to reimplement this anyway because of how we are looking to set
the tab focus across datagrids that are positioned next to each other.

Any more ideas would be much appreciated?

Thanks
-scott


--- In flexcoders@yahoogroups.com, Manish Jethani
[EMAIL PROTECTED] wrote:

 On 5/12/06, Scott Romer [EMAIL PROTECTED] wrote:
  I have created a custom editor for my dataGrid. I am also handling
  the itemEditEnd event. When focus exists in a cell in this column and
  I try to TAB out, I am prevented... In tracing through the code, (in
  DataGrid.as, I believe I know why.. but not sure if this is a bug or
  by design).
 
 Interesting. So cancelling an itemEditEnd also prevents the focus
 from moving on.
 
 Have you tried not cancelling the event and instead making
 modifications to your StateEditor.mxml to make it work the way you
 want?











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Re: DataGridColumn Style

2006-05-12 Thread Scott Romer



Just out of curiousity.. are you adding the double-period before the
class name (..headerStyle). When I posted it, it should have only
been one period. i.e. .headerStyle It looks like Yahoo is doing
something funny with it.

Anyway.. if you know that your style.css is being included properly
it should work, but it might be best in this case to start with it in
the *.mxml to first validate the style is correct. One thing that I
noticed differently was how you also had dashes on your
alternating-row-colors and header-colors. I think that is incorrect.
 As an example, look in installDir\Flex SDK
2.0\frameworks\defaults.css For DataGrid it has:

DataGrid
{
 alternatingItemColors: #F7F7F7, #FF;
 headerColors: #FF, #E6E6E6;
 [I removed a bunch of other styles here]
}

This was copied from the Beta 3 version.

Thanks.


--- In flexcoders@yahoogroups.com, Mehdi, Agha [EMAIL PROTECTED] wrote:

 I have this in my style.css
 
 DataGrid
 {
  alternating-row-colors:#FF, #EFEFEF;
  header-colors:#4A8AC0, #4A8AC0;
  headerStyleName:headerStyle;
 }
 ..headerStyle
 {
 fontWeight:bold;
  fontSize:10;
  color:#FF;
 }
 
 And it doesn't work. Do I need to set DataGrid attribute of
headerStyle to
 this class?
 
 Thanks
 
 Agha Mehdi
 IDT - eBusiness Program Manager
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Scott Romer
 Sent: Thursday, May 11, 2006 5:31 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: DataGridColumn Style
 
 That almost works... perhaps it just needs to be cleaned up a bit. 
 In my mxml file, I included the following:
 
 mx:Style
 DataGrid 
 {
 headerStyleName:headerStyle;
 headerColors:#00,#CCD9E6;
 } 
 ..headerStyle
 {
 fontWeight:bold;
 fontSize:10;
 color:#ff; 
 }
 /mx:Style
 
 NOTE: It looks like you want the header text to be white. This code
 (basically Tim's example) now sets the header Text to white, with the
 background of the header showing as a gradient from black to whatever
 color the #CCD9E6 is;
 
 One other change to Tim's response was the ..gridHeaderStyle, should
 have just be a single .
 
 Try again.
 
 --- In flexcoders@yahoogroups.com, Mehdi, Agha Agha.Mehdi@ wrote:
 
  Tim,
  
  That didn't do it.
  
  Agha Mehdi
  IDT - eBusiness Program Manager
  
  
  -Original Message-
  From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
  Behalf Of Tim Hoff
  Sent: Thursday, May 11, 2006 1:22 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Re: DataGridColumn Style
  
  You could try something like this:
  
  DataGrid {
   headerStyleName:gridHeaderStyle;
   headerColors:#ff,#CCD9E6;
  }
  
  ..gridHeaderStyle
  {
  fontWeight:bold;
   fontSize:10;
   color:#00;
  }
  
  -TH
  
  
  
  
  
  --- In flexcoders@yahoogroups.com, Mehdi, Agha Agha.Mehdi@ 
  wrote:
  
   Hi all,
   
   How can I set the color of text of DataGrid Column Headers?
   DataGridColumn{color:#FF;} in .css is not working
   
   Thanks
   
   Agha Mehdi
   IDT - eBusiness Program Manager
   Work: 408.284.8239
   Cell : 510.493.0491
   Fax : 408.284.2766
  
  
  
  
  
  
  
  
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.com 
  Yahoo! Groups Links
 
 
 
 
 
 
 
 
 
 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
 Yahoo! Groups Links











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] FB2B3: Transfer Focus from custom editor in dataGrid

2006-05-11 Thread Scott Romer



I have created a custom editor for my dataGrid. I am also handling
the itemEditEnd event. When focus exists in a cell in this column and
I try to TAB out, I am prevented... In tracing through the code, (in
DataGrid.as, I believe I know why.. but not sure if this is a bug or
by design). Of course, I want to claim it is a bug... so my issue can
get solved, but perhaps there are other reasons.. 

During the processData method below, we call event.preventDefault(). 
In DataGrid.as (source code from beta 3), in the
findNextItemRenderer method, there is a check as to
code
 if (!itemEditorInstance || endEdit(reason))
/code

and because the itemEditor exists AND the endEdit method returns
false, the code does not fall into the block to BEGIN editing the next
cell.


Take for example the following: (simplified the version taken from
the docs Example: Passing multiple values back from an item editor)

Application file:
?xml version=1.0?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml width=700
 
 mx:Script
 ![CDATA[

 import mx.events.DataGridEvent;
 
 [Bindable]
 public var initDG:Array = [
 {Company: 'Acme', Contact: 'Bob Jones', Phone:
'413-555-1212', 
 City: 'Boston', State: 'MA'},
 {Company: 'Allied', Contact: 'Jane Smith', Phone:
'617-555-3434', 
 City: 'SanFrancisco', State: 'CA'} ];
 
 // Define the event listener.
 public function processData(event:DataGridEvent):void {

 // Check the reason for the event.
 if (event.reason == DataGridEventReason.OTHER || 
 event.reason == DataGridEventReason.CANCELLED){
 // Do not update cell.
 return;
 } 

 if(event.dataField == State){
 
 // Disable copying data back to the control.
 event.preventDefault();

 // Get new state from editor.
 myGrid.editedItemRenderer.data.State=
StateEditor(event.currentTarget.itemEditorInstance).selectedItem;

 // Close the item editor.
 myGrid.destroyItemEditor(); 
 
 // Notify the list control to update its display.
 
myGrid.dataProvider.notifyItemUpdate(myGrid.editedItemRenderer);
 }
 } 
 
 ]]
 /mx:Script
 
 mx:DataGrid id=myGrid dataProvider={initDG} editable=true
itemEditEnd=processData(event); 
 mx:columns
 mx:DataGridColumn dataField=Company/
 mx:DataGridColumn dataField=City/
 mx:DataGridColumn dataField=State width=150
 itemEditor=StateEditor
 mx:itemRenderer
 mx:Component
 mx:Text selectable=false width=100% 
 text={data.State}/
 /mx:Component
 /mx:itemRenderer
 /mx:DataGridColumn
 mx:DataGridColumn dataField=Contact/
 mx:DataGridColumn dataField=Phone/
 /mx:columns 
 /mx:DataGrid 
/mx:Application


StateEditor.mxml:
?xml version=1.0 encoding=utf-8?
mx:ComboBox xmlns:mx=http://www.adobe.com/2006/mxml
selectedItem={data.State}
 mx:dataProvider
 mx:StringAL/mx:String
 mx:StringAK/mx:String
 mx:StringAR/mx:String
 mx:StringCA/mx:String
 mx:StringMA/mx:String
 /mx:dataProvider
/mx:ComboBox



So long story short, how do I allow easy tabbing through this
situation...










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Re: DataGridColumn Style

2006-05-11 Thread Scott Romer



That almost works... perhaps it just needs to be cleaned up a bit. 
In my mxml file, I included the following:

mx:Style
DataGrid 
{
 headerStyleName:headerStyle;
 headerColors:#00,#CCD9E6;
} 
.headerStyle
{
 fontWeight:bold;
 fontSize:10;
 color:#ff; 
}
/mx:Style

NOTE: It looks like you want the header text to be white. This code
(basically Tim's example) now sets the header Text to white, with the
background of the header showing as a gradient from black to whatever
color the #CCD9E6 is;

One other change to Tim's response was the ..gridHeaderStyle, should
have just be a single .

Try again.

--- In flexcoders@yahoogroups.com, Mehdi, Agha [EMAIL PROTECTED] wrote:

 Tim,
 
 That didn't do it.
 
 Agha Mehdi
 IDT - eBusiness Program Manager
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Tim Hoff
 Sent: Thursday, May 11, 2006 1:22 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: DataGridColumn Style
 
 You could try something like this:
 
 DataGrid {
  headerStyleName:gridHeaderStyle;
  headerColors:#ff,#CCD9E6;
 }
 
 ..gridHeaderStyle
 {
 fontWeight:bold;
  fontSize:10;
  color:#00;
 }
 
 -TH
 
 
 
 
 
 --- In flexcoders@yahoogroups.com, Mehdi, Agha Agha.Mehdi@ 
 wrote:
 
  Hi all,
  
  How can I set the color of text of DataGrid Column Headers?
  DataGridColumn{color:#FF;} in .css is not working
  
  Thanks
  
  Agha Mehdi
  IDT - eBusiness Program Manager
  Work: 408.284.8239
  Cell : 510.493.0491
  Fax : 408.284.2766
 
 
 
 
 
 
 
 
 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
 Yahoo! Groups Links












--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] F2B3: Placing sort arrow on dataGrid

2006-05-11 Thread Scott Romer



I am working on a version of adding generic sorting on my class that
extends DataGrid. The placeSortArrow method of DataGrid is marked
as protected, so I can call the method, but the arrow will never show
up because sortIndex has to be set and is marked private. In
addition, I can't set some of the other needed variables (i.e.
sortDirection on the dataGrid).

So I went back to a simpler example... I tried the version in the
docs to see if the arrow appears, namely:
http://livedocs.macromedia.com/labs/1/flex20beta3/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=0608.html

With code like this, what is the recommended way to add a sort arrow?
 Do I need to reimplement the wheel (so to speak) by creating a sprite
and figuring its location, or is there a better way to do this by just
calling a method on the dataGrid?

Thanks!
-scott










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  












[flexcoders] Re: generic sorts for DataGridColumns?

2006-05-11 Thread Scott Romer



I'm working on a very similar problem. When I specify the
sortCompareFunction on a DataGridColumn, it looks like it tries to
actually execute that function from the SortField. Try tracing
through and see for yourself...

It looks like it takes the column's datafield and creates a sortField
for it. Then sets the sortCompareFunction from the column as the
compareFunction on the sortField. In which case the SortField's
compare function should have a signature like this: (per doc)
code
 function myCompare(a:Object, b:Object):int
/code

Hence the third parameter (fields) that we both seem to try to use is
always null?

There must be a simpler way that we are just not seeing. On a flip
side, I'm going to try to move towards the example in their documentation:
http://livedocs.macromedia.com/labs/1/flex20beta3/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=0608.html


--- In flexcoders@yahoogroups.com, djbrown_rotonews
[EMAIL PROTECTED] wrote:

 It's default is null (obviously). Any idea how I can modify 
 the call to sortCompareFunction in the dataGridColumn line to add 
 this argument to the function call?
 
 --- In flexcoders@yahoogroups.com, Doug Lowder douglowder@ 
 wrote:
 
  
  The DataGridColumn docs
  
 http://livedocs.macromedia.com/labs/1/flex20beta2/langref/mx/control
 s/d\
  ataGridClasses/DataGridColumn.html#sortCompareFunction say the
  sortCompareFunction gets passed a fields parameter in addition to 
 the
  item objects being compared. Have you checked the fields 
 parameter to
  see what's in it?
  
  Doug
  
  
  --- In flexcoders@yahoogroups.com, djbrown_rotonews
  djbrown_rotonews@ wrote:
  
   bump. any help?
  
   --- In flexcoders@yahoogroups.com, djbrown_rotonews
   djbrown_rotonews@ wrote:
   
anyone? I've seen similir questions asked before, and never 
 saw an
answer that directly pertains to the DataGrdColumn issue.
   
--- In flexcoders@yahoogroups.com, djbrown_rotonews
djbrown_rotonews@ wrote:

 I'm using Flex Beta 2 and wanting to implement a generic sort
   that
 will handle the approximate 20 columns I'm displaying.

 I've got it set up as follows:
 mx:DataGridColumn id=col1 resizable=false
 textAlign=center fontWeight=bold headerText=STA
 width={dgDelays.width/22} headerWordWrap=on
dataField=acfrmsta
 labelFunction=labelFunction 
 sortCompareFunction=sortAlpha/

 and my sortAlpha takes the form of:
 public function sortAlpha(a:Object,b:Object):int {

 var field:String=acfrmsta;
 var string1:String = a[field].attribute(dataValue);
 var string2:String = b[field].attribute(dataValue);

 if (string1==string2)
 return 0;
 else if (string1  string2)
 return -1;
 else
 return 1;
 }

 as you can see, I have to hard-code in the value of arfrmsta 
 in
the
 sortalpha() method. How can I drill down and get this value
 programatically if I don't have access to something like
columnIndex
 (which DOES exist apparently in DataGridListData)? Either 
 that,
   or
I
 can iterate over the column headers if something like
isItemSelected
 () existed.

   
  
 










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  












[flexcoders] Re: FB2B3 - Source code

2006-05-09 Thread Scott Romer



Take a look in:
InstallDir\Flex Builder 2.0 Beta 3\Flex SDK 2.0\frameworks\source


--- In flexcoders@yahoogroups.com, judah [EMAIL PROTECTED] wrote:

 I've just downloaded the Flex Builder 2 Beta 3 and I'm having
difficulty 
 finding the source code that I heard was going to be in it. I looked in 
 the typical locations but do not see it. Can someone tell me where
this is?
 
 Judah
 
 -- 
 Always bear in mind that your own resolution to succeed is more
important than any one thing.
 
 You can have anything you want - if you want it badly enough. You
can be anything you want to be, do anything you set out to accomplish
if you hold to that desire with singleness of purpose. 
 
 - Abraham Lincoln












--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Re: Null error when using specifying itemRenderer on dataGridColumn

2006-04-28 Thread Scott Romer



I think rendererIsEditor makes sense when both the editor and renderer
are the same object, but in this instance, I am using Text for the
renderer and TextInput for the editor.

As mentioned before, these are not what I am really trying to set for
editor/renderer, but just set to there to simplify the problem as that
is the exact same error. So if we can figure out what the problem is
in this example, I should be able to translate that to my specific
custom renderer/editors.

But just to give it a shot, I tried with the imports (per Matt's idea)
with no luck, and I tried with the rendererIsEditor which made the
column uneditable (because I am not using TextInput).
>From the documentation, it looks like if rendererIsEditor is set, then
the itemEditor is ignored. 

Any more ideas?


--- In flexcoders@yahoogroups.com, Harish Sivaramakrishnan
[EMAIL PROTECTED] wrote:

 you need to set rendererIsEditor=true in the code, the RTE will be
gone.
 
 Thanks
 Harish
 
 On 4/28/06, Matt Chotin [EMAIL PROTECTED] wrote:
 
  Random shot, try importing mx.controls.Text and
mx.controls.TextInput? I
  think it should have been a compiler error if it was necessary but…
 
 
 
  Note that the error is for the item editor when you say it's the
renderer
  that you change to fix it. Sounds like a bug to me… I'll forward it
  inside.
 
 
 
  Matt
 
 
  --
 
  *From:* flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] *On
  Behalf Of *Scott Romer
  *Sent:* Thursday, April 27, 2006 2:41 PM
  *To:* flexcoders@yahoogroups.com
  *Subject:* [flexcoders] Null error when using specifying
itemRenderer on
  dataGridColumn
 
 
 
  I've been struggling for some time now (and I'm assuming this must
just be
  so brain-dead simple)...
  Trying to set an ItemRenderer and ItemEditor on a datagridColumn. For
  certain ItemRenderer's, I am getting a null error. (using Flex 2
beta 2)
 
  NOTE: I am not trying to use these as my actual renderer and editor
  classes as they don't really provide anything at all above the
defaults..
  but I noticed this gives the EXACT same error. (My actual
renderer extends
  from Canvas...)
 
  If you change the itemRenderer to mx.controls.Label, then it works
fine..
  and oddly enough Text extends Label. Any ideas?
 
 
 
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml
  backgroundAlpha=0 creationComplete=initApp()
 
  mx:Script
  ![CDATA[
  ! nbsp; import mx.collections.ArrayCollection;
 
 
  [Bindable]
  public var dataProvider:ArrayCollection;
 
  private function initApp():void
  {
  dataProvider = new ArrayCollection([
  {name: John Smith, dept: Engineering},
  {name: Jane Doe, dept: Marketing},
  ! {name: Lisa Brown, dept: Sales},
  nbs! p; {name: Robert Wong, dept:
  Engineering},
 
  {name: Amy Taylor, dept: Finance},
  ]);
  }
 
  ]]
  /mx:Script
 
  mx:DataGrid id=myDatagrid dataProvider={dataProvider}
  variableRowHeight=true editable=true rowHeight=50
  width=300 height=300
  mx:columns
  mx:DataGridColumn dataField=name/
  ! nbsp; mx:DataGridColumn dataField=dept editable=true
 
  *itemRenderer=mx.controls.Text* editorDataField=text
  itemEditor=mx.controls.TextInput
  /mx:DataGridColumn
  /mx:columns
  /mx:DataGrid
 
  /mx:Application
 
 
 
 
  Null error received when trying to edit the dept column:
  TypeError: Error #1009: null has no properties.
  at mx.controls::DataGrid/createItemEditor()
  at mx.controls::DataGrid/itemEditorItemEditBeginHandler()
  at flash.events::EventDispatcher/dispatchEvent()
  at mx.controls::DataGrid/commitEditedItemPosition()
  at mx.controls::DataGrid/mx.controls:DataGrid::updateDisplayList()
  at ! mx.core::UIComponent/validateDisplayList()
  nbs! p; at mx .managers::LayoutManager/validateDisplayList()
 
  at mx.managers::LayoutManager/::doPhasedInstantiation()
  at mx.core::UIComponent/::callLaterDispatcher2()
  at mx.core::UIComponent/::callLaterDispatcher()
 
 
 
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
 
 
 
  SPONSORED LINKS
  Web site design
developmenthttp://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ
 Computer
  software
developmenthttp://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw
 Software
  design and
developmenthttp://groups.yahoo.com/gads?t=msk=Software+design+and+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.

[flexcoders] Null error when using specifying itemRenderer on dataGridColumn

2006-04-27 Thread Scott Romer



I've been struggling for some time now (and I'm assuming this must just be so brain-dead simple)...Trying to set an ItemRenderer and ItemEditor on a datagridColumn. For certain ItemRenderer's, I am getting a null error. (using Flex 2 beta 2)NOTE: I am not trying to use these as my actual renderer and editor classes as they don't really provide anything at all above the defaults.. but I noticed this gives the EXACT same error. (My actual renderer extends from Canvas...)If you change the itemRenderer to mx.controls.Label, then it works fine.. and oddly enough Text extends Label. Any ideas??xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundAlpha="0" creationComplete="initApp()"mx:Script ![CDATA[ import mx.collections.ArrayCollection;   [Bindable] public var dataProvider:ArrayCollection; private function initApp():void { dataProvider = new ArrayCollection([ {name: "John Smith", dept: "Engineering"}, {name: "Jane Doe", dept: "Marketing"}, {name: "Lisa Brown", dept: "Sales"}, {name: "Robert Wong", dept: "Engineering"}, {name: "Amy Taylor", dept: "Finance"}, ]); }  ]]/mx:Scriptmx:DataGrid id="myDatagrid" dataProvider="{dataProvider}" variableRowHeight="true" editable="true" rowHeight="50" width="300" height="300" mx:columns mx:DataGridColumn dataField="name"/ mx:DataGridColumn dataField="dept" editable="true"  itemRenderer="mx.controls.Text" editorDataField="text" itemEditor="mx.controls.TextInput" /mx:DataGridColumn /mx:columns/mx:DataGrid/mx:ApplicationNull error received when trying to edit the dept column:TypeError: Error #1009: null has no properties. at mx.controls::DataGrid/createItemEditor() at mx.controls::DataGrid/itemEditorItemEditBeginHandler() at flash.events::EventDispatcher/dispatchEvent() at mx.controls::DataGrid/commitEditedItemPosition() at mx.controls::DataGrid/mx.controls:DataGrid::updateDisplayList() at mx.core::UIComponent/validateDisplayList() at mx.managers::LayoutManager/validateDisplayList() at mx.managers::LayoutManager/::doPhasedInstantiation() at mx.core::UIComponent/::callLaterDispatcher2() at mx.core::UIComponent/::callLaterDispatcher()






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.