Re: [Catalyst] Best "form" library?

2011-03-07 Thread Octavian Rasnita

From: "Steve" 
In order of importance, my considerations when making the decision about a 
year ago (no existing Cat apps at that point) were:


Adoption Rate:  I subscribed to mailing lists for FormFu and HFH, and 
noticed more people talking about HFH.
Moosiness:  Since Catalyst was making the move to Moose, and Moose seemed 
to have quite a following, this made HFH look like the better long-term 
solution



If we would care only about how much discussion about a piece of software we 
find, we would use PHP, or Ruby, or Python, because they are more discussed 
than Perl these days. :-)
HTML::FormFu is pretty simple to use, so maybe that's why there are no very 
many discussions about it.


Documentation/Community support:  I personally thought HFH docs were 
somewhat better than FormFu, YMMV


Yes you may be right, but have you found something you didn't understand how 
to do and didn't like to ask it on HTML::FormFu mailing list?


YAML/config based approach:  While I now understand (thanks to previous 
posters on this thread) that there are multiple formats for the configs 
with FF, the idea of using a config file for form declaration did not 
appeal to me.


Who said that you need to use a config file for defining a form in H::FF?
You can entirely define it in the Perl code if you like, and even if you 
define a form in a config file, you are able to change that form with Perl 
code.


The biggest difference is not that H::FH uses Moose and H::FF does not, 
because probably H::FF would also start using Moose.


The difference is that H::FH uses Moose-type attributes for defining the 
form fields, with specific H::FH properties, while H::FF defines the form 
fields as a simple Perl data structure with its specific properties.


Octavian


___
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] Re: How to get uri_for something with a fragment?

2011-03-07 Thread Ashley Pond V
2011/3/7 Adam Sjøgren :
> On Mon, 7 Mar 2011 13:01:42 -0800, Ashley wrote:
>
>> What Ronald said + the #fragment is not passed along in the available
>> ENV with some servers and setups. In these cases it doesn't exist as
>> far as the backend is concerned. If you rely on it for dispatch, you
>> may get burned.
>
> Uhm, the _browser_ handles fragments. Browsers don't send them to the
> server _at all_.
>

Nice. I didn't want to blanket it with a 100% of the time in all
clients/servers this won't work because I was not sure.

___
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] How to get uri_for something with a fragment?

2011-03-07 Thread Larry Leszczynski

> Using the fragment is probably a bad idea. It's not supported by all
> servers so it can end up lost on the backend depending on your setup.

I have see fragments cause problems in server-side code that is naive
about URL handling, like splitting the string on "?" and assuming all
the stuff after the question mark is query params when it might in fact
include a fragment.

Since most (all?) of the URLs you see being passed around in Catalyst
code are actual URI objects (http://search.cpan.org/perldoc?URI), just
treat them as objects and use all the nice URI methods for manipulating
them and you'll be fine.


Larry

___
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] Re: How to get uri_for something with a fragment?

2011-03-07 Thread Adam Sjøgren
On Mon, 7 Mar 2011 13:01:42 -0800, Ashley wrote:

> What Ronald said + the #fragment is not passed along in the available
> ENV with some servers and setups. In these cases it doesn't exist as
> far as the backend is concerned. If you rely on it for dispatch, you
> may get burned.

Uhm, the _browser_ handles fragments. Browsers don't send them to the
server _at all_.

I.e. start:

  $ socket -s 

and hit, say, http://localhost:/whatever.html?this=1&that=2#frag in
a browser, and you'll see (Iceweasel):

  GET /whatever.html?this=1&that=2 HTTP/1.1
  Host: localhost:
  User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b11) Gecko/20110208 
Firefox/4.0b11 Iceweasel/4.0b11
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-us,en;q=0.5
  Accept-Encoding: gzip, deflate
  Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  Keep-Alive: 115
  Connection: keep-alive

  $ 

Another example (Chromium):

  $ socket -s 
  GET /whatever.html?this=1&that=2 HTTP/1.1
  Host: localhost:
  Connection: keep-alive
  Accept: 
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.13 
(KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13
  Accept-Encoding: gzip,deflate,sdch
  Accept-Language: en-US,en;q=0.8
  Accept-Charset: UTF-8,*;q=0.5

  $ 


  Best regards,

Adam

-- 
 "I always liked songs with parentheses in the title."Adam Sjøgren
 a...@koldfront.dk

___
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] How to get uri_for something with a fragment?

