Barry,
    Basically when you use renderer as editor, there is no reason to deal with labelFunction as you have powerful control with built-in mask at your disposal.
The locale mask gets packaged within control (wrapped DateField) as that particular functionality is quite generic.
 
There is no trivial (out of the box way to add props to MXML) . You have to use mx:Component in order to "embed" those props to the class.
That approach is very limiting and does not lend itself easily to data driven programming.
 
Alternative it to create class factory. I do not have trivial factory here,  but here is (very ugly and untested) version of the implementation:
           ...........
            rendererIsEditor="true" 
            itemRenderer="{new WrappedClassFactory(com.theriabook.controls.DateField, {dateFormat:locale.getDateFormat()}}"   
      />
 
public class WrappedClassFactory extends ClassFactory {
    public function WrappedClassFactory (cls:Class, props:Object) {
        super();
        this.properties = props;
}}
This should work and allow you to add as many properties to the itemRenderer as you need.
 
 
Warning. This approach is addictive. It will change the way you code. If you are in application and not software development and have team of junior programmers it might cause project delivery delay. On contrary, if you are in software development and have experienced team it can benefit you greatly. Attached is a screenshot from Chapter 11 of upcoming book on Flex - BOTH controls on the left and right are datagrids showing the same data. "expando" property contains additional render attributes, styles, runtime property and styles (ie clculated on data change), etc. Enjoy.
 
Sincerely,
Anatole Tartakovsky
 
 
 
 
 
----- Original Message -----
Sent: Tuesday, September 19, 2006 8:40 PM
Subject: Re: [flexcomponents] subclassing DateField controls

thankyou Anatole, you are most kind with you patience and help.

can I just clarify something?... the following is a correct analysis, yes?

/******************************************************************************/
override public function set data(value:Object):void {

  
// DataGrid use only
   if (listData && listData is DataGridListData){
        value[DataGridListData(listData).dataField] = checked(value[DataGridListData(listData).dataField]);

  
// for use with lists only
   }else if{ (listData is ListData && ListData(listData).labelField in data){
        value[ListData(listData).labelField] = checked(value[ListData(listData).labelField]);
  }

   // also covers simple (eg: non datagrid) use of this custom control
   super.data = "">}

/******************************************************************************/

additionally,

where would I be able to plug in the display formatting, especially if I wanted to, not have it hard coded, but bind it to some config data?

                <mx:DataGridColumn dataField="EndEval" editable="true"  width="100"
                                      headerWordWrap="true" headerText="End Evaluation"
                                    rendererIsEditor="true" 
                                     itemRenderer="com.theriabook.controls.DateField"
                                     dateFormat="{ locale.getDateFormat()}"         />

this is not yet possible, yes? so I'd have to bind the dateFormat within the control itself?
ultimately, I'm looking for an abstracted API (well...enough of one) that I can quicly set (and change) values of.

any suggestions?

thanx
barry.b


__._,_.___


SPONSORED LINKS
Software development tool Application development software Development software
Development outsourcing software Embedded software development

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Attachment: barry.gif
Description: GIF image

Reply via email to