|
I am using both mxml and AS - works in both. Try to
use trace in setValue to verify if the trace output is sent. Also, I am not sure
what you mean by saying that you add mxml dynamically - it is either referenced
in the code statically with var _fake:com.StatusPicker=null; or has to be in RSL preloaded into the
application.
HTH,
Anatole
----- Original Message -----
Sent: Tuesday, February 07, 2006 1:17
PM
Subject: [flexcoders] Re: cellRenderer
not recognizing click events for Custom Mxml Cell Renderer
I have traces at the beginning of my 'arrowClick'
method which is linked to the click event of the button. When the mxml file
is applied to the mx:DataGrid cellRenderer...I see all traces. However when
I add the mxml file dynamically, I do not see the trace of my
'arrowClick' function.
I'm creating my datagrid dynamically from a
XML file (mx:model). It looks like
this:
<columns> <column
name="TRIP_STATUS" headerText="Status"
width="58" cellRenderer="com.StatusPicker" />
<column name="VEHICLE_NUM" headerText="Veh" width="40" editable="false"
/> ....etc... </columns>
in which case I'd loop through
the model and call: if(column.cellRenderer !=
undefined) { _dgc.cellRenderer =
column.cellRenderer; }
It renders the component, but the click event
doesn't call the method. Are you using pure ActionScript classes as your
cellRenderers or mxml files? I think I'm missing something when I just add
the mxml file in the code below as if the children are not getting created
correctly.
Thanks again for your help.
--- In
[email protected], "Anatole Tartakovsky" <[EMAIL PROTECTED]>
wrote: > > Kevin, > I am a bit
confused. Do you have other traces in the application? Can you see them?
Here is tracer that I use : http://ajaxmaker.com/xpanel >
We are using cellrenderers within dynamic datagrids (layout persisted in
DB) all the time - no issues there - they do have mouseDown and click
handlers. I personally would not name the method "click" as it is confusing
to me but would call it arrowClick(). > click
event is not handled by the parent or propagated to the parent. Your
control should define custom event and dispatch it to the listOwner so the
parent can react on it. > HTH, > Anatole > -----
Original Message ----- > From: Kevin Ewok
> To: [email protected] > Sent:
Tuesday, February 07, 2006 10:01 AM > Subject: [flexcoders]
Re: cellRenderer not recognizing click events for Custom Mxml Cell
Renderer > > > Hello
all- > I've spent the last day now trying to get
a handle of the dispatched > event from the cell renderer to
the mxml file and I still cannot do > it. I've tried several
of the techniques in Chapter 16 of the > "Developing Rich
Clients" Flex book and still no luck. > > What
boggles me is that the 'click' event w/i my cell renderer
mxml > file works when I use the "cellRenderer" attribute of
the mx:Datagrid > tag, but it doesn't work when I apply my
mxml file to the > .cellRenderer attribute of a dynamically
created datagrid. Obviously > something is getting lost b/w
the parent object and my mxml file where > the dispatched
event does not get handled by the parent. I've tried > all
sorts of fixes using 'parent' to no luck. > > Does
anyone know how this works? Thanks. > > --- In
[email protected], "Kevin Ewok" <suzylawson@>
wrote: > > > > Flexcoders
- > > > > I have
a mxml file which is basically copy and paste from the >
> TimePicker.mxml file. (except for my mxml file is just a label and
a > > button). When the button is clicked, the value of
the label is passed > > to the Cairngorm Controller.
This works completely fine when I > > implement my mxml
file within the <mx:DataGrid cellRenderer=".."/> >
> attribute. > > > > However, I
also have the requirement to create
datagrids dynamically. > > When I create my
DataGridColumn and apply my mxml file to the > >
'cellRenderer' attribute, the component appears correctly, but when
I > > click the button, the method linked to my click
event in the button > > never occurs.
> > > > I'm implementing the
"click" method within my mxml file that renders > > the
label and button and I can't figure out what I'm doing
wrong with > > the way the child is created. Thanks in
advance. > > > > var
_dgc:DataGridColumn = new DataGridColumn("newColumn"); >
> _dgc.cellRenderer = "com.StatusPicker"; > >
> > ////////
com.StatusPicker.mxml//////// > > <?xml version="1.0"
encoding="utf-8"?> > > <mx:HBox xmlns:mx="http://www.macromedia.com/2003/mxml"> >
> <mx:Script> > >
<![CDATA[ > >
> > var btn : MovieClip; > > var
listOwner : MovieClip; > > var getCellIndex
: Function; > > var getDataLabel :
Function;
> > > > function
click(){ > > trace("click
occured"); > > } >
>
> > function setValue(str:String, item:Object,
selection:String):Void > > { >
> status.text =
item.STATUS;
> > } > >
]]> > > </mx:Script> > >
> > <mx:Label id="status" textAlign="center"
width="20"/> > > <mx:Button id="RightArrow"
icon="@Embed('/images/rightarrow.png')" > >
click="click()"/> > >
</mx:HBox> > > > > > >
> > > -- > 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 > > a.. Visit
your group "flexcoders" on the
web. >
> b.. To unsubscribe from this group,
send an email to: >
[EMAIL PROTECTED] >
> c.. Your use of Yahoo! Groups is
subject to the Yahoo! Terms of Service. > >
> ------------------------------------------------------------------------------ >
--
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
YAHOO! GROUPS LINKS
|