2011-03-07 Thread Ashley Pond V
On Mon, Mar 7, 2011 at 12:34 PM, Ronald J Kimball
 wrote:
> On Mon, Mar 7, 2011 at 3:25 PM, John M. Dlugosz  
> wrote:
>>  On 3/7/2011 1:35 PM, Ashley Pond V apv-at-sedition.com |Catalyst/Allow to
>> home| wrote:
>>>
>>> Using the fragment is probably a bad idea. It's not supported by all
>>> servers so it can end up lost on the backend depending on your setup.
>>
>> I've never heard of a web server that didn't have fragments.  I link to
>> anchors all the time!
>
> No, really, that's meaningless.  Fragments are handled by the user
> agent, not by the server.

What Ronald said + the #fragment is not passed along in the available
ENV with some servers and setups. In these cases it doesn't exist as
far as the backend is concerned. If you rely on it for dispatch, you
may get burned.

___
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] Best "form" library?

2011-03-07 Thread Steve
In order of importance, my considerations when making the decision about 
a year ago (no existing Cat apps at that point) were:


Adoption Rate:  I subscribed to mailing lists for FormFu and HFH, and 
noticed more people talking about HFH.
Moosiness:  Since Catalyst was making the move to Moose, and Moose 
seemed to have quite a following, this made HFH look like the better 
long-term solution
Documentation/Community support:  I personally thought HFH docs were 
somewhat better than FormFu, YMMV
YAML/config based approach:  While I now understand (thanks to previous 
posters on this thread) that there are multiple formats for the configs 
with FF, the idea of using a config file for form declaration did not 
appeal to me.


I agree with Stephen to a large degree on how to handle the decision.
Steve
st...@matsch.com

On 3/7/2011 3:21 PM, Stephen Clouse wrote:
On Mon, Mar 7, 2011 at 12:10 PM, Ashley Pond V > wrote:


I use FormFu and have no problem with it and there is ultimately no
difference between doing things in config or in code, it's all code
and rendering in the end and HTML forms and form processing is just a
messy business no matter what you do. I find config files a very clean
way to reuse parts of forms and fieldsets and such. Doing that with
Roles or inheritance seems messier to me.


This is actually why my current project likes HFH over FormFu.  We're 
already thinking very heavily in terms of Moose, so HFH's design is a 
logical extension.  Config files in FormFu ended up feeling like 
another domain-specific language that everyone had to learn, and we 
had enough of those already (templates, half-assed vendor-provided 
interfaces to their awful systems, etc).


Not saying that either way is good or bad.  I've used both HFH and 
FormFu on different projects and liked both, and there is merit to how 
FormFu does it in many other situations.  Haven't used Rose::HTML::* 
personally but a glance at the docs looks comparable to HFH.


To answer the OP, there is no "best", only "different".  The choice 
you make is highly subjective and will come down to project 
considerations.


I have been very curious about other approaches, including FormHandler
but a casual read of the docs gives no compelling reason to switch


There isn't one.  They are all pretty even in functionality, they 
simply do things differently.  Either you're using one already and 
should keep using it, or you haven't picked (like OP) and should 
evaluate them all carefully to see which is the best fit for your needs.


The Perl mantra *is* TIMTOWTDI, after all.

--
Stephen Clouse mailto:stephenclo...@gmail.com>>


___
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/


___
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] How to get uri_for something with a fragment?

2011-03-07 Thread Ronald J Kimball
On Mon, Mar 7, 2011 at 3:25 PM, John M. Dlugosz  wrote:
>  On 3/7/2011 1:35 PM, Ashley Pond V apv-at-sedition.com |Catalyst/Allow to
> home| wrote:
>>
>> Using the fragment is probably a bad idea. It's not supported by all
>> servers so it can end up lost on the backend depending on your setup.
>
> I've never heard of a web server that didn't have fragments.  I link to
> anchors all the time!

No, really, that's meaningless.  Fragments are handled by the user
agent, not by the server.

http://tools.ietf.org/html/rfc3986#section-3.5

Ronald

___
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] How to get uri_for something with a fragment?

2011-03-07 Thread John M. Dlugosz

 On 3/7/2011 1:35 PM, Ashley Pond V apv-at-sedition.com |Catalyst/Allow to 
home| wrote:

Using the fragment is probably a bad idea. It's not supported by all
servers so it can end up lost on the backend depending on your setup.

