[flexcoders] Preventing default onClick-behaviour in List-Component
Hi all, I want to cancel a list component to change the selection under some circumstances. Neither works: list.addEventListener( ListEvent.ITEM_CLICK, handleChange ); list.addEventListener( ListEvent.CHANGE, handleChange ); private function handleChange (e:ListEvent):void { e.preventDefault(); return; } To workaround I tried to manually set selectedIndex to the selected value prior user-click, but I´m also unable to retrieve the previous value. I read a post by Alex Harui, where he suggested to use the change-event in capture phase, but that doesnt ever get fired. Thanks for directions! carsten -- View this message in context: http://www.nabble.com/Preventing-default-onClick-behaviour-in-List-Component-tf4850282.html#a13877597 Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Re: PopupMenuButton: Want to stop the click event and only have the itemClick ev
This post´s a little long ago, but I thought I´d post an answer anyway: one can achieve the desired behaviour easily by creating a custom component that extends PopUpMenuButton. In your custom component just override the clickHandler-method like this: override protected function clickHandler(event:MouseEvent):void { //super.clickHandler(event); -- do NOT envoke PopUpMenuButton´s .clickHandler() } In mxml U can then define your own handler only for the button controls (eg. open the menu only, dont call itemClick-Handler automatically): controls:myPopUpMenuButton click = { event.target.open() } itemClick = { myItemClickHandler(event) } / hth carsten --- In flexcoders@yahoogroups.com, paromitadey [EMAIL PROTECTED] wrote: Hello Everybody, I am working with a PopupMnuButton. The PopupMenuButton is skined so the selected value is not visible. The menu has four items which when clicked performs respective operations. But when the main button of the PopupMenuButton is clicked it performs the operation for the first menu item. I wish to stop that from happening. Going through the help files I found that PopupMenuButton dispatches a click event when the main button part of the PopupMenuButton is clicked, which further dispatches the itemClick event for the last selected index. Is there a way around to stop the click event from firing when the main button is clicked? I dont want any action to take place if the button is clicked. The user has to select an item from the menu. Please advise. Regards, Paromita
[flexcoders] Re: Cairngorm FMS
Ah, there we go...very cool! Having the NetConnection as service that creates a SharedObjectListener class dispatching Cairngorm-events is looking good and also feels Cairngormy enough for me now ; ) Thx a bunch, mate carsten --- In flexcoders@yahoogroups.com, michael.ritchie [EMAIL PROTECTED] wrote: Ah, man, totally gave you the wrong information, sorry about that. I posted another project that does use Flex/FMS/Cairngorm. The project won't run out of the box, you need to have FMS and CF running locally, but you can walk through the structure. Thanks man! http://thanksmister.com/?p=39 Michael Ritchie AOL Xdrive --- In flexcoders@yahoogroups.com, carkraus carsten.kraus@ wrote: Hey Michael, actually I stumbled upon your nice article before posting on flexcoders already : ) It helped me getting started with Flex/FMS at all, so thx anyway!! But: your example is not using Cairngorm at all, or am I missing something? Regards carsten --- In flexcoders@yahoogroups.com, Michael Ritchie xmritchie@ wrote: Carsten, I built out a small chat application using Cairngorm, Flex and FMS a while back. I chose to create some public functions to receive the callback methods from the NetConnection and SharedObject. I had to struggled with to make it feel right in the Cairngorm architecture, but I think its a good solution. Remember, Cairngorm is a meant to be modified to fit your needs, it is not engraved in stone that everything must fit in the current architecture. Have a look and see if it helps at all. You can find the sample zip file here: http://thanksmister.com/?p=26 Michael Ritchie Senior Software Engineer AOL Xdrive --- In flexcoders@yahoogroups.com, carkraus carsten.kraus@ wrote: Hi Thijs, while nc = new NetConnection() is defined in my main application, right now, I actually connect to FMS inside the command layer, ie. in LoginCommand. Here, inside execute() I register listeners to ie. LoginCommand.onAccept(...). So: the business / service layer is not used at all at the moment...thus, I feel like not following Cairngorm best practice. Also I guess using SharedObjects lateron would really benefit from the frameworks workflow. Here�s another thread on the issue: http://tech.groups.yahoo.com/group/flexcoders/message/59795, which I commented on. No answer yet, though. regards carsten --- In flexcoders@yahoogroups.com, Thijs Triemstra lists@ wrote: Where do you create the NetConnection? I want to use Cairngorm for a Red5 test app [1] and was thinking of adding NetConnection support to the ServiceLocator. Cairngorm's ServiceLocator supports http, remoteobject, webservice and fds but i don't see FMS/netconnection support.. Maybe NetStream can also be in ServiceLocator and the result from netconnection calls could then be handled by a command's result handler.. I don't know yet how to catch the status events though.. this.service = ServiceLocator.getInstance().getNetConnection( red5 ); this.service = ServiceLocator.getInstance().getNetStream( my_ns ); Thijs [1] http://www.red5.nl/tools/publisher Op 31-dec-2006, om 18:10 heeft carkraus het volgende geschreven: Hi all, I´m looking for a good way to use NetStatus events SharedObjects onSync-data inside the Cairngorm framework. Right now, I´m treating these in the Command layer, which I feel is not really making sense too much. Can anybody provide me with some help, links to resources or similar? Thx for any hint happy new year everyone : ) carsten
[flexcoders] Re: Cairngorm FMS
Hey Michael, actually I stumbled upon your nice article before posting on flexcoders already : ) It helped me getting started with Flex/FMS at all, so thx anyway!! But: your example is not using Cairngorm at all, or am I missing something? Regards carsten --- In flexcoders@yahoogroups.com, Michael Ritchie [EMAIL PROTECTED] wrote: Carsten, I built out a small chat application using Cairngorm, Flex and FMS a while back. I chose to create some public functions to receive the callback methods from the NetConnection and SharedObject. I had to struggled with to make it feel right in the Cairngorm architecture, but I think its a good solution. Remember, Cairngorm is a meant to be modified to fit your needs, it is not engraved in stone that everything must fit in the current architecture. Have a look and see if it helps at all. You can find the sample zip file here: http://thanksmister.com/?p=26 Michael Ritchie Senior Software Engineer AOL Xdrive --- In flexcoders@yahoogroups.com, carkraus carsten.kraus@ wrote: Hi Thijs, while nc = new NetConnection() is defined in my main application, right now, I actually connect to FMS inside the command layer, ie. in LoginCommand. Here, inside execute() I register listeners to ie. LoginCommand.onAccept(...). So: the business / service layer is not used at all at the moment...thus, I feel like not following Cairngorm best practice. Also I guess using SharedObjects lateron would really benefit from the frameworks workflow. Here�s another thread on the issue: http://tech.groups.yahoo.com/group/flexcoders/message/59795, which I commented on. No answer yet, though. regards carsten --- In flexcoders@yahoogroups.com, Thijs Triemstra lists@ wrote: Where do you create the NetConnection? I want to use Cairngorm for a Red5 test app [1] and was thinking of adding NetConnection support to the ServiceLocator. Cairngorm's ServiceLocator supports http, remoteobject, webservice and fds but i don't see FMS/netconnection support.. Maybe NetStream can also be in ServiceLocator and the result from netconnection calls could then be handled by a command's result handler.. I don't know yet how to catch the status events though.. this.service = ServiceLocator.getInstance().getNetConnection( red5 ); this.service = ServiceLocator.getInstance().getNetStream( my_ns ); Thijs [1] http://www.red5.nl/tools/publisher Op 31-dec-2006, om 18:10 heeft carkraus het volgende geschreven: Hi all, I´m looking for a good way to use NetStatus events SharedObjects onSync-data inside the Cairngorm framework. Right now, I´m treating these in the Command layer, which I feel is not really making sense too much. Can anybody provide me with some help, links to resources or similar? Thx for any hint happy new year everyone : ) carsten
[flexcoders] Re: Cairngorm FMS
Hi Thijs, while nc = new NetConnection() is defined in my main application, right now, I actually connect to FMS inside the command layer, ie. in LoginCommand. Here, inside execute() I register listeners to ie. LoginCommand.onAccept(...). So: the business / service layer is not used at all at the moment...thus, I feel like not following Cairngorm best practice. Also I guess using SharedObjects lateron would really benefit from the frameworks workflow. Here´s another thread on the issue: http://tech.groups.yahoo.com/group/flexcoders/message/59795, which I commented on. No answer yet, though. regards carsten --- In flexcoders@yahoogroups.com, Thijs Triemstra [EMAIL PROTECTED] wrote: Where do you create the NetConnection? I want to use Cairngorm for a Red5 test app [1] and was thinking of adding NetConnection support to the ServiceLocator. Cairngorm's ServiceLocator supports http, remoteobject, webservice and fds but i don't see FMS/netconnection support.. Maybe NetStream can also be in ServiceLocator and the result from netconnection calls could then be handled by a command's result handler.. I don't know yet how to catch the status events though.. this.service = ServiceLocator.getInstance().getNetConnection( red5 ); this.service = ServiceLocator.getInstance().getNetStream( my_ns ); Thijs [1] http://www.red5.nl/tools/publisher Op 31-dec-2006, om 18:10 heeft carkraus het volgende geschreven: Hi all, I´m looking for a good way to use NetStatus events SharedObjects onSync-data inside the Cairngorm framework. Right now, I´m treating these in the Command layer, which I feel is not really making sense too much. Can anybody provide me with some help, links to resources or similar? Thx for any hint happy new year everyone : ) carsten
[flexcoders] Cairngorm FMS
Hi all, I´m looking for a good way to use NetStatus events SharedObjects onSync-data inside the Cairngorm framework. Right now, I´m treating these in the Command layer, which I feel is not really making sense too much. Can anybody provide me with some help, links to resources or similar? Thx for any hint happy new year everyone : ) carsten
[flexcoders] Re: Cairngorm 2 with FMS and SharedObjects
Hi Owen, I´m also about to use Cairngorm with FMS / SharedObjects - did U find useful resources on the issue in the end? Have U been succesful with your approach? Thx for any hint! Carsten --- In flexcoders@yahoogroups.com, Owen van Dijk [EMAIL PROTECTED] wrote: Hi all, I'm implementing a project now using Cairngorm's framework and uses FMS to provide multi-user capabilities through SharedObjects. It uses the SharedObject onResult handlers to update the model ( concurrent users, number of users connected etc ). Where in the architecture would this functionality fit best? I'd assume i would create a NetConnection 'service' and create a Delegate for the SharedObject and handle the Result and Fault handlers in a Command but this feels a bit weird because the SharedObject is 'persistent', not in the context of persistent SharedObjects but persistent that they are never deleted. I'd believe that Commands can be created and execution ends when the execute method returns ( or it's onResult/onFault handlers ). What do you think, should i implemented as suggested above or is there something i'm missing? -- Owen van Dijk
[flexcoders] Re: AMFPHP / databinding nested arrays
Hi Patrick, thx a bunch already for answering!! Actually my example will already allow me to access the values like: trace( myResultObject[0].day );// prints 'Mon' trace( myResultObject[0].[0].start ); // prints '100' ... But I guess there´s no way to use e.g. that 'start' value directly via MXML binding, hm? I should rather be using a custom renderer for it or flatten the aray on the client pre-binding?! The latter(flatten array on client) just 'feels' a little uncomfortable, as well as it feels not too good to change the data structure in the backend 'only' for flex. thx again regards carsten --- In flexcoders@yahoogroups.com, [EMAIL PROTECTED] wrote: The way you constructed your array might come out like this, but not sure, looks a little crazy myResultObject[0].day.mon.start.100.end.300 Nested Arrays return into Flex as objects. I haven't tried nesting an array as complicated as this, I guess it's doable but it might be better to reorganize your array structure . I think it will be easier to read than a big old nested array constructor than in php if you use the following example, and this is how I do it. ? $my_array = array(); $my_array[0]['days'] =$some array $my_array[0]['starts'] =$some_other_array Return $my_array; ? //in flex your result arrays work like this... Var someArray:Array = myResultObject[0].days Var someOtherArray:Array = myResultObject[0].starts Then you can get your values and organize your arrays which ever way you like. Hope this Helps Patrick From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of carkraus Sent: Tuesday, December 05, 2006 11:19 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] AMFPHP / databinding nested arrays Hi there, I guess this is a typical newbie question, maybe someone could kindly direct me to a tutorial or sample: I try to bind e.g. using a charts control to a nested array I receive from an AMFPHP service. On the php side I have as an example: $outputArr[] = array('day' = 'Mon', array('start' = '100', 'end' = '300')); $outputArr[] = array('day' = 'Tue', array('start' = '250', 'end' = '600')); $outputArr[] = array('day' = 'Wed', array('start' = '500', 'end' = '600')); return $outputArr; ..which will deliver the data correctly as I can see from the flex debugger. In flex I have eg.: mx:series mx:ColumnSeries xField=day yField=??? / /mx:series Now, how do I access e.g. the value 'start' to use it for databinding? Well, 'day.start' does not do the trick : ) I had similar probs using XML for binding, where I wouldnt be able to access sub-children? Do I have to somehow wrap the server response into an actionscript object which I'd have to manually add properties to? Any hint greatly appreciated!! carsten
[flexcoders] AMFPHP / databinding nested arrays
Hi there, I guess this is a typical newbie question, maybe someone could kindly direct me to a tutorial or sample: I try to bind e.g. using a charts control to a nested array I receive from an AMFPHP service. On the php side I have as an example: $outputArr[] = array('day' = 'Mon', array('start' = '100', 'end' = '300')); $outputArr[] = array('day' = 'Tue', array('start' = '250', 'end' = '600')); $outputArr[] = array('day' = 'Wed', array('start' = '500', 'end' = '600')); return $outputArr; ..which will deliver the data correctly as I can see from the flex debugger. In flex I have eg.: mx:series mx:ColumnSeries xField=day yField=??? / /mx:series Now, how do I access e.g. the value 'start' to use it for databinding? Well, 'day.start' does not do the trick : ) I had similar probs using XML for binding, where I wouldnt be able to access sub-children? Do I have to somehow wrap the server response into an actionscript object which I'd have to manually add properties to? Any hint greatly appreciated!! carsten
[flexcoders] Re: beta3 -- Binding XML data to List Controls -- data binding experts?
Hi Tim, Jim, any news on the issue yet? I´m a flash developer just starting with Flex and also wonder what the best way to message/bind/modify ie. XML data to controls is. In addition to Tim´s question, I also would like to process some values on the client. Example: I have user data in an xml-file. I then take ie. name email values directly from the file to populate a grid while I would like to process 'last login' values in Flex so I can use date-sorting, etc... How do I declare the data type for each received value in a list control? I would love to hear any hint to start my flex work the right way. Thx in advance! Carsten --- In flexcoders@yahoogroups.com, sufibaba [EMAIL PROTECTED] wrote: Hi Jim, Thanks for the tip. I just tried it and it's giving me an error saying that it could not convert my xmldata. My data is coming back from a remoting service and it is typed as XMLList. In addition, my xml has a root node. Any ideas why I am getting an error. Cheers, Tim --- In flexcoders@yahoogroups.com, Jim Robson jim.robson@ wrote: This is what I've done; it's simple and it works. mx:Model id=eventListData source=eventList.xml / mx:ArrayCollection id=acEventList source={eventListData.events.event} / mx:DataGridid=dgEventList dataProvider={acEventList} mx:columns mx:DataGridColumn headerText=Header01 dataField=element01 width=120 / mx:DataGridColumn headerText=Header04 dataField=element02 width=50 / mx:DataGridColumn headerText=Header03 dataField=element03 width=50 / /mx:columns /mx:DataGrid _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sufibaba Sent: Thursday, June 08, 2006 12:06 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] beta3 -- Binding XML data to List Controls -- data binding experts? Hi all, I have XML data that is being returned from a remoting service. I would like to bind this data directly to various List-based controls (As I understand it, List controls like Arrays/ArrayCollections). What is the best way to massage the incoming XML data so that it can be binded directly to List controls. Any insight is greatly Appreciated. Cheers, Tim -- 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/