Hi Dimitros,

thx for the feedback. Things are more clear now.

Just another question: How would you handle the same situation in a 
Flash application? Would it be a good idea to let the Forms/Views 
register with the ModelLocator for changes in the model? Or does that 
give the ModelLocator too much responsibility.

I see how the binding is done automaticly by Flex and that rocks...if 
only Flash could do that in such an easy way.

regards,
Christophe

Dimitrios Gianninas wrote:

>Hi,
>
>A ViewHelper is bound to a specific Form/View. If your case you can do it two 
>ways. You can use one ViewHelper to set the data on the different fields OR 
>the command can save the user data on a ModelLocator and that model is bound 
>to the varius controls, like so:
>
><mx:TextInput id="name" text="{ModelLocator.user.name}" />
><mx:TextInput id="email" text="{ModelLocator.user.email}" />
>
>As for the header, you can bind its value as well, instead of having to set it 
>everytime, like so:
>
><mx:Label text="{name.text}" />
>
>Hope that helps!
>
>Jimmy
>
>-----Original Message-----
>From: [email protected] on behalf of Christophe Herreman
>Sent: Sat 10/8/2005 7:44 AM
>To: [email protected]
>Subject: [flexcoders] [Cairngorm] - Question about ViewHelpers
> 
>Hi guys,
>
>I was wondering about the following...
>
>Say you have a GetUserCommand the retrieves a user from the db and then 
>updates 2 views: a UserForm where the user's data is shown and the 
>application's HeaderForm where the name of the current user is 
>displayed. How would you handle updating these 2 views?
>
>I was thinking:
>1) Update the views from within the command through 2 ViewHelpers 
>(UserFormViewHelper, HeaderFormViewHelper)
>2) Create one ViewHelper named UserViewHelper that you call inside the 
>command. In that UserViewHelper the 2 forms are updated.
>
>This raises another question: Is a ViewHelper bound to a Form/View or to 
>a business entity like User in this case?
>
>thx for your time !
>
>regards,
>Christophe
>
>
>--
>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 
><http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>
>        Computer software development 
><http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>
>     Software design and development 
><http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>
>         
>Macromedia flex 
><http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=OO6nPIrz7_EpZI36cYzBjw>
>        Software development best practice 
><http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>
>   
>
>________________________________
>
>YAHOO! GROUPS LINKS 
>
>
>       *        Visit your group "flexcoders 
> <http://groups.yahoo.com/group/flexcoders> " on the web.
>         
>*       To unsubscribe from this group, send an email to:
>        [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
>         
>*       Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
><http://docs.yahoo.com/info/terms/> . 
>
>
>________________________________
>
>
>
>
>
>--
>Flexcoders Mailing List
>FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
>Yahoo! Groups Links
>
>
>
> 
>  
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to