-Ashley



I've never heard of a web server that didn't have fragments.  I link to anchors 
all the time!

___
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] Best "form" library?

2011-03-07 Thread Stephen Clouse
On Mon, Mar 7, 2011 at 12:10 PM, Ashley Pond V  wrote:

> I use FormFu and have no problem with it and there is ultimately no
> difference between doing things in config or in code, it's all code
> and rendering in the end and HTML forms and form processing is just a
> messy business no matter what you do. I find config files a very clean
> way to reuse parts of forms and fieldsets and such. Doing that with
> Roles or inheritance seems messier to me.
>

This is actually why my current project likes HFH over FormFu.  We're
already thinking very heavily in terms of Moose, so HFH's design is a
logical extension.  Config files in FormFu ended up feeling like another
domain-specific language that everyone had to learn, and we had enough of
those already (templates, half-assed vendor-provided interfaces to their
awful systems, etc).

Not saying that either way is good or bad.  I've used both HFH and FormFu on
different projects and liked both, and there is merit to how FormFu does it
in many other situations.  Haven't used Rose::HTML::* personally but a
glance at the docs looks comparable to HFH.

To answer the OP, there is no "best", only "different".  The choice you make
is highly subjective and will come down to project considerations.


> I have been very curious about other approaches, including FormHandler
> but a casual read of the docs gives no compelling reason to switch


There isn't one.  They are all pretty even in functionality, they simply do
things differently.  Either you're using one already and should keep using
it, or you haven't picked (like OP) and should evaluate them all carefully
to see which is the best fit for your needs.

The Perl mantra *is* TIMTOWTDI, after all.

-- 
Stephen Clouse 
___
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] How to get uri_for something with a fragment?

2011-03-07 Thread Ronald J Kimball
On Mon, Mar 7, 2011 at 2:35 PM, Ashley Pond V  wrote:

> Using the fragment is probably a bad idea. It's not supported by all
> servers so it can end up lost on the backend depending on your setup.

I can't figure out what you mean by this.  This is a URL that will be
included in the body of a response.  How is the server involved at
all?

Ronald

___
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] How to get uri_for something with a fragment?

2011-03-07 Thread Ashley Pond V
On Mon, Mar 7, 2011 at 10:05 AM, John M. Dlugosz  wrote:
>  On 3/7/2011 9:34 AM, Ronald J Kimball rkimball-at-pangeamedia.com
> |Catalyst/Allow to home| wrote:
>>
>> On Sun, Mar 6, 2011 at 6:46 AM, John M. Dlugosz
>>  wrote:
>>>
>>>  On 3/6/2011 5:28 AM, Andrew Rodland andrew-at-cleverdomain.org
>>> |Catalyst/Allow to home| wrote:

 Or, since you know that what it generates *doesn't* have a fragment you
 could
 always just $c->uri_for_action(...) . '#id' which will be perfectly
 valid
 (although no longer a URI object).

>>> I considered that a hack until I knew better, since it won't work if
>>> there
>>> are query arguments.
>>
>> Why won't it work if there are query arguments?  Seems correct to me.
>>

Using the fragment is probably a bad idea. It's not supported by all
servers so it can end up lost on the backend depending on your setup.

-Ashley

___
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] Best "form" library?

2011-03-07 Thread Ashley Pond V
On Mon, Mar 7, 2011 at 8:15 AM, Devin Austin  wrote:
> On Sun, Mar 6, 2011 at 2:52 PM, Roger Horne  wrote:
>>
>> On Sunday 06 March 2011 20:52:04 Devin Austin wrote:
>>
>> > FormFu is pretty awful in my opinion.  Rose::HTML stuff isn't
>> > much better.
>>
>> As an amateur I would be interested to know why.
>>
>> When I started learning about Catalyst about a year ago, the
>> Tutorial at
>>
>
> FormFu doesn't make it easy to do a lot of things.  Things like modifying
> the form after it's been created aren't very easy, and there were quite a
> few instances I had to add these sort of ludicrous call backs (recommended
> in the documentation) to get the functionality I wanted (populate a select
> box from the db, etc.)
> It's kludgy, and there are just better options out there.

I'd like to see a start to finish example of the better options. Your
criticism seems contradictory. You dislike callbacks because you
prefer to write the form in code.

