[Html-widget] Setting field values using query parameters

Ash Berlin ash at cpan.org
Mon Oct 16 18:54:36 CEST 2006


Will Hawes wrote:
> Carl Franks wrote:
>   
>> On 14/10/06, Zbigniew Lukasiak <zzbbyy at gmail.com> wrote:
>>     
>>> You can process without query -
>>> $widget->process()
>>> And then set the values on the result object.
>>>       
>> Thanks Zbyszek,
>>
>> It took me a while to figure out how to do this, so just in case
>> anyone else is as slow as me...
>>
>> $result->add_valid( key => $value );
>>     
>
> So next question, along similar lines. Having looked at 
> DBIx::Class::HTMLWidget, I'm a bit confused by its fill_widget() method. 
> This sets values using $widget->element()->value() and goes as far as to 
> show some example Catalyst controller code in the synopsis.
>
> But none of the example TT code I've seen works on the HTML::Widget 
> object, it all uses the HTML::Widget::Result object generated by 
> $widget->process(). Whether or not you supply it a query, process() 
> doesn't appear to preserve any element values. Calling process() after 
> fill_widget() therefore appears to lose all the values stored by 
> fill_widget().
>
> It would be possible to create a TT template that iterates through the 
> elements in a HTML::Widget object, but IMO it would make a lot more 
> sense if calling process() without a query preserved all the values 
> stored on individual elements. That way you'd only need a single template.
>
> _______________________________________________
> Html-widget mailing list
> Html-widget at lists.rawmode.org
> http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget
>   
fill_widget is designed for the initial load of an edit page. i.e. 
setups up current values from a database.



More information about the Html-widget mailing list