cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@socialchange.net.au
Subject [C1] <request:get-parameter> proposal
Date Thu, 21 Dec 2000 10:20:50 GMT
Hi,

I'd like to propose an addition to the request:get-parameter tag.

To jog everyone's memory: the <request:get-parameter> tag can take a "default" attribute,
which gets used if the parameter is not specified (null).

I'd like to be able to specify when the default should apply, rather than having it only apply
when the parameter isn't specified. Imagine the typical situation, where you've got a HTML
form element with a default value:

<input type="text" name="myparam" value="" />

Now, if I use that with:

<request:get-parameter name="myparam" default="unset"/>

The default will never trigger, because the form always has a value. So the "default" mechanism
is pretty useless here. I'd like to be able to specify that "" is the default, eg:

<request:get-parameter name="myparam" nullvalue="" default="unset" />

That's saying "if the parameter is unset or equal to "", then replace it with the default
text ('unset')".

Does that sound reasonable/useful? It's a backwards-compatible addition.

Simple patches attached  ('cd $COCOON_HOME ; cat XSPRequestLibrary.java.patch request.xsl.patch
| patch -p0')

Regards,

--Jeff
Mime
View raw message