I use FormFu and have no problem with it and there is ultimately no
difference between doing things in config or in code, it's all code
and rendering in the end and HTML forms and form processing is just a
messy business no matter what you do. I find config files a very clean
way to reuse parts of forms and fieldsets and such. Doing that with
Roles or inheritance seems messier to me.

The *only* thing I'm dissatisfied with in FormFu is the speed but
since forms are such a small part of regular app traffic, it hasn't
stopped me from using it. Carl's fast and caring responses to
questions and bugfixes on the FormFu list are part of why I like it.

I have been very curious about other approaches, including FormHandler
but a casual read of the docs gives no compelling reason to switch and
critiquing FormFu ("FormFu is pretty awful in my opinion") without
some kind of comparison/contrast and real examples is not really
helpful.

-Ashley

___
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] How to get uri_for something with a fragment?

2011-03-07 Thread John M. Dlugosz
 On 3/7/2011 9:34 AM, Ronald J Kimball rkimball-at-pangeamedia.com |Catalyst/Allow to 
home| wrote:

On Sun, Mar 6, 2011 at 6:46 AM, John M. Dlugosz  wrote:

  On 3/6/2011 5:28 AM, Andrew Rodland andrew-at-cleverdomain.org
|Catalyst/Allow to home| wrote:

Or, since you know that what it generates *doesn't* have a fragment you could
always just $c->uri_for_action(...) . '#id' which will be perfectly valid
(although no longer a URI object).


I considered that a hack until I knew better, since it won't work if there
are query arguments.

Why won't it work if there are query arguments?  Seems correct to me.

Ronald

___
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/

My bad.  I thought the ? came after the #.

___
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] Best "form" library?

2011-03-07 Thread Octavian Rasnita
From: "Devin Austin" 

> On Sun, Mar 6, 2011 at 2:52 PM, Roger Horne  wrote:
> 
>> On Sunday 06 March 2011 20:52:04 Devin Austin wrote:
>>
>> > FormFu is pretty awful in my opinion.  Rose::HTML stuff isn't
>> > much better.
>>
>> As an amateur I would be interested to know why.
>>
>> When I started learning about Catalyst about a year ago, the
>> Tutorial at
>>
>> http://search.cpan.org/~zarquon/Catalyst-Manual-5.8005/lib/Catalyst/Manual/Tutorial/09_AdvancedCRUD.pod
>> only described FormFu and so I used it. For the trivial stuff I
>> deal with it works (most of the time) so I have not tried any of
>> the others. (If it ain't broke ... :-)
>>
>> r.
> FormFu doesn't make it easy to do a lot of things.  Things like modifying
> the form after it's been created aren't very easy, and there were quite a

After you get the $form object you can do anything you like with it. Change the 
existing fields, add new fields... what have you tried to do that was difficult 
to do?


> few instances I had to add these sort of ludicrous call backs (recommended
> in the documentation) to get the functionality I wanted (populate a select
> box from the db, etc.)

You can do this directly in the configuration file, without even needing to 
write Perl code, by adding a  hash as a key of the wanted select 
item, and under it you can specify the resultset, the columns that need to be 
selected, if the labels need to be localized, the conditions for searching, the 
aditional options for ordering the results, for selecting unique values only, 
for selecting only a certain number of records and so on.

Octavian


___
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] How to do .htaccess?

2011-03-07 Thread Francisco Obispo
You can safely use  based control's (if using apache)

Francisco



On Mar 7, 2011, at 2:22 AM, John M. Dlugosz wrote:

> I want to make one path in my app password protected, and a very simple way 
> will be fine.  Also, while in development, I want to make the whole think 
> password protected.
> 
> I thought I'd just use .htaccess.  But, since this isn't really an appache 
> directory (except for static files), where would I put this information?
> 
> 
> ___
> 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/

Francisco Obispo 
Hosted@ Programme Manager
email: fobi...@isc.org
Phone: +1 650 423 1374 || INOC-DBA *3557* NOC
Key fingerprint = 532F 84EB 06B4 3806 D5FA  09C6 463E 614E B38D B1BE





___
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] Best "form" library?

2011-03-07 Thread Devin Austin
On Sun, Mar 6, 2011 at 2:52 PM, Roger Horne  wrote:

