Norton Allen | 1 Jan 17:36
Picon

Re: [FormBuilder] Current working directory affecting template path?

Steve, How did you specify the template file? If you specified a 
relative path: e.g. template => "foo.html", then it of course depends on 
the CWD. If you specified an absolute path: template => 
"/path/to/foo.html", then it does not depend on the CWD. This is basic 
filesystem stuff.
-Norton

Steve Knoblock wrote:

>I am having trouble with an upload form. I define the form and on
>submitted and valid, process an image, resizing and thumbnailing it.
>In the process, I create hashed directories based on the user id, and
>to create them
>
>cd foo
>mkdir bar
>cd bar
>mkdir baz
>
>like that. But after I come back from this sub, and try to render the
>confirmation page using $form->render() it fails on the template file
>not found. I know the template file is there with correct permissions
>and ownership and have traced the problem to this sub call. The
>confirm page renders before the call and fails after it. The only
>think I can think is C::FB or HTML::Template is depending on the
>original CWD and when I change it, it loses its place.
>
>Should I be saving the CWD and restoring it on return from the sub?
>
>Thanks,
(Continue reading)

Steve Knoblock | 1 Jan 22:34

Re: [FormBuilder] Current working directory affecting template path?

On Mon, 01 Jan 2007 11:36:48 -0500, you wrote:

>Steve, How did you specify the template file? If you specified a 
>relative path: e.g. template => "foo.html", then it of course depends on 
>the CWD. If you specified an absolute path: template => 
>"/path/to/foo.html", then it does not depend on the CWD. This is basic 
>filesystem stuff.

Thanks,
you are right, the template path is relative. For some reason, I
didn't expect changing the current directory to have such a wide
ranging effect.

I will specify the template paths as absolute, which what I intended
in the first place.

Steve

--
Back to our regularly scheduled programming...for(i=0;i<=10;i++) { print i }

_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Goetz Bock | 2 Jan 16:46
Picon

[FormBuilder] Sub Forms


Dear list,

I'm looking for a way to create subforms using FormBuilder (more
specific Catalyst::Controller::Formbuilder).

Like this:

I'm interested in: [ ] foo
                   [ ] bar
                   [ ] baz
My Message:        _______________________________________
                   _______________________________________
                   _______________________________________
My contact data:   Name, Surename: _______________________
                   Street:         _______________________
                   City:           _______________________
                   Zip:            _____
                   email:          _______________________
Submit:            < Submit >

Where the stuff in "my contact data" should be a subform.

The only reason for me to do this, is the rendering. The CI mandates a
rule between all the four main sections, but no rules inbetween contact 
data.

--

-- 
/"\ Goetz Bock at blacknet dot de  --  secure mobile Linux everNETting
\ /       (c) 2006 Creative Commons, Attribution-ShareAlike 2.0 de
(Continue reading)

Nate Wiger | 2 Jan 18:11
Picon
Gravatar

Re: [FormBuilder] Sub Forms

Sounds like a template would be what you're looking for? Have you
tried putting stuff like [% form.field.xyz %] in your page.tt file
directly?

-Nate

On 1/2/07, Goetz Bock <bock+fb <at> blacknet.de> wrote:
>
> Dear list,
>
> I'm looking for a way to create subforms using FormBuilder (more
> specific Catalyst::Controller::Formbuilder).
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Steve Schwarz | 4 Jan 05:43
Picon

[FormBuilder] tovar() and negative option value/labels

Hi,
I've found an issue where if I create a radio group with option values of -4 to 4
    $form->field(name =>'persistence', type=>'radio', options=>[-4..4], validate=>'NUM', required=>1);
the code generated is:

<input id="persistence_4" name="persistence" type="radio" value= "-4" />
<label for="persistence_4">-4</ label>
<input id="persistence_3" name ="persistence" type="radio" value= "-3" />
<label for="persistence_3">-3</ label>
...
<input id="persistence_3" name="persistence" type="radio" value= "3" />
<label for="persistence_3">3</ label>
<input id="persistence_4" name= "persistence" type="radio" value="4" />
<label for="persistence_4">4</label>

You'll notice the label's for and id attributes are the same for -4 and 4 and for 3 and -3 etc. So users clicking on the negative label cause the positive entry to be selected.

One fix to this would be to change the substitution in Utils::tovar() to keep the negative sign in the attribute. But I'm afraid of making a change like that do to some unforseen side effect. It appears the JSFUNC stuff uses this function too.

Any suggestions?
Thanks,
Steve



_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
Oliver Gorwits | 4 Jan 11:31
Picon
Picon
Favicon
Gravatar

[FormBuilder] Subclassed (customized) Fields

Hi there,

I'm using FormBuilder 3.05 and have subclassed some Field packages to 
pre-set certain flags (e.g. size, selectname, etc).

I've had to write a pretty dirty hack for a problem with FormBuilder 
trying to load default Messages. It dies because form_invalid_foo and 
js_invalid_foo don't exist. Apart from that the subclassing works just fine.

