I'd have to say that combining visual and non-visual components and then
throwing bindable into the mix seems like a recipie for trouble.  There
isn't a good separation of concerns. 
 
Jeff

        -----Original Message-----
        From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Michael Schmalle
        Sent: Thursday, September 18, 2008 12:04 PM
        To: flexcoders@yahoogroups.com
        Subject: Re: [flexcoders] Bindable does not behavior in extended
class
        
        
        Yeah,
        
        That is not what he wanted, so I asked. :) Making a whole
UIComponent (mx.controls.Form) class bindable is not a good choice.
        
        Mike
        
        
        On Thu, Sep 18, 2008 at 11:54 AM, Johannes Nel
<[EMAIL PROTECTED]> wrote:
        

                

                adding the Bindable metadata to a class makes it
implement eventdispatcher automagically during the 2 step compilation.
                
                
                On Thu, Sep 18, 2008 at 4:55 PM, Michael Schmalle
<[EMAIL PROTECTED]> wrote:
                

                        

                        Hi,
                        
                        This might be stupid but your ServiceForm is an
EventDispatcher right?
                        
                        I have never seen an error quite like that.
                        
                        Mike 


                        On Thu, Sep 18, 2008 at 10:00 AM, Guilherme
Blanco <[EMAIL PROTECTED]> wrote:
                        

                                Hi,
                                
                                Here is my daily question.
                                I have a class that handles Form +
HTTPService (a subclass called
                                Service w/ events complete and fail)
automatically called ServiceForm.
                                Since most code is replicated in
extended classes if you are editing
                                one item (another HTTPService subclass
that retrieves it and assign to
                                an XML Bindable variable), I optimized
in a subclass of ServiceForm.
                                The name of this class is
ServiceEditForm.
                                Here is the code:
                                
                                package core.containers
                                {
                                public class ServiceEditForm extends
ServiceForm
                                {
                                [Bindable] public var item:XML;
                                
                                public function ServiceEditForm()
                                {
                                super();
                                }
                                
                                override public function
getParamObject(httpFormat:Boolean = false):Object
                                {
                                var params:Object =
super.getParamObject(httpFormat);
                                params.itemId =
item.hasOwnProperty('id') ? XML(item.id).toString()
                                : XMLList([EMAIL PROTECTED]).toString();
                                
                                return params;
                                }
                                }
                                }
                                
                                And then I have my classes that build
EditForms... like
                                EditCenterForm, for example:
                                
                                <?xml version="1.0" encoding="utf-8"?>
                                <ServiceEditForm
xmlns="core.containers.*"
        
xmlns:mx="http://www.adobe.com/2006/mxml";
        
xmlns:parton_controls="parton.controls.*"
        
url="{Environment.getInstance().MODULE_URL}Center/Edit"
                                complete="handleFormComplete(event)">
                                <mx:Script>
                                <![CDATA[
                                
                                import core.Environment;
                                import core.events.DynEvent;
                                import mx.controls.Alert;
                                
                                protected function
handleFormComplete(event:DynEvent):void
                                {
        
Alert.show(event.result.message.toString(), "Edit Center");
                                }
                                
                                ]]>
                                </mx:Script> 
                                
                                <mx:FormItem label="Company:"
width="600" direction="horizontal">
                                <parton_controls:CompanyComboBox
id="company" width="100%"
        
selectedId="{item.hasOwnProperty('company_id') ?
                                XML(item.company_id).toString() :
                                XMLList([EMAIL PROTECTED]).toString()}"/>
                                </mx:FormItem> 
                                
                                <mx:FormItem label="Name:" width="600">
                                <mx:TextInput id="centerName"
width="100%"
                                text="{item.hasOwnProperty('name') ?
XML(item.name).toString() :
                                XMLList([EMAIL PROTECTED]).toString()}"/>
                                </mx:FormItem>
                                </ServiceEditForm>
                                
                                Sorry for that much code... but it's
quite simple.
                                
                                When I do this and compile code, I get
these errors:
                                
                                Severity and Description Path Resource
Location Creation Time Id
                                Access of undefined property _bindings.
[Generated code (use -keep to
                                save): Path:
modules\center\forms\EditCenterForm-generated.as, Line:
                                420, Column: 21] Parton Unknown
1221744447894 17180
                                Access of undefined property
_bindingsBeginWithWord. [Generated code
                                (use -keep to save): Path:
        
modules\center\forms\EditCenterForm-generated.as, Line: 432, Column:
                                21] Parton Unknown 1221744447900 17183
                                Access of undefined property
_bindingsByDestination. [Generated code
                                (use -keep to save): Path:
        
modules\center\forms\EditCenterForm-generated.as, Line: 428, Column:
                                21] Parton Unknown 1221744447899 17182
                                Access of undefined property
_documentDescriptor_. [Generated code
                                (use -keep to save): Path:
        
modules\center\forms\EditCenterForm-generated.as, Line: 91, Column:
                                13] Parton Unknown 1221744447893 17179
                                Access of undefined property _watchers.
[Generated code (use -keep to
                                save): Path:
modules\center\forms\EditCenterForm-generated.as, Line:
                                424, Column: 21] Parton Unknown
1221744447896 17181
                                
                                Anyone has any ideas about how to solve
it?
                                It seems it's an issue regarding the
[Bindable] assignment in my
                                ServiceEditForm class.
                                
                                Thanks in advance,
                                
                                -- 
                                Guilherme Blanco - Web Developer
                                CBC - Certified Bindows Consultant
                                Cell Phone: +55 (16) 9166-6902
                                MSN: [EMAIL PROTECTED]
<mailto:guilhermeblanco%40hotmail.com> 
                                URL: http://blog.bisna.com
                                Rio de Janeiro - RJ/Brazil
                                

                                




                        -- 
                        Teoti Graphix, LLC
                        http://www.teotigraphix.com
                        
                        Teoti Graphix Blog
                        http://www.blog.teotigraphix.com
                        
                        You can find more by solving the problem then by
'asking the question'.
                        

                        

                        




                -- 
                j:pn 
                \\no comment
                
                




        -- 
        Teoti Graphix, LLC
        http://www.teotigraphix.com
        
        Teoti Graphix Blog
        http://www.blog.teotigraphix.com
        
        You can find more by solving the problem then by 'asking the
question'.
        
         

Reply via email to