> On Sunday 06 March 2011 20:52:04 Devin Austin wrote:
>
> > FormFu is pretty awful in my opinion.  Rose::HTML stuff isn't
> > much better.
>
> As an amateur I would be interested to know why.
>
> When I started learning about Catalyst about a year ago, the
> Tutorial at
>
> http://search.cpan.org/~zarquon/Catalyst-Manual-5.8005/lib/Catalyst/Manual/Tutorial/09_AdvancedCRUD.pod
> only described FormFu and so I used it. For the trivial stuff I
> deal with it works (most of the time) so I have not tried any of
> the others. (If it ain't broke ... :-)
>
> r.
> --
> Roger Horne
> ro...@hrothgar.co.uk
>
> ___
> 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/
>

FormFu doesn't make it easy to do a lot of things.  Things like modifying
the form after it's been created aren't very easy, and there were quite a
few instances I had to add these sort of ludicrous call backs (recommended
in the documentation) to get the functionality I wanted (populate a select
box from the db, etc.)

It's kludgy, and there are just better options out there.

-- 
Devin Austin
http://www.codedright.net
9702906669 - Cell
___
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] How about Template::Alloy?

2011-03-07 Thread Carl Franks
On 7 March 2011 16:00, John M. Dlugosz  wrote:
>  Reading the FormFu documentation, I was referred to Template::Alloy.
>
> After reading about that, I want to switch from TT to using that!  So, if
> it's everything it claims to be, why isn't that the default and used by all
> the examples I've seen?  Should I think twice about it?

I had a memory leak using Template::Alloy with HTML::FormFu, that I
couldn't track down/fix, so was never fixed.

In short: there's nothing fundamentally wrong with Template::Alloy,
but TT is more widely used and tested, so you're likely to have less
problems, and get easier support. But not necessarily ;)

Carl

___
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] How about Template::Alloy?

2011-03-07 Thread John M. Dlugosz

 Reading the FormFu documentation, I was referred to Template::Alloy.

After reading about that, I want to switch from TT to using that!  So, if it's everything 
it claims to be, why isn't that the default and used by all the examples I've seen?  
Should I think twice about it?


--John


___
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] Best "form" library?

2011-03-07 Thread Gerda Shank

On 3/7/11 5:18 AM, Erez Schatz wrote:

IIRC, there were issues with labels on controls. We wanted no label on
a button, and had to override the button render method. There were
some other stuff in which the way we wanted the form to look didn't
fit the way H::FH thought a form should look, resulting in overriding
the rendering methods and lots of crufty code.

Setting the widget wrapper to 'None' for the form or the field, or the 
'no_render_label' flag on a field, or setting the label in a field to '' 
will all suppress rendering the label. Or you could use templates and 
not use the rendering at all, or just render the bare input fields.


I'm not personally a fan of automatic rendering. It's pretty impossible 
to come up with a standard way of rendering that everybody is going to 
like, and adding tons of flags to handle every option is also a horrible 
idea. Automatic rendering is good for prototyping, to make sure the 
thing is working to start with. And it's good if you have a really 
standard presentation where it's worth it to come up with a set of 
widgets that fit your requirements.


Gerda


___
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] How to get uri_for something with a fragment?

2011-03-07 Thread Ronald J Kimball
On Sun, Mar 6, 2011 at 6:46 AM, John M. Dlugosz  wrote:
>  On 3/6/2011 5:28 AM, Andrew Rodland andrew-at-cleverdomain.org
> |Catalyst/Allow to home| wrote:
>>
>> Or, since you know that what it generates *doesn't* have a fragment you could
>> always just $c->uri_for_action(...) . '#id' which will be perfectly valid
>> (although no longer a URI object).
>>
> I considered that a hack until I knew better, since it won't work if there
> are query arguments.

Why won't it work if there are query arguments?  Seems correct to me.

Ronald

___
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] redirect and ajax

2011-03-07 Thread piccard



AFAIK you would need to return the uri to the browser, as your ajax
response and redirect the browser using javascript.
yes, thank u, this was my emergency-solution. I just thought it could 
also be done by the server, more elegantly ;-)





On Mon, Mar 7, 2011 at 10:24 PM, Cylon Toaster  wrote:

Hello,

I use an ExtJS-form, which sends an AJAX-request to the server. Depending on
the server-results the user should now be redirected to another page,
but somehow it doesn't work any more, when I use AJAX-requests. Normal forms
are no problem.

I have used constructions like this:
$c->res->redirect($c->uri_for($c->controller('aaa')->action_for('bbb')));
or ...
$c->detach('/aaa/bbb');

