No, that is not possible, you would have to echo the variable in the
textbox.
I assume you want the same behavior as on POST, where the form
population filter kicks in and fills in the form values.
Easy, do this in the view:
$request->setAttribute('populate', new AgaviParameterHolder(array
('empName' => 'Hello')), 'org.agavi.filter.FormPopulationFilter');
That will fill in the value, but only if the form has the same URL as
the current page!
You can also populate forms based on their ID:
$request->setAttribute('populate', array('formid' => new
AgaviParameterHolder(array('empName' => 'Hello'))),
'org.agavi.filter.FormPopulationFilter');
But in most cases, you only have to do the first approach.
Note that this will ALWAYS be run, even on POST, and there, you don't
want that, so wrap that line into a check for the request method:
if($request->getMethod() == 'read') {
// code here
}
Even better: have an InputView for the first page load, and an
ErrorView for failed POSTs - but make the ErrorView use the
InputView's template.
David
Am 08.03.2007 um 13:04 schrieb surej ns:
> Hi all
>
> how can i send value to a from variable ie..from the View to a
> textbox in the Template page.Is this correct..
> The function that i used in the view
>
> $this
>
> ->setAttribute('empName','Hello');
> 'empName'- is the textbox name
>
> Is this the correct way.if it is wrong tell me the apt way
>
> thax all
>
> surej
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.agavi.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users