Before I go too much further with this, I'd like to know, have I missed 
a trick here and is there a simple and clean way to load 
form_invalid_foo and js_invalid_foo early enough that FormBuilder won't 
barf?

Thanks for a great module, btw.

regards,
oliver.
--

-- 
Oliver Gorwits, Network Infrastructure Group,
Oxford University Computing Services
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Nate Wiger | 4 Jan 17:52
Picon
Gravatar

Re: [FormBuilder] tovar() and negative option value/labels

On 1/3/07, Steve Schwarz <agilitynerd <at> gmail.com> wrote:
> Hi,
> I've found an issue where if I create a radio group with option values of -4
> to 4
>     $form->field(name =>'persistence', type=>'radio', options=>[-4..4],
> validate=>'NUM', required=>1);
[snip]
> You'll notice the label's for and id attributes are the same for -4 and 4
> and for 3 and -3 etc. So users clicking on the negative label cause the
> positive entry to be selected.

Hmmm, seems like the easiest fix would be to change tovar so that it
does a 1-for-1 substitution of \W+ as _. Right now, it squishes
multiples for HTML prettiness. So, with this solution you'd end up
with something like:

   input id="persistence_4"     # 4
   input id="persistence__4"    # -4

Unfortunately, that doesn't solve the issue where you might have:

   input id="persistence__4"    # +4
   input id="persistence__4"    # -4

But maybe that's ok. The "real" fix would be some type of counter in
$self internally that makes sure id's are never repeated, but that's
likely alot of work to do properly.

The id's can only be \w+ values (more or less) per XHTML specs, so we
still have to do some type of translation.

-Nate
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Nate Wiger | 4 Jan 17:56
Picon
Gravatar

Re: [FormBuilder] Subclassed (customized) Fields

On 1/4/07, Oliver Gorwits <oliver.gorwits <at> oucs.ox.ac.uk> wrote:
> Hi there,
>
> I'm using FormBuilder 3.05 and have subclassed some Field packages to
> pre-set certain flags (e.g. size, selectname, etc).
>
> I've had to write a pretty dirty hack for a problem with FormBuilder
> trying to load default Messages. It dies because form_invalid_foo and
> js_invalid_foo don't exist. Apart from that the subclassing works just fine.

Cool. One thing to try is setting messages for these in the top-level
messages hash:

   FB->new(messages => {form_invalid_foo => 'Bar is missing'})

You could then subclass CGI::FormBuilder itself to do this for you by default.

See if that works. This probably should be a bug; or maybe the
messages error should be lowered to a warning and the docs updated per
above.

-Nate
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Steve Schwarz | 4 Jan 18:06
Picon

Re: [FormBuilder] tovar() and negative option value/labels

On 1/4/07, Nate Wiger <nwiger <at> gmail.com> wrote:

On 1/3/07, Steve Schwarz <agilitynerd <at> gmail.com> wrote:
> Hi,
> I've found an issue where if I create a radio group with option values of -4
> to 4
>     $form->field(name =>'persistence', type=>'radio', options=>[-4..4],
> validate=>'NUM', required=>1);
[snip]
> You'll notice the label's for and id attributes are the same for -4 and 4
> and for 3 and -3 etc. So users clicking on the negative label cause the
> positive entry to be selected.

Hmmm, seems like the easiest fix would be to change tovar so that it
does a 1-for-1 substitution of \W+ as _. Right now, it squishes
multiples for HTML prettiness. So, with this solution you'd end up

[snip]
Nate ,
Thanks for the quick reply.

I think I'll go with the non-squishing solution (I've always liked solving problems by deleting code... :^)
You don't forsee other  problems with making this change? It seems tovar() is only being called in this type of use case so as long as the id is unique(uniquer) and valid we should be ok...
Thanks again,
Steve



_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
Goetz Bock | 5 Jan 16:58
Picon

Re: [FormBuilder] Sub Forms


On Tue, Jan 02 '07 at 09:11, Nate Wiger wrote:
> On 1/2/07, Goetz Bock <bock+fb <at> blacknet.de> wrote:
>
> >I'm looking for a way to create subforms using FormBuilder (more
> >specific Catalyst::Controller::Formbuilder).
>
> Sounds like a template would be what you're looking for? Have you
> tried putting stuff like [% form.field.xyz %] in your page.tt file
> directly?

As i did not want to make a template for each form, i did not do this.
but I'm on my way to talk management and the designer out of the current
layout ;-)
--

-- 
/"\ Goetz Bock at blacknet dot de  --  secure mobile Linux everNETting
\ /       (c) 2006 Creative Commons, Attribution-ShareAlike 2.0 de
 X   [ 1. Use descriptive subjects - 2. Edit a reply for brevity -  ]
/ \  [ 3. Reply to the list - 4. Read the archive *before* you post ]
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers


Gmane