Any hint for me?
Thank u.


___
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/



___
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/



___
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] redirect and ajax

2011-03-07 Thread Jason Galea
AFAIK you would need to return the uri to the browser, as your ajax
response and redirect the browser using javascript.

On Mon, Mar 7, 2011 at 10:24 PM, Cylon Toaster  wrote:
> Hello,
>
> I use an ExtJS-form, which sends an AJAX-request to the server. Depending on
> the server-results the user should now be redirected to another page,
> but somehow it doesn't work any more, when I use AJAX-requests. Normal forms
> are no problem.
>
> I have used constructions like this:
>    $c->res->redirect($c->uri_for($c->controller('aaa')->action_for('bbb')));
> or ...
>    $c->detach('/aaa/bbb');
>
> Any hint for me?
> Thank u.
>
>
> ___
> 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/
>

___
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] redirect and ajax

2011-03-07 Thread Cylon Toaster

Hello,

I use an ExtJS-form, which sends an AJAX-request to the server. 
Depending on the server-results the user should now be redirected to 
another page,
but somehow it doesn't work any more, when I use AJAX-requests. Normal 
forms are no problem.


I have used constructions like this:

$c->res->redirect($c->uri_for($c->controller('aaa')->action_for('bbb')));

or ...
$c->detach('/aaa/bbb');

Any hint for me?
Thank u.


___
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] How to do .htaccess?

2011-03-07 Thread Michele Beltrame
Hello!

>  I want to make one path in my app password protected, and a very simple
> way will be fine.  Also, while in development, I want to make the whole
> think password protected.
> 
> I thought I'd just use .htaccess.  But, since this isn't really an
> appache directory (except for static files), where would I put this
> information?

You could use:

Catalyst::Authentication::Credential::HTTP

Cheers,
Michele.

-- 
Michele Beltrame
http://www.italpro.net/ - m...@italpro.net
Skype: arthas77 - Twitter: _arthas

___
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] How to do .htaccess?

2011-03-07 Thread John M. Dlugosz
 I want to make one path in my app password protected, and a very simple way will be 
fine.  Also, while in development, I want to make the whole think password protected.


I thought I'd just use .htaccess.  But, since this isn't really an appache directory 
(except for static files), where would I put this information?



___
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] Best "form" library?

2011-03-07 Thread Erez Schatz
On 7 March 2011 11:15, Matthias Dietrich  wrote:
> Erez,
>
> Am 06.03.2011 um 22:43 schrieb Erez Schatz:
>
>> As for HTML::Formhandler, I dunno whether this has been addressed, but
>> when we used it (at my previous place of employment) we ran into some
>> severe issues of, and I quote again, "misbehaviour due to modified
>> state after reset" causing leaks and we ended up moving to FormFu,
>> which I should say was somewhat under utilized for what it did offer
>> us. Formhandler was also, to my taste, unwilling to allow any
>> out-of-the-ordinary configuration and we ended up overriding a lot of
>> form controls which makes the whole idea of a form generator a bit
>> silly.
>
> Can you explain what your situation were in which you had to override HFH 
> things?

IIRC, there were issues with labels on controls. We wanted no label on
a button, and had to override the button render method. There were
some other stuff in which the way we wanted the form to look didn't
fit the way H::FH thought a form should look, resulting in overriding
the rendering methods and lots of crufty code.

Keep in mind, this wasn't what made us ditch it in favour of FormFu.

-- 
Erez

La perfection soit atteinte non quand il n'ya plus rien à ajouter,
mais quand il n'ya plus rien à retrancher.

___
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] Best "form" library?

2011-03-07 Thread Matthias Dietrich
Erez,

Am 06.03.2011 um 22:43 schrieb Erez Schatz:

> As for HTML::Formhandler, I dunno whether this has been addressed, but
> when we used it (at my previous place of employment) we ran into some
> severe issues of, and I quote again, "misbehaviour due to modified
> state after reset" causing leaks and we ended up moving to FormFu,
> which I should say was somewhat under utilized for what it did offer
> us. Formhandler was also, to my taste, unwilling to allow any
> out-of-the-ordinary configuration and we ended up overriding a lot of
> form controls which makes the whole idea of a form generator a bit
> silly.

