[Catalyst] How do I pull out HTML::Widget result values?

Mark Zealey mark at itsolve.co.uk
Tue Dec 26 21:45:29 GMT 2006


I usually just do sth like:

if($result->have_errors) { display form; return }

# otherwise:
my $p = $c->req->params;
# We know that the params are valid now...

Mark

On Tuesday 26 December 2006 6:01 pm, Dennis Daupert wrote:
> This is throwing me down the stairs. I'm trying to pull out individual form
> element values to do things with. I have a working form with settings like:
>
> ==============
> my $w = $c->widget('write_msg_form')->method('post');
> $w->element('Textfield', 'sndr_email'
> )->label('Email')->size(50)->value(''); <snip>
> my $result = $w->process($c->req);
> <snip>
> $c->stash->{widget_result} = $w->result;
> ==============
>
> In my tt template this works fine:
>
> [% widget_result.container %]
>
> But nothing I've tried has successfully retrieved stuff like the value of
> the sndr_email field. (Trying to follow doc for HTML::Widget::Result, but
> I'm having a disconnect going from the generically presented lists of
> methods to actual correctly formatted perl.) How to do this?
>
> /dennis



More information about the Catalyst mailing list