[flexcoders] Selecting an Item Programmatically after Adding it to List

2009-12-13 Thread steveb805
Thought I'd run this by everyone.

If you have a List, whose dataprovider (arraycollection) has an ac tive sort on 
it, how do you select a new Item immediately after an addItem call, 
programtically?

I can't predict what slot it's going to end up at due to the sort. It used to 
be easy before the sort (you just select arraycollection.length-1)  

Do I need to resort to:
Using the collectionChange event, and then in the handler function, looking 
at the object in event.items[0], and then searching the arraycollection for the 
label field?

Thanks,
Steve



[flexcoders] Re: Selecting an Item Programmatically after Adding it to List

2009-12-13 Thread steveb805
BTW, Do I need to resort to:  
 should really say: 
   Do I need to settle for, or something else,  so as not to confuse :)


--- In flexcoders@yahoogroups.com, steveb805 quantumcheese...@... wrote:

 Thought I'd run this by everyone.
 
 If you have a List, whose dataprovider (arraycollection) has an ac tive sort 
 on it, how do you select a new Item immediately after an addItem call, 
 programtically?
 
 I can't predict what slot it's going to end up at due to the sort. It used to 
 be easy before the sort (you just select arraycollection.length-1)  
 
 Do I need to resort to:
 Using the collectionChange event, and then in the handler function, 
 looking at the object in event.items[0], and then searching the 
 arraycollection for the label field?
 
 Thanks,
 Steve





[flexcoders] Re: invalidateList not working on Menu control

2009-12-08 Thread steveb805
Hi, actually I don't think that's supported for arrays, only arraycollections. 
It was my original code, but when running the app, you get a runtime error that 
refresh is not a function. Thanks though.  

--- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote:

 I don't think I've done what you described before, but I think you should try 
 refreshing the dataprovider. arrayDP.refresh();
 
 --- In flexcoders@yahoogroups.com, steveb805 quantumcheesedog@ wrote:
 
   invalidateList is invalidating my mood ... no it's not that bad.
  
  I have a popUpButton:
  
  templateMenu = new Menu();// global var
  templateMenu.labelField = name;
  templateMenu.dataProvider = arrayDP;
  templateMenu.selectedIndex = 0;
  templateMenu.showRoot = true;
  templatePopUpButton.popUp = templateMenu;
  
  
  Occassionally, I do an arrayDP.push(some object);
  
  I'd like the popUp's menu to immediately show this new item.
  
  I tried templateMenu.invalidateList(), but this is not working.
  
  The flash develop doc/hint says that invalidateList: refresh all rows on 
  the next update
  
  How do you force the next update.   Is it invalidateDisplayList()?  I 
  tried that, adding it after invalidateList, but that didn't work.
  
  eager to be enlightened,
  Thanks,
  Steve
 





[flexcoders] Re: invalidateList not working on Menu control

2009-12-08 Thread steveb805
Yeah, My gut feeling was that calling the dataprovider assignment statement 
again was going to do the trick at the very least. I'll just use that since it 
definitely works - I guess I wanted to hear that particular option spoken from 
someone else. Thanks.

--- In flexcoders@yahoogroups.com, tiborballai ballai.t...@... wrote:

 Hi Steve,
 
 invalidateList() tells the component that it needs to refresh it's rows on 
 the next update, but that doesn't mean that the component will reload it's 
 data.
 
 You'll either have to use databinding, or update the templateMenu's 
 dataprovider property once you make changes to arrayDP.
 
 with databiding:
 You'll have to use the [Bindable] metadata tag when declaring arrayDP.
 
 [Bindable]
 private var arrayDP:Array;
 
 and use BindingUtils to set the dataprovider:
 BindingUtils.bindProperty(templateMenu, dataprovider, this, arrayDP);
 
 
 or, each time you change arrayDP, you can re-assign it as the templateMenu's 
 dataprovider.
 
 Hope this helps,
 
 Tibor.
 www.tiborballai.com
 
 --- In flexcoders@yahoogroups.com, steveb805 quantumcheesedog@ wrote:
 
  Hi, actually I don't think that's supported for arrays, only 
  arraycollections. It was my original code, but when running the app, you 
  get a runtime error that refresh is not a function. Thanks though.  
  
  --- In flexcoders@yahoogroups.com, invertedspear invertedspear@ wrote:
  
   I don't think I've done what you described before, but I think you should 
   try refreshing the dataprovider. arrayDP.refresh();
   
   --- In flexcoders@yahoogroups.com, steveb805 quantumcheesedog@ wrote:
   
 invalidateList is invalidating my mood ... no it's not that bad.