I'm using FormFu because it was mentioned in the Catalyst tutorial back when I 
went through it.  When I discovered HFH I didn't look into it because I already 
was using FormFu and was happy with it.  Now that I see it is based on Perl 
modules it seems interesting to me, however, I won't change current projects.  
But for new projects I might give it a try.

Can you explain what your situation were in which you had to override HFH 
things?

Best,
  Matthias


-- 
rainboxx Software Engineering
Matthias Dietrich

rainboxx Matthias Dietrich   |  Phone: +49 7141 / 2 39 14 71
Königsallee 43   |  Fax  : +49 3222 / 1 47 63 00 
71638 Ludwigsburg|  Mobil: +49  151 / 50 60 78 64
 |  WWW  :  http://www.rainboxx.de

CPAN: http://search.cpan.org/~mdietrich/
XING: https://www.xing.com/profile/Matthias_Dietrich18
GULP: http://www.gulp.de/profil/rainboxx.html





___
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] Formhandler and Auth

2011-03-07 Thread David Schmidt
On Mon, Mar 7, 2011 at 1:03 AM, Eric Berg  wrote:
> On 3/4/11 11:03 AM, Gerda Shank wrote:
>>
>> On 3/4/11 8:23 AM, Eric Berg wrote:
>>>
>>> I'm trying to do some progressive engagement by allowing one of my forms
>>> to be filled out before a user is required to log in, but once the form is
>>> filled, I need them to log in so that I can get the user ID, which is part
>>> of the record for that form's row in my db.
>>
>> So after the form is submitted, you want to save the form contents
>> somehow, then present a login form, then after the user logs in, save it to
>> the database?
>
> Yes.  What I did previously was just to save a hash of the values, but I'm
> not sure how to pass that to formhandler given that my db constraints
> currently require the values for this form to have a creator_id, which is
> just what I need from the login.  So, I'm thinking at this point that I need
> to find a way to pass a hash of form values back to formhandler..that's got
> to be possible, and must be done after I get the form submission or I'll
> have to loosen up the constraints on my db to allow me to insert rows
> without a creator ID.  I'm looking into that now.
>>
>> Is the part you're not sure of how/where to save the form contents? There
>> are the usual options for preserving data across several requests, i.e.
>> stash, database, etc.
>
> I've been stashing a hash of form params.  I have to test this out, but I
> have to figure out if I can validate the form without the creator_id's being
> present.  I added it to the form, because formhandler was barfing when I
> used the simple form of stashing the new_result({}), then returning
> $self->form($c) in my add().   I have to figure out how to validate the form
> wtihout having it submitted to teh db, because that causes an error when the
> creator_id is missing, or add the creator_id (hidden and empty) to the form
> and only validate after login.  I guess I just have to try a few things.  If
> any of you good folks have banged your head against this and have ideas,
> they'd certainly be welcome.
>>
>> Then you'd have to decide how you want to save the data. You *could* use
>> FormHandler to do that, but if you have an already validated set of data, it
>> might be simpler to just save it to the database yourself.
>
> May be.  Probably, since I'm trying to wrest control from formhandler so I
> can validate a form without the creator_id, then redirect to login, then
> take the values of the form and the logged-in user's id and commit that to
> the db.  One change that is causing me problems is that I moved from the
> approach of having the form be a simple attribute (has 'form') where I was
> doing all the processing in the show and add methods to the approach where I
> implemented $self->form() per the sample referenced in
> HTML::FormHandler::Manual::Catalyst.
>
> Thinking through this in writing this, I believe that what I have to do is
> reimplement the form as a simple attribute and then handle the process() as
> needed in the add() method.  I think that's where I shot myself in the foot.
>
> Thank you muchly.  I'll post my successful results for the benefit of those
> who follow.
>
> Eric
>>
>> I'm not quite sure if I addressed the particular issues you were having;
>> if not, please clarify :)
>>
>> Gerda
>>
>>
>> ___
>> 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/
>
>
> ___
> 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/
>

I think I got 2 solutions for your problem.

1)
I split the form into MyFormBase.pm and MyForm

MyFormBase is a plain FormHandler class

MyForm on the other hand extends from MyFormBase and
HTML::FormHandler::Model::DBIC

I send a MyFormBase form to the user, validate it, store the values
$form->values (or something like that) in the session/flash and later
on use these values to fill an MyForm form.

https://github.com/davewood/Nolabel/tree/master/lib/Nolabel/Form

2) get the values from the form, store them in the session/flash, make
the database insert manually.

___
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/