Re: [Catalyst] Serialized data with HTML::FormHandler and DBIx::Class::InflateColumn::Serializer

2011-10-17 Thread Hetényi Csaba

Dear Dmitry

Thank You for your tip!
That was the solution! :)

In my case, the 'datepicker' is a form field in form class (a jquery 
datepicker widget in html),
but in the table there is no such column. The mm_data is the serialized 
column, which holds the json serialized hash.

The hash has a 'date' value which holds the date value.
The next code snippet appended to form class works perfectly - thanks 
to Dmitry.


after 'setup_form' => sub {
my $self = shift;
my $item = $self->item;

$self->field('datepicker')->value(
$item->mm_data->{'date'}
);
};


Thank You!


On 2011.10.17 14:14, Dmitry L. wrote:

Hello!

May be http://www.catalystframework.org/calendar/2009/3 is what you 
need.

Look at the end of paragraph "The Editing Form"

On 17 of October 2011 12:19:20 Het�nyi Csaba wrote:



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Serialized data with HTML::FormHandler and DBIx::Class::InflateColumn::Serializer

2011-10-17 Thread Dmitry L.
Hello!

May be http://www.catalystframework.org/calendar/2009/3 is what you need.
Look at the end of paragraph "The Editing Form" 

On 17 of October 2011 12:19:20 Het�nyi Csaba wrote:
> Dear Friends
> 
> First of all, please forgive me for this newbie question! I know, that
> my problem is not too Catalyst specific,
> but i can't find help other ways, and i know that there is a lot of
> helpful person on this list :)
> 
> I have a db table, which holds a lot of common data placed in individual
> columns,
> but in the same table i'd like to store some various specialized data,
> and don't want to
> create other tables to hold this data.
> The various datas coming from various forms.
> So i'd like to use a serialized table column with HTML::FormHandler.
> I found the excellent:
> DBIx::Class::InflateColumn::Serializer
> and i can use it for store perl hash datastructure to one table column.
> (with "before 'update_model' ")
> 
> My problem is, that i need to get this data (or the de-serialized perl
> data struct) in the HFH form class,
> to make the default value to a form field, but i don't know how to
> access the original or de-serialized value in the form class.
> 
> Thank You in advance!

-- 
//wbr, Dmitry L.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Serialized data with HTML::FormHandler and DBIx::Class::InflateColumn::Serializer

2011-10-17 Thread Hetényi Csaba

Dear Friends

First of all, please forgive me for this newbie question! I know, that 
my problem is not too Catalyst specific,
but i can't find help other ways, and i know that there is a lot of 
helpful person on this list :)


I have a db table, which holds a lot of common data placed in individual 
columns,
but in the same table i'd like to store some various specialized data, 
and don't want to

create other tables to hold this data.
The various datas coming from various forms.
So i'd like to use a serialized table column with HTML::FormHandler.
I found the excellent:
DBIx::Class::InflateColumn::Serializer
and i can use it for store perl hash datastructure to one table column.
(with "before 'update_model' ")

My problem is, that i need to get this data (or the de-serialized perl 
data struct) in the HFH form class,
to make the default value to a form field, but i don't know how to 
access the original or de-serialized value in the form class.


Thank You in advance!

--
Hetényi Csaba




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/