[flexcoders] Re: ToggleButtonBar xml based dataProvider (2)
most definately, just loop thru the dataprovider during the ToggleButtonBar's initialize or creationComplete event and set each button's icon. -- In flexcoders@yahoogroups.com, "markgoldin_2000" wrote: > > Yeah, I see it now too. > Do think it's possible to set an icon for a button at run time? > > --- In flexcoders@yahoogroups.com, "bhaq1972" wrote: > > > > i'm no expert but i'd suggest not using XML as the > > dataprovideronly because of what the docs say and looking at > the > > code prior to line 378 in NavBar.as > > > > I modified your dataprovider to look like this > > > > > > > > > > etc.. > > > > > > > > And it works fine. > > > > > > > > > > --- In flexcoders@yahoogroups.com, "markgoldin_2000" > > wrote: > > > > > > Still can't understand why the following does not work: > > > code: > > > > > iconField="icon" > > > horizontalGap="5" itemClick="clickHandler > > > (event);" labelField="label" > > > creationComplete="floorLinesData();" > > > height="100%" fontSize="8" fontWeight="bold"/> > > > > > > data: > > > > > > > > > 4 > > > G2 > > > true > > > > > "@Embed('D:/projects/sfcs/assets/status_online.png')" > > > > > > > > > > > > > > > code: > > > floorlines.dataProvider = resultXML.lines; > > > > > > error: > > > Error: ERROR: The dataProvider of 'floorlines' must not contain > > > objects of type flash.display.DisplayObject. > > > at mx.controls::NavBar/set dataProvider()[C:\autobuild\3.2.0 > > > \frameworks\projects\framework\src\mx\controls\NavBar.as:378] > > > at tasktracking/floorLinesShowData() > > > [D:\projects\sfcs\tasktracking\src\tasktracking.mxml:107] > > > at modulecode::Classes/httpResult() > > > [D:\projects\sfcs\UFDCommonLib\src\modulecode\Classes.as:62] > > > at flash.events::EventDispatcher/dispatchEventFunction() > > > at flash.events::EventDispatcher/dispatchEvent() > > > at > > > > > > mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::di > > > spatchRpcEvent()[C:\autobuild\3.2.0 > > > \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170] > > > at > > > > > > mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::re > > > sultHandler()[C:\autobuild\3.2.0 > > > \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193] > > > at mx.rpc::Responder/result()[C:\autobuild\3.2.0 > > > \frameworks\projects\rpc\src\mx\rpc\Responder.as:43] > > > at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0 > > > \frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] > > > at DirectHTTPMessageResponder/completeHandler() > > > [C:\autobuild\3.2.0 > > > > > > \frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.a > > > s:403] > > > at flash.events::EventDispatcher/dispatchEventFunction() > > > at flash.events::EventDispatcher/dispatchEvent() > > > at flash.net::URLLoader/onComplete() > > > > > > Thanks > > > > > >
Re: [flexcoders] Re: ToggleButtonBar xml based dataProvider (2)
Not by default, but there are about a million and a half examples if you search the web. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: markgoldin_2000 Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: ToggleButtonBar xml based dataProvider (2) Date: Thu, 26 Feb 2009 17:36:09 - Yeah, I see it now too. Do think it's possible to set an icon for a button at run time? --- In flexcoders@yahoogroups.com, "bhaq1972" wrote: > > i'm no expert but i'd suggest not using XML as the > dataprovideronly because of what the docs say and looking at the > code prior to line 378 in NavBar.as > > I modified your dataprovider to look like this > > > > > etc.. > > > > And it works fine. > > > > > --- In flexcoders@yahoogroups.com, "markgoldin_2000" > wrote: > > > > Still can't understand why the following does not work: > > code: > > > iconField="icon" > > horizontalGap="5" itemClick="clickHandler > > (event);" labelField="label" > > creationComplete="floorLinesData();" > > height="100%" fontSize="8" fontWeight="bold"/> > > > > data: > > > > > > 4 > > G2 > > true > > > "@Embed('D:/projects/sfcs/assets/status_online.png')" > > > > > > > > > > code: > > floorlines.dataProvider = resultXML.lines; > > > > error: > > Error: ERROR: The dataProvider of 'floorlines' must not contain > > objects of type flash.display.DisplayObject. > > at mx.controls::NavBar/set dataProvider()[C:\autobuild\3.2.0 > > \frameworks\projects\framework\src\mx\controls\NavBar.as:378] > > at tasktracking/floorLinesShowData() > > [D:\projects\sfcs\tasktracking\src\tasktracking.mxml:107] > > at modulecode::Classes/httpResult() > > [D:\projects\sfcs\UFDCommonLib\src\modulecode\Classes.as:62] > > at flash.events::EventDispatcher/dispatchEventFunction() > > at flash.events::EventDispatcher/dispatchEvent() > > at > > > mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::di > > spatchRpcEvent()[C:\autobuild\3.2.0 > > \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170] > > at > > > mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::re > > sultHandler()[C:\autobuild\3.2.0 > > \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193] > > at mx.rpc::Responder/result()[C:\autobuild\3.2.0 > > \frameworks\projects\rpc\src\mx\rpc\Responder.as:43] > > at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0 > > \frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] > > at DirectHTTPMessageResponder/completeHandler() > > [C:\autobuild\3.2.0 > > > \frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.a > > s:403] > > at flash.events::EventDispatcher/dispatchEventFunction() > > at flash.events::EventDispatcher/dispatchEvent() > > at flash.net::URLLoader/onComplete() > > > > Thanks > > >
[flexcoders] Re: ToggleButtonBar xml based dataProvider (2)
Yeah, I see it now too. Do think it's possible to set an icon for a button at run time? --- In flexcoders@yahoogroups.com, "bhaq1972" wrote: > > i'm no expert but i'd suggest not using XML as the > dataprovideronly because of what the docs say and looking at the > code prior to line 378 in NavBar.as > > I modified your dataprovider to look like this > > > > > etc.. > > > > And it works fine. > > > > > --- In flexcoders@yahoogroups.com, "markgoldin_2000" > wrote: > > > > Still can't understand why the following does not work: > > code: > > > iconField="icon" > > horizontalGap="5" itemClick="clickHandler > > (event);" labelField="label" > > creationComplete="floorLinesData();" > > height="100%" fontSize="8" fontWeight="bold"/> > > > > data: > > > > > > 4 > > G2 > > true > > > "@Embed('D:/projects/sfcs/assets/status_online.png')" > > > > > > > > > > code: > > floorlines.dataProvider = resultXML.lines; > > > > error: > > Error: ERROR: The dataProvider of 'floorlines' must not contain > > objects of type flash.display.DisplayObject. > > at mx.controls::NavBar/set dataProvider()[C:\autobuild\3.2.0 > > \frameworks\projects\framework\src\mx\controls\NavBar.as:378] > > at tasktracking/floorLinesShowData() > > [D:\projects\sfcs\tasktracking\src\tasktracking.mxml:107] > > at modulecode::Classes/httpResult() > > [D:\projects\sfcs\UFDCommonLib\src\modulecode\Classes.as:62] > > at flash.events::EventDispatcher/dispatchEventFunction() > > at flash.events::EventDispatcher/dispatchEvent() > > at > > > mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::di > > spatchRpcEvent()[C:\autobuild\3.2.0 > > \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170] > > at > > > mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::re > > sultHandler()[C:\autobuild\3.2.0 > > \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193] > > at mx.rpc::Responder/result()[C:\autobuild\3.2.0 > > \frameworks\projects\rpc\src\mx\rpc\Responder.as:43] > > at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0 > > \frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] > > at DirectHTTPMessageResponder/completeHandler() > > [C:\autobuild\3.2.0 > > > \frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.a > > s:403] > > at flash.events::EventDispatcher/dispatchEventFunction() > > at flash.events::EventDispatcher/dispatchEvent() > > at flash.net::URLLoader/onComplete() > > > > Thanks > > >
[flexcoders] Re: ToggleButtonBar xml based dataProvider (2)
i'm no expert but i'd suggest not using XML as the dataprovideronly because of what the docs say and looking at the code prior to line 378 in NavBar.as I modified your dataprovider to look like this etc.. And it works fine. --- In flexcoders@yahoogroups.com, "markgoldin_2000" wrote: > > Still can't understand why the following does not work: > code: > iconField="icon" > horizontalGap="5" itemClick="clickHandler > (event);" labelField="label" > creationComplete="floorLinesData();" > height="100%" fontSize="8" fontWeight="bold"/> > > data: > > > 4 > G2 > true > "@Embed('D:/projects/sfcs/assets/status_online.png')" > > > > > code: > floorlines.dataProvider = resultXML.lines; > > error: > Error: ERROR: The dataProvider of 'floorlines' must not contain > objects of type flash.display.DisplayObject. > at mx.controls::NavBar/set dataProvider()[C:\autobuild\3.2.0 > \frameworks\projects\framework\src\mx\controls\NavBar.as:378] > at tasktracking/floorLinesShowData() > [D:\projects\sfcs\tasktracking\src\tasktracking.mxml:107] > at modulecode::Classes/httpResult() > [D:\projects\sfcs\UFDCommonLib\src\modulecode\Classes.as:62] > at flash.events::EventDispatcher/dispatchEventFunction() > at flash.events::EventDispatcher/dispatchEvent() > at > mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::di > spatchRpcEvent()[C:\autobuild\3.2.0 > \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170] > at > mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::re > sultHandler()[C:\autobuild\3.2.0 > \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193] > at mx.rpc::Responder/result()[C:\autobuild\3.2.0 > \frameworks\projects\rpc\src\mx\rpc\Responder.as:43] > at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0 > \frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] > at DirectHTTPMessageResponder/completeHandler() > [C:\autobuild\3.2.0 > \frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.a > s:403] > at flash.events::EventDispatcher/dispatchEventFunction() > at flash.events::EventDispatcher/dispatchEvent() > at flash.net::URLLoader/onComplete() > > Thanks >
[flexcoders] Re: ToggleButtonBar xml based dataProvider
Not a problem at all. The following works fine: for each(var node:XML in resultXML..label) { taskList.push(node.toString()); floorTasks.dataProvider = taskList;
[flexcoders] Re: ToggleButtonBar xml based dataProvider
data: 2 BOXING 5 CUTTING 8 GENERAL LABOR 6 MACHINE OPERATORS 3 PACKING 4 QUILTING 1 SEWING 7 SILO FILLERS Code: floorTasks.dataProvider = resultXML..label; Error: Error: ERROR: The dataProvider of 'floorTasks' must not contain objects of type flash.display.DisplayObject. at mx.controls::NavBar/set dataProvider()[C:\autobuild\3.2.0 \frameworks\projects\framework\src\mx\controls\NavBar.as:378] at tasktracking/floorTasksShowData() [D:\projects\sfcs\tasktracking\src\tasktracking.mxml:39] at modulecode::Classes/httpResult() [D:\projects\sfcs\UFDCommonLib\src\modulecode\Classes.as:62] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::di spatchRpcEvent()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::re sultHandler()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193] at mx.rpc::Responder/result()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\Responder.as:43] at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] at DirectHTTPMessageResponder/completeHandler() [C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.a s:403] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete()
[flexcoders] Re: ToggleButtonBar xml based dataProvider
Component id is floorTasks. --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote: > > If floortasks is a component, then this makes no sense: > > taskList = XMLList(resultXML.floortasks); > > > > You need to use the xml data for the dataProvider not the component. > > > > Tracy Spratt > Lariat Services > > Flex development bandwidth available > > > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of markgoldin_2000 > Sent: Saturday, February 21, 2009 6:23 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: ToggleButtonBar xml based dataProvider > > > > No, can't get it work: > taskList = XMLList(resultXML.floortasks); > floorTasks.dataProvider = taskList; > > floorTasks is my ToggleButtonBar. I am getting: > The dataProvider of 'floorTasks' must not contain objects of type > flash.display.DisplayObject. > With XMLListCollection I am getting: > taskList = XMLListCollection(resultXML.floortasks); > floorTasks.dataProvider = taskList; > Type Coercion failed: cannot convert xmll...@52e5901 to > mx.collections.XMLListCollection > > This works without errors: > taskList = Array([resultXML.floortasks]); > floorTasks.dataProvider = taskList; > > But I am getting just one button with no text. > > My data is this: > BOXING > CUTTING > GENERAL LABOR > MACHINE OPERATORS > PACKING > QUILTING > SEWING > SILO FILLERS > > Thanks for help. > > --- In flexcoders@yahoogroups.com <mailto:flexcoders% 40yahoogroups.com> > , "Tracy Spratt" wrote: > > > > Certainly. Why would you think not? > > > > > > > > Though to speak accurately, you would use XMLList or > XMLListCollection > > as the dataProvider. > > > > > > > > Tracy Spratt > > Lariat Services > > > > Flex development bandwidth available > > > > > > > > From: flexcoders@yahoogroups.com <mailto:flexcoders% 40yahoogroups.com> > > [mailto:flexcoders@yahoogroups.com <mailto:flexcoders% 40yahoogroups.com> > ] On > > Behalf Of markgoldin_2000 > > Sent: Friday, February 20, 2009 3:46 PM > > To: flexcoders@yahoogroups.com <mailto:flexcoders% 40yahoogroups.com> > > Subject: [flexcoders] ToggleButtonBar xml based dataProvider > > > > > > > > Is that possible? > > > > Thanks > > >
RE: [flexcoders] Re: ToggleButtonBar xml based dataProvider
If floortasks is a component, then this makes no sense: taskList = XMLList(resultXML.floortasks); You need to use the xml data for the dataProvider not the component. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of markgoldin_2000 Sent: Saturday, February 21, 2009 6:23 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: ToggleButtonBar xml based dataProvider No, can't get it work: taskList = XMLList(resultXML.floortasks); floorTasks.dataProvider = taskList; floorTasks is my ToggleButtonBar. I am getting: The dataProvider of 'floorTasks' must not contain objects of type flash.display.DisplayObject. With XMLListCollection I am getting: taskList = XMLListCollection(resultXML.floortasks); floorTasks.dataProvider = taskList; Type Coercion failed: cannot convert xmll...@52e5901 to mx.collections.XMLListCollection This works without errors: taskList = Array([resultXML.floortasks]); floorTasks.dataProvider = taskList; But I am getting just one button with no text. My data is this: BOXING CUTTING GENERAL LABOR MACHINE OPERATORS PACKING QUILTING SEWING SILO FILLERS Thanks for help. --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Tracy Spratt" wrote: > > Certainly. Why would you think not? > > > > Though to speak accurately, you would use XMLList or XMLListCollection > as the dataProvider. > > > > Tracy Spratt > Lariat Services > > Flex development bandwidth available > > > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of markgoldin_2000 > Sent: Friday, February 20, 2009 3:46 PM > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] ToggleButtonBar xml based dataProvider > > > > Is that possible? > > Thanks >
[flexcoders] Re: ToggleButtonBar xml based dataProvider
No, can't get it work: taskList = XMLList(resultXML.floortasks); floorTasks.dataProvider = taskList; floorTasks is my ToggleButtonBar. I am getting: The dataProvider of 'floorTasks' must not contain objects of type flash.display.DisplayObject. With XMLListCollection I am getting: taskList = XMLListCollection(resultXML.floortasks); floorTasks.dataProvider = taskList; Type Coercion failed: cannot convert xmll...@52e5901 to mx.collections.XMLListCollection This works without errors: taskList = Array([resultXML.floortasks]); floorTasks.dataProvider = taskList; But I am getting just one button with no text. My data is this: BOXING CUTTING GENERAL LABOR MACHINE OPERATORS PACKING QUILTING SEWING SILO FILLERS Thanks for help. --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote: > > Certainly. Why would you think not? > > > > Though to speak accurately, you would use XMLList or XMLListCollection > as the dataProvider. > > > > Tracy Spratt > Lariat Services > > Flex development bandwidth available > > > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of markgoldin_2000 > Sent: Friday, February 20, 2009 3:46 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] ToggleButtonBar xml based dataProvider > > > > Is that possible? > > Thanks >