check out
http://pdf.sys-con.com/MX/Ajaxspry.pdf
I don't usually ever suggest anyone go to a sys-con site, the thought of it
makes me want to use foul language here.  But this is a link to a PDF
direct, so its safe to hit it.

DK

On 5/1/07, Dimitrios Gianninas <[EMAIL PROTECTED]>
wrote:

   I dont think you need to do that much, perhaps you might be missing the
event declaration at the top of the class?

[Event(name="change", type="flash.events.Event")]
public class MyClass {
...
}

*Dimitrios Gianninas*
*Developer*
*Optimal Payments Inc.*


 ------------------------------
*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Kenneth Sutherland
*Sent:* Tuesday, May 01, 2007 11:04 AM
*To:* [email protected]
*Subject:* RE: [flexcoders] metadata tags and events

  Cheers, I'd already tried what you'd suggested below and for whatever
reason it is still not updating the model.

I did see this in the standard DateField.as class

[DefaultBindingProperty(source="selectedDate",
destination="selectedDate")]

[DefaultTriggerEvent("change")]

[RequiresDataBinding(true)]

I think it's just down to the way that the custom component is using the
sets and gets and some weird flex magic. I've ended up doing the following
as a work around.

<myCustomComponents:CustomComponent id="DoB" change="{updateModel( )}"/>

And whenever the change event is fired, I can pick it up here, although I
can't get any other bindings to pick up the event. The updateModel() just
gets selected date and puts that into a holder date variable which the model
binds to.

I've had a look at
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=metadata_141_01.htmland
 it's not exactly a full list. Hmmmmm.

Bah there are times when the documentation for using flex is just
rubbish.  Not to mention the search facility of livedocs doesn't seem to be
well indexed or something.

- - - - - - - - - - - - - - - - - - - - - -

Just seen the email from Daniel F, cheers for that link, I'm currently
trying to ask adobe's gold (plated & somewhat tarnished) support and if they
get back to me I'll let you know what the extra tags do.

Thanks K.

  ------------------------------

*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Dimitrios Gianninas
*Sent:* 01 May 2007 13:16
*To:* [email protected]
*Subject:* RE: [flexcoders] metadata tags and events

  in order to tell other classes your object is bindable, it has to have
this metatag:

[*Bindable*(*"change"*)]

public function get text():void {

  ....

}

 then somewhere is your component once the text field data is set,
broadcast the change event like so:

 dispatchEvent( *new* Event(*"change"*) );

*Dimitrios Gianninas*

*Developer*

*Optimal Payments Inc.*

 ------------------------------

*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Kenneth Sutherland
*Sent:* Tuesday, May 01, 2007 5:52 AM
*To:* [email protected]
*Subject:* [flexcoders] metadata tags and events

Does anyone have information on the various metadata tags that can be used
in flex. I've been going through some of the source files to find out a way
of getting my custom component to tell a model to update itself.

Some of the tags I've seen that I don't know what they do are

[DataBindingInfo]

[DefaultBindingProperty]

[DefaultTriggerEvent]

I've seen others but I won't to list everything here.

I've searched Livedocs and I can't find somewhere where all the tags with
explanations are listed.

Also if someone knows about models being updated can you advise on the
below problem

If my model is

<mx:Model id="requiredFields">

                                    <theForm>

                                                <all>

                                                            <name> {
name.text }     </name>

                                                            <birth>  {
DoB.selectedDate }</birth>

                                                </all>

                                    </theForm>

                        </mx:Model>

<myValidator:FormValidator id="formValidator"  source="{requiredFields}"
property="all"/>

            When I call the validator the information it gets from the
model is the text from the text input which is updated everytime the user
changes the said text input, but the date comes from a custom date entry
component and the model doesn't get the latest date from the component. It
would seem like the binding isn't working or my custom component isn't
firing of the required events for the model to update itself when the user
changes the date.

I've tried getting my custom component to fire of the following events

[Event(name="change", type="flash.events.Event")]

            [Event(name="valueCommit", type="mx.events.FlexEvent")]

As well as making the getter function for selectedDate [Bindable], but the
model still doesn't pick up on any changes after the component has been
initialised.

Cheers for any info.

*Kenneth.*

  *AVIS IMPORTANT*

*WARNING*

Ce message �lectronique et ses pi�ces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou l�galement privil�gi�s destin�s
au seul usage du destinataire vis�. L'exp�diteur original ne renonce � aucun
privil�ge ou � aucun autre droit si le pr�sent message a �t� transmis
involontairement ou s'il est retransmis sans son autorisation. Si vous
n'�tes pas le destinataire vis� du pr�sent message ou si vous l'avez re�u
par erreur, veuillez cesser imm�diatement de le lire et le supprimer, ainsi
que toutes ses pi�ces jointes, de votre syst�me. La lecture, la
distribution, la copie ou tout autre usage du pr�sent message ou de ses
pi�ces jointes par des personnes autres que le destinataire vis� ne sont pas
autoris�s et pourraient �tre ill�gaux. Si vous avez re�u ce courrier
�lectronique par erreur, veuillez en aviser l'exp�diteur.

This electronic message and its attachments may contain confidential,
proprietary or legally privileged information, which is solely for the use
of the intended recipient. No privilege or other rights are waived by any
unintended transmission or unauthorized retransmission of this message. If
you are not the intended recipient of this message, or if you have received
it in error, you should immediately stop reading this message and delete it
and all attachments from your system. The reading, distribution, copying or
other use of this message or its attachments by unintended recipients is
unauthorized and may be unlawful. If you have received this e-mail in error,
please notify the sender.




--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?

Reply via email to