I have a popUpButton:

templateMenu = new Menu();// global var
templateMenu.labelField = name;
templateMenu.dataProvider = arrayDP;
templateMenu.selectedIndex = 0;
templateMenu.showRoot = true;
templatePopUpButton.popUp = templateMenu;


Occassionally, I do an arrayDP.push(some object);

I'd like the popUp's menu to immediately show this new item.

I tried templateMenu.invalidateList(), but this is not working.

The flash develop doc/hint says that invalidateList: refresh all rows 
on the next update

How do you force the next update.   Is it invalidateDisplayList()?  I 
tried that, adding it after invalidateList, but that didn't work.

eager to be enlightened,
Thanks,
Steve
   
  
 





[flexcoders] invalidateList not working on Menu control

2009-12-07 Thread steveb805
 invalidateList is invalidating my mood ... no it's not that bad.

I have a popUpButton:

templateMenu = new Menu();// global var
templateMenu.labelField = name;
templateMenu.dataProvider = arrayDP;
templateMenu.selectedIndex = 0;
templateMenu.showRoot = true;
templatePopUpButton.popUp = templateMenu;


Occassionally, I do an arrayDP.push(some object);

I'd like the popUp's menu to immediately show this new item.

I tried templateMenu.invalidateList(), but this is not working.

The flash develop doc/hint says that invalidateList: refresh all rows on the 
next update

How do you force the next update.   Is it invalidateDisplayList()?  I tried 
that, adding it after invalidateList, but that didn't work.

eager to be enlightened,
Thanks,
Steve

  



[flexcoders] Re: Struggling with simply using returned SQL data for a popMenuButton

2009-12-06 Thread steveb805
Definitely good to know, Tibor. It dawned on me, actually, that I don't need it 
bindable anymore due to a slight change in my design strategy.  So now I can 
keep it simple.
Thanks a lot.

  


