[flexcoders] Cairngorm ViewHelpers

2006-02-09 Thread Alberto Albericio Salvador
Hi,

When using Cairngorm 2.0a2, how can I make use of the ViewHelpers?

Trying to attach a viewhelper to the login example, I write this class:

// loginViewHelper.as
package org.nevis.cairngorm.samples.login.view {
import org.nevis.cairngorm.view.ViewHelper;
import mx.controls.Alert;
public class loginViewHelper extends ViewHelper
{
public function loginViewHelper() : void
{
}
public function sayPo() : void
{
mx.controls.Alert.show('Popopopopopop');   
}
}
}

What am I doing wrong here that the compiler is arguing about Cairngorm 
ViewHelper.as and Cairngorm ViewLocator.as?

Thanks

-- 
Alberto Albericio Salvador
Aura S.A. Seguros
Departamento Informática



--
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/
 





Re: [flexcoders] Cairngorm ViewHelpers and Views and Commands

2005-01-30 Thread Robin Hilliard
On 22/01/2005, at 6:07 PM, dave buhler wrote:

 1) Should the views be nothing more than the forms? Where does the
 validation go?

Hi Dave,

So far what I've done for validators, filters, formatters and other business helper classes is make sure they stay pure business logic e.g. working with arrays or single VOs, and add them to my business package - they're business logic I want to reuse, so it seems to be a good place for them. I then instantiate them on in my view and use them directly, e.g:

business:ContactFilter id=contactFilter/>


mx:Form>
mx:FormItem label=Filter>
mx:TextInput id=criteriatxt/>
/mx:FormItem>
/mx:Form>

mx:DataGrid id=grid dataProvider={contactFilter.filter(contactList, criteriatxt.text)}...

It doesn't hurt the reuse prospects of the view or the business helper doing this - the business helper is more permanent than the view, and the business helper is oblivious to where it's being used. My rule of thumb is that if it doesn't affect the model and it can't affect other parts of the UI then it doesn't necessarily have to go up through a command. 

As for shared variables, so far our global scope has been the application, we keep the central VOs there and bind them down through public properties to any view that needs to reference them. Not sure if that was your problem.

Hope that helps.

Robin
http://www.rocketboots.com.au