[Catalyst] FormBuilder not working

abhishek jain abhishek.netjain at gmail.com
Sat Sep 20 13:08:31 BST 2008


On Sat, Sep 20, 2008 at 1:12 PM, abhishek jain
<abhishek.netjain at gmail.com>wrote:

>
>
> On Sat, Sep 20, 2008 at 12:28 PM, Hani Anani <hanianani at gmail.com> wrote:
>
>> Hello Abhishek,
>>
>> I suspect the problem is with the naming of your files and dir structure.
>>
>> If search2 method is in the Project module you will need to do the
>> following:
>>
>> 1. create a project sub dir in your root/forms dir
>> 2. move your form definition file to the root/forms/project/search2.fb
>> 3. Your template should be defined in root/project/search.tt2 you specify
>> this in your code
>>      $c->stash->{template} =3D 'project/search2.tt2';
>>      This is unecessary since Catalyst does this for you.
>>
>> I do have to say I am a little confused, cause you refer to
>> root/src/search2.tt2 at the start of the email, in that case you might j=
ust
>> need to rename your form file to search2.fb to match you method's name.
>>
>> Hope this helps you figure out what went wrong,
>> -Hani
>>
>> On Fri, Sep 19, 2008 at 11:31 PM, abhishek jain <
>> abhishek.netjain at gmail.com> wrote:
>>
>>> Hello Friends,I am new to Catalyst and need to implement FormBuilder.
>>> What i am doing is:
>>> a template called root/src/search2.tt2 with the following content;
>>>
>>> [% META title =3D "Edit a person" %]
>>> [% FormBuilder.render %]
>>>
>>> a form script on root/forms/search.db
>>>
>>> in controller i have the following function
>>>
>>> sub search2 : Local Form {
>>>         my ( $self, $c ) =3D @_;
>>>         $c->stash->{template} =3D 'project/search2.tt2';
>>> }
>>>
>>> Do I need to do anything extra, i can get a page but without the form.
>>> Pl.help.
>>> --
>>> Thanks and kind Regards,
>>> Abhishek jain
>>>
>>> ______
>>
>>
That problem is solved , i have yet another one,
In my form definition i am writing the following:

name: search
method: post
fields:
        dom:
                label: Dom
                type: text
                size: 30
                required: 1
        ext:
                label: Ext
                type: select
                required: 1
fieldopts:
        ext:
                options:
                        id1
                        val1
                        id2
                        val2


I need a select option box with the id1 and id2 as option  and val1 and val2
as values.

I am not sure how to do so,
Also where to get help if the next problem arises,
Pl. help.
-- =

Thanks and kind Regards,
Abhishek jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080920/95e63=
386/attachment.htm


More information about the Catalyst mailing list