--- In flexcoders@yahoogroups.com, tiborballai ballai.t...@... wrote:

 While your code is technically correct (thus it works), since you are 
 changing a [Bindable] property your compiled code will dispatch 
 tempArray.length change events as you iterate through the tempArray. 
 
 You can simply assign the event.result value to arrayDP.
 
 [Bindable]
 public var arrayDP:Array;
 
 private function getDataListener(event:ResultEvent):void{
   arrayDP=event.result as Array;
 }
 
 
 or alternatively:
 
 [Bindable(event=DPChange)]
 public var arrayDP:Array;
 
 private function getDataListener(event:ResultEvent):void{
   var tempArray:Array = event.result as Array;
  
   for (var i:int = 0; i  tempArray.length - 1; i++) {
 arrayDP.push( {name:tempArray[i].name,id:tempArray[i].task_id});
   }
   dispatchEvent(new Event(DPChange));
 }
 
 Use the [Bindable(event=DPChange)] metadata tag, where you are telling the 
 compiler that you'll be dispatching the change event, and dispatch it once 
 you've iterated through the result array.
 This might be helpful if you want to do client side processing on the data 
 before displaying it.
 
 
 Tibor.
 
 --- In flexcoders@yahoogroups.com, steveb805 quantumcheesedog@ wrote:
 
  The solution was actually just to stay with the original idea of mine to 
  keep the dataProvider of the menu as an Array.  
  
  In the result handler, basically I need to manually create A.S. objects 
  with the fields I want.
  
  
  
  [Bindable]
  public var arrayDP:Array = new Array();
  
  private function getDataListener(event:ResultEvent):void {
var tempArray:Array = event.result as Array;
  
for (var i:int = 0; i  tempArray.length - 1; i++) {
   arrayDP.push( {name:tempArray[i].name,id:tempArray[i].task_id});
  
  }
  
  
  
  Hopefully this is an aid to someone else.
  
  ( If I'm wrong and need to go to Walmart to purchase a clue, let me know 
  though, but the popupbutton works now )
  
  
  --- In flexcoders@yahoogroups.com, steveb805 quantumcheesedog@ wrote:
  
   I've been trying like heck to get data returned from AMF Remoting and use 
   it for the data provider for a popUpButton.  This data is from MySQL, 
   just regular text fields/int fields, etc..
   
   ---
   
   public var dataXML :XMLListCollection; // the data provider
   
   private function getDataListener(event:ResultEvent):void 
   {
var xmlResult:XMLList =  new XMLList(event.result); 
dataXML = new XMLListCollection( xmlResult.children()); 
   }
   
   -
   
   My grasp of xml is kind of iffy, so I got mixed up while reading the Flex 
   docs on xml.
   
   Is this the preferred way of getting back the data.
   Steve
  
 





[flexcoders] Re: Struggling with simply using returned SQL data for a popMenuButton

2009-12-05 Thread steveb805
The solution was actually just to stay with the original idea of mine to keep 
the dataProvider of the menu as an Array.  

In the result handler, basically I need to manually create A.S. objects with 
the fields I want.



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

private function getDataListener(event:ResultEvent):void {
  var tempArray:Array = event.result as Array;

  for (var i:int = 0; i  tempArray.length - 1; i++) {
 arrayDP.push( {name:tempArray[i].name,id:tempArray[i].task_id});

}



Hopefully this is an aid to someone else.

( If I'm wrong and need to go to Walmart to purchase a clue, let me know 
though, but the popupbutton works now )


--- In flexcoders@yahoogroups.com, steveb805 quantumcheese...@... wrote:

 I've been trying like heck to get data returned from AMF Remoting and use it 
 for the data provider for a popUpButton.  This data is from MySQL, just 
 regular text fields/int fields, etc..
 
 ---
 
 public var dataXML :XMLListCollection; // the data provider
 
 private function getDataListener(event:ResultEvent):void 
 {
  var xmlResult:XMLList =  new XMLList(event.result); 
  dataXML = new XMLListCollection( xmlResult.children()); 
 }
 
 -
 
 My grasp of xml is kind of iffy, so I got mixed up while reading the Flex 
 docs on xml.
 
 Is this the preferred way of getting back the data.
 Steve





[flexcoders] Struggling with simply using returned SQL data for a popMenuButton

2009-12-04 Thread steveb805
I've been trying like heck to get data returned from AMF Remoting and use it 
for the data provider for a popUpButton.  This data is from MySQL, just regular 
text fields/int fields, etc..

---

public var dataXML :XMLListCollection; // the data provider

private function getDataListener(event:ResultEvent):void 
{
 var xmlResult:XMLList =  new XMLList(event.result); 
 dataXML = new XMLListCollection( xmlResult.children()); 
}

-

My grasp of xml is kind of iffy, so I got mixed up while reading the Flex docs 
on xml.

Is this the preferred way of getting back the data.
Steve



[flexcoders] calling removeListener on a popup

2009-11-30 Thread steveb805
I have a mxml component based on TitleWindow that's used for a Popup. Nothing 
new there - big yawn goin your way.

I also have an addEventListener called on the object (so I can dispatch a 
custom event):

---

win = EditTaskBox(PopUpManager.createPopUp(this, EditTaskBox, true));
win.taskText.setFocus();
.
.
win.addEventListener(taskInputText, newTaskDialogBoxHandler);
--

So obviously, you want to call removeListener when you're done with the dialog, 
so I call removeEventListener in newTaskDialogBoxHandler(), in main.mxml, after 
I use the information from the custom event.

win.removeEventListener(taskInputText, newTaskDialogBoxHandler);


However, in the case of *cancelling* the dialog box, do I need to dispatch an 
event in this case as well, from within the component.?  

In my customer TitleWindow component, called EditTaskBox.mxml, for the 
closeButton handler, I call PopUpManager.removePopUp(this);

It's not like you can do: removeEventListener(..) here, since you're in a 
static component,right?  

Looks like I need to just create a meta declaration for a custom event, but 
obviously don't need a custom Event class or anything.

Just verifying this.
Thanks
Steve





[flexcoders] Re: Technique to tell the filterFunction to chill for a sec before going into eff

2009-11-27 Thread steveb805

Actually, this is a non-issue.  The visual activity isn't as bad as I thought 
if I just set the filterfunction to null while I'm doing my editing of the 
value object.

--- In flexcoders@yahoogroups.com, steveb805 quantumcheese...@... wrote:

 
 I have a filter function for a List that hides the item if the duedate is 
 larger than a particular number.
 
 In a function I call, to change a value object field, as soon as I hit this 
 line below, the filter goes into effect (which is expected since duedate is 
 the field specified in the filter)
 
 projectListAC[projectList.selectedIndex].duedate = tempDateNumber;
 
   and hides the item, and the selectedIndex goes to -1.
 
  (projectListAC is the dp)
 
 If I temporarily set filterFunction to null, and then change the duedate, and 
 then set it back to the filter, you get a visual flash of all a sudden a lot 
 of items becoming visible, and then back again.
 
 Not really the effect I want.
 
 Shouldn't the List only change after calling refresh() on the dataprovider?  
 As soon as i change the List's value object field, the filtering takes place
 
 Steve





[flexcoders] Technique to tell the filterFunction to chill for a sec before going into eff

2009-11-26 Thread steveb805

I have a filter function for a List that hides the item if the duedate is 
larger than a particular number.

In a function I call, to change a value object field, as soon as I hit this 
line below, the filter goes into effect (which is expected since duedate is the 
field specified in the filter)

projectListAC[projectList.selectedIndex].duedate = tempDateNumber;

  and hides the item, and the selectedIndex goes to -1.

 (projectListAC is the dp)

If I temporarily set filterFunction to null, and then change the duedate, and 
then set it back to the filter, you get a visual flash of all a sudden a lot of 
items becoming visible, and then back again.

Not really the effect I want.

Shouldn't the List only change after calling refresh() on the dataprovider?  As 
soon as i change the List's value object field, the filtering takes place

Steve










[flexcoders] Best Pattern for a Complex Application Options/Settings Box

2009-11-19 Thread steveb805
On the verge of creating a non-Trivial Dialog screen/box for my app where a 
User creates categories, chooses settings (warn when deleting), Default 
behaviour, etc...

It'll have 3 tabs.  I'll be pulling the settings from a MySql Options table.

Is it common practice, even for Complex dialog's, to:

  - just use the usual TitleWindow with createPopup, which is commonly used for 
more trivial input your name stuff ?

  - *not* pull the SQL data from the Options table, until a user actually 
launches open the Dialog Box.  ( It's possible to, on App init(), to load the 
data into an array, so that the dialog opens quicker, but a user may use the 
Settings module once every 5 uses of the App )

Steve

  





[flexcoders] Re: Flex SDK Open Source

2009-11-19 Thread steveb805
No, I get a Oops! This link appears to be broken. message (chrome)

--- In flexcoders@yahoogroups.com, cuttenv cutt...@... wrote:

 Hey guys,
 Can anyone browse the source for the flex sdk on adobe's site?
 http://opensource.adobe.com:81/svn/opensource/flex/sdk/
 
 I followed the link from the confluence site:
 http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code





[flexcoders] Re: The Alert box is at the Top Left.

2009-11-13 Thread steveb805
Thanks, good solution. I need to make life easier and just go the path of least 
work when it comes to trivial stuff like where the alerts show up.

--- In flexcoders@yahoogroups.com, James Finnigan james.alan.finni...@... 
wrote:

  You can always just move the Alert yourself...
 
  private function popUpAlert():void{
 
 var myMenu:Menu = new Menu();
 var popUpButton:PopUpButton = new PopUpButton();
  addChild(popUpButton);
  popUpButton.x = this.width / 2;
  popUpButton.y = this.height / 2;
 
 var dp:Object = [{label: Alpha}, {label: Beta}, {label:
 Gamma}];
 myMenu.dataProvider = dp;
 myMenu.selectedIndex = 0;
 myMenu.addEventListener(itemClick, itemClickHandler);
 popUpButton.popUp = myMenu;
 }
 
 private function itemClickHandler(evt:MenuEvent):void{
 
 var alert:Alert = Alert.show(Are you sure? \n\n There is no
 Un-Do,
 'Delete *All Completed* ?',
 Alert.YES| Alert.NO,
 null,
 responseToDeleteAllCompletedHandler,
 null,
 Alert.NO);
 
 alert.move (parentDocument.width / 2 - alert.width/2,
 parentDocument.height /2 - alert.height / 2);
 }
 
 private function
 responseToDeleteAllCompletedHandler(evt:CloseEvent):void{
 
 if(evt.detail == Alert.YES)
 trace(Yes);
 else
 trace(No);
 }
 
 On Thu, Nov 12, 2009 at 4:26 PM, steveb805 quantumcheese...@...wrote:
 
 
 
  Seems like until now, my Alert boxes appear in the center ok.
 
  However, now that I am using a PopUpButton, and in response to one of the
  menu item clicks I am calling Alert.show(), the popup box is stuck at the
  upper left.
 
  My popupbutton handler:
 
  private function itemClickHandler(event:MenuEvent):void {
  switch (event.index) {
  case 0:
  ...
  case 1:
  Alert.show( Are you sure? \n\n There is no Un-Do,
  'Delete *All Completed* ?',
  Alert.YES| Alert.NO,
  null,
  responseToDeleteAllCompletedHandler,
  null,
  Alert.NO);
  default:
  }
  }
 
  For the parent parameter - which is supposed to be a Sprite - I tried
  this.parent, hoping this would fix it, but complained of type mismatch.
 
  Weird that the Alert works fine when calling it in response to normal
  buttons on my main panel, but all of a sudden the Alert is confused about
  the parent when calling the Alert.show in response to a *popup* type button.
 
  ( maybe I should download an updated Flex sdk? it's been a couple of
  months)
 
  Any advice would help
  tx,
  Steve
 
   
 





[flexcoders] Getting the Prev ious Index of a List (and Combo later)

2009-11-13 Thread steveb805
Hey all, It looks like my original plan to detect a user trying to change the 
List selection, and then stopping them from doing so isn't possible from what I 
can see. 

( The most hopeful sign that this is possible is the itemFocusOut event, but I 
can't use this, anyway, due to the editable value of my renderer 
(editable=false))

So my next best attempt to accomplish what I'm trying to do, is to get the last 
item that was just selected (the selectedIndex) before the user changed it.  

Is there anyway to do this without having to subclass the List ?

Thanks,
Steve



[flexcoders] The Alert box is at the Top Left.

2009-11-12 Thread steveb805
Seems like until now, my Alert boxes appear in the center ok.

However, now that I am using a PopUpButton, and in response to one of the menu 
item clicks I am calling Alert.show(), the popup box is stuck at the upper left.

My popupbutton handler:

private function itemClickHandler(event:MenuEvent):void {
switch (event.index) {
   case 0:
...
case 1:
Alert.show( Are you sure? \n\n  There is no Un-Do,
  'Delete *All Completed* ?',  
  Alert.YES| Alert.NO,
  null,
  responseToDeleteAllCompletedHandler,
  null,
  Alert.NO);
default:
}
}


For the parent parameter - which is supposed to be a Sprite - I tried 
this.parent, hoping this would fix it, but complained of type mismatch.

Weird that the Alert works fine when calling it in response to normal buttons 
on my main panel, but all of a sudden the Alert is confused about the parent 
when calling the Alert.show in response to a *popup* type button.

( maybe I should download an updated Flex sdk?  it's been a couple of months)

Any advice would help
tx,
Steve



[flexcoders] Re: The Alert box is at the Top Left.

2009-11-12 Thread steveb805
Thanks TH.  That's weird, there must be something else in my code, then as  I'm 
still not able to get it to the center.
 
My hierarchy in my main.mxml is
 mx.Application  mainPanel  myPopupButton

I tried 
  this.parent as Sprite
  and 
  mainPanel.parent as Sprite

And a couple of other things..

TH,
I'm not waiting on a solution from you specifically, because you were just 
explaining the facts about the popup specifically, and the need to cast that 
parameter.

Maybe someone else will see this who has run into this specific situation.

Steve
 


--- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote:

 Hi Steve,
 Popups exist outside the normal DisplayList, so you can work around it
 by setting the Alert's parent like this:
 Alert.show(your text, your title, 4, parentApplication as Sprite);
 -TH
 --- In flexcoders@yahoogroups.com, steveb805 
 wrote:
 
  Seems like until now, my Alert boxes appear in the center ok.
 
  However, now that I am using a PopUpButton, and in response to one of
 the menu item clicks I am calling Alert.show(), the popup box is stuck
 at the upper left.
 
  My popupbutton handler:
 
  private function itemClickHandler(event:MenuEvent):void {
  switch (event.index) {
 case 0:
  ...
  case 1:
  Alert.show( Are you sure? \n\n  There is no Un-Do,
'Delete *All Completed* ?',
Alert.YES| Alert.NO,
null,
responseToDeleteAllCompletedHandler,
null,
Alert.NO);
  default:
  }
  }
 
 
  For the parent parameter - which is supposed to be a Sprite - I tried
 this.parent, hoping this would fix it, but complained of type mismatch.
 
  Weird that the Alert works fine when calling it in response to normal
 buttons on my main panel, but all of a sudden the Alert is confused
 about the parent when calling the Alert.show in response to a *popup*
 type button.
 
  ( maybe I should download an updated Flex sdk?  it's been a couple of
 months)
 
  Any advice would help
  tx,
  Steve
 





[flexcoders] Get Notified if a Remoting Result event listener function *doesn't get called?

2009-11-09 Thread steveb805
This sounds vague, but basically it's:

My Zendamf remoting object has a 
fault=faultListener(event), which has an Alert.show statement.

However, I noticed that when I'm on my laptop, and my Net connection is flakey, 
this happens:

 I create a new Item that then gets added to my List object successfully, and 
the next step is to add to the database on the Server-end, so I call:
 myRemote.addNewTask(tempTask);

But there's no feedback , and although I see the new Item in my List this 
only means the Client side succeeds, but the DB save silently fails without a 
Fault event.

I have a Result event set up, but the resultListener function never gets 
called. 
It's not like I can do this:  if (!succeeds) then display fail, like 
you can on a normal php/mysql app.

And I just want to avoid having to go the reverse logic route to resolve this: 
When the Result event gets called, do an Alert.show().  Don't want to have to 
click OK everytime it's successful. ;/

Just wondering how anyone else handles this,
Thanks,
Steve




[flexcoders] Re: Get Notified if a Remoting Result event listener function *doesn't get cal

2009-11-09 Thread steveb805
Hi, thanks that was easy. I just added a  requestTimeout=20 for 20 sec to my 
RemoteObject component, and I already had a faultListener handler. 

In the faultlistener, I added a 

if (event.fault.faultCode == Client.Error.RequestTimeout)
 Alert.show(For some reason, the Server is taking too long to save/get 
this data, Houston, we have temporary connection problems);
else
   Alert.show(event.fault.message, Error);

This is for the benefit of anyone who finds this thread. Anyone want to 
add/change/improve, feel free
Steve

--- In flexcoders@yahoogroups.com, Roman Protsiuk roman.prots...@... wrote:

 Hi Steve,
 
 In the situation when there's no response from the server you'll eventually
 get request timeout fault. It's just the matter of how long is this timeout
 configured to be.
 
 Roman Protsiuk
 Software Engineer/Engineering Team Lead
 
 http://under.in.ua
 
 Kyiv, Ukraine (GMT+2)
 mobile: +38 097 321 56 54 email:
 roman.prots...@...%3C/span%3eroman.prots...@...
  skype: roman.protsiuk
 linkedin: http://www.linkedin.com/in/romanpv blogspot:
 http://roma-ch.blogspot.com
 I
 
 On Mon, Nov 9, 2009 at 8:48 PM, steveb805 quantumcheese...@...wrote:
 
 
 
  This sounds vague, but basically it's:
 
  My Zendamf remoting object has a
  fault=faultListener(event), which has an Alert.show statement.
 
  However, I noticed that when I'm on my laptop, and my Net connection is
  flakey, this happens:
 
  I create a new Item that then gets added to my List object successfully,
  and the next step is to add to the database on the Server-end, so I call:
  myRemote.addNewTask(tempTask);
 
  But there's no feedback , and although I see the new Item in my List this
  only means the Client side succeeds, but the DB save silently fails without
  a Fault event.
 
  I have a Result event set up, but the resultListener function never gets
  called.
  It's not like I can do this: if (!succeeds) then display fail, like
  you can on a normal php/mysql app.
 
  And I just want to avoid having to go the reverse logic route to resolve
  this: When the Result event gets called, do an Alert.show(). Don't want to
  have to click OK everytime it's successful. ;/
 
  Just wondering how anyone else handles this,
  Thanks,
  Steve
 
   
 





[flexcoders] Double clicking on a LIST item

2009-10-31 Thread steveb805
Is there any reason that itemDoubleClick would not produce an event ?

I'm trying this itemDoubleClick=evtHandler(event), but the function doesn't 
get called. The code for this list is below (but I don't have the 
itemdoubleclick in there now)

(ProjectList is an *.as file that overrides List just so that I could have the 
custom event for the checkbox)


mycomp:ProjectList 
  labelField=name 
  itemClick=OnItemClick(event)
  x=8 y=30 
  width=263 height=313
  id=projectList 
  itemRenderer=EditableTask
  dataProvider={projectListAC}
  clickTaskCheckBox=clickTaskCheckBoxHandler(event)/

-Steve



[flexcoders] Re: Double clicking on a LIST item

2009-10-31 Thread steveb805
Thanks Roman, I should have went to the ListBase link in the docs hierarchy 
menu, instead of giving up after not finding it in  
http://adobe.../mx/controls/List.html   


--- In flexcoders@yahoogroups.com, Roman Protsiuk roman.prots...@... wrote:

 Quote from the docs:
 To receive itemDoubleClick events, you must set the component's
 doubleClickEnabled property to true.
 
 Roman
 
 
 
 On Sat, Oct 31, 2009 at 10:16 PM, steveb805 quantumcheese...@...wrote:
 
 
 
  Is there any reason that itemDoubleClick would not produce an event ?
 
  I'm trying this itemDoubleClick=evtHandler(event), but the function
  doesn't get called. The code for this list is below (but I don't have the
  itemdoubleclick in there now)
 
  (ProjectList is an *.as file that overrides List just so that I could have
  the custom event for the checkbox)
 
  mycomp:ProjectList
  labelField=name
  itemClick=OnItemClick(event)
  x=8 y=30
  width=263 height=313
  id=projectList
  itemRenderer=EditableTask
  dataProvider={projectListAC}
  clickTaskCheckBox=clickTaskCheckBoxHandler(event)/
 
  -Steve
 
   
 





[flexcoders] Getting rid of the Scrollbar in the List Item

2009-10-27 Thread steveb805
After a marathon Google-fest/Adobe Help Site search, I have not been able to 
figure out how an elegant, best-practice, or any other way to get rid of the 
horizontal scroll bar that appears when some text doesn't fit into an Item.  

You probably have been through this before, but I'll show you the image of my 
List control:

http://www.lucidrhino.com/images/list_image.JPG


Should I simply, in my custom ItemRenderer, just check the length of that field 
(which is data.description) and simply truncate it to some short arbitrary 
length ?

Sounds the most straightforward way.

Thanks,
Steve



[flexcoders] Accessing a child component,, specifically a checkbox, from an mxml component

2009-10-26 Thread steveb805
First of all, thanks for the responses concerning the List Items-detecting.  
Hopefully those responses made it. I'm on the Probation list where it takes a 
while to get approved.
--

This next particular issue is really disturbing me, but it's probably pretty 
simple.

I have a mxml file containing a custom component, called EditTaskBox. It's a 
TitleWindow and it's in my components folder.

In main.mxml, I have this to create a custom popup:

var win:TitleWindow = TitleWindow(PopUpManager.createPopUp(this, EditTaskBox, 
true));

( I need to set win.title = something, so I cast the return to a TitleWindow 
type. )

There is a checkbox in that component, a nested child, but I can't seem to 
control it in Actionscript from main.mxml.  

I can't use EditTaskBox.mycheckbox, because it Understandably complains with 
possibly undefined project through reference with static type class.   And 
trying win.mycheckbox doesn't work of course, either.

My googling turned up empty.
Hoping someone knew about this.
Steve








[flexcoders] Detect if any of the Items on a List are Selected - thought it would be easier.

2009-10-25 Thread steveb805

The only property I could find, from the Flex docs, that tells you whether your 
List control has anything selected is: isItemSelected().

And this takes a parameter that refers to a specific item.  So before my Delete 
button handler, I check if any item is selected with the following:

private function deleteHandler() {

var bDoesNotHasFocus: Boolean = true;
var len:Number = projectList.dataProvider.length;

for (var i:int = 0; i = len - 1; i++) {
  if (projectList.isItemSelected(projectList.dataProvider[i])) 
  {
bDoesNotHasFocus = false;
  }
}
if (bDoesNotHasFocus)
  return;

  // the code to delete

}

Is there a better way, anyone?
Thanks,
Steve



[flexcoders] Best way to call SQL LAST_INSERT_ID through Zend Amf

2009-10-22 Thread steveb805
Hi,
I'm mostly a newbie and am writing a simple Flex app. So far, just a List box, 
where I am renderering a Checkbox and a :abel field, for a simple To-Do utility.

I just added the Add New task functionality, and it's working fine, using the 
addItem method to add the new object to the List after saving the record to DB 
via ZendAmf.

However it has occurred to me that I need to go back to the database 
immediately after, to get the record Id via ZendAmf so that the Flex List's new 
Item has the actual database id.

Is it best practice you think to create a ValueObject class for just this 
integer  - the task_id key field - or should I simply just use the existing 
Value Object for the entire object that represents an entire Task and 
obviously, just use the task_id field to pass it from db to flex.

Steve