[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cgiapp] Setting query at runtime (after start up)


Hi John --

> I just noticed that the "query" property in CGI::App is immutable after
> start-up. This doesn't make much sense to me since we can still
> add/delete key-value pairs to/from the object one at a time, or remove
> all key-value pairs at once.
>
> Does anyone know the logic behind this? Jesse would you be willing to
> lift this restriction?

Sure, if you have a compelling reason!


> PS I am using a general method "showForm" for displaying forms. The
> HTML::FillInForm module called within this method takes a query as an
> argument. I this situation, I'd like to create a fresh query object and
> initialize it with a hash. Unfortunately you cannot pass a hash to
> $query->param, otherwise I'd remove all key value pairs from the
> existing query object and add mine. Any solutions would be
> graciously appreciated.

Why does the query object you pass to H::FIF need to be the same query
object contained in your C::A object?  Couldn't you create a new query
object just for H::FIF?  It sounds like all you're doing with it is using it
as a bucket to carry data, anyway.  Why does your CGI::Application object
need to use the same query object?

The reason CGI::Application is particular about he query object is because
it depends on the query object for its functionality.  There is the
capability to provide your own query object at start-up, but to change the
query object mid-stream is a little weird.  It would be sort of like wanting
to change the connect() parameters of an already-instantiated DBI $dbh
object.


TTYL,

-Jesse-


--

  Jesse Erlbaum
  The Erlbaum Group
  suppressed
  Phone: 212-684-6161
  Fax: 212-684-6226




---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.