List Info

Thread: markup advice needed: (:select:) tag?




markup advice needed: (:select:) tag?
country flaguser name
United States
2007-06-08 17:16:35
Hi, folks.  I'm in the process of adding a function to the
DataQuery 
recipe that will generate select (drop-down menu) inputs
based on a 
previously configured database query, and I could use some
advice about 
the markup to avoid conflicts with other recipes.

Here's an example of how this feature will be used: Suppose
you have 
defined a query to display and edit event registrations that
are stored 
in a database.  Each record (page) in the registration table
(group) has 
an event ID number and a person ID number, which correspond
to records 
in other tables.  In order to display the registrations in a

human-readable form, you have defined the query to pull the
event's name 
and the person's name from two other tables which are joined
to the 
registration table.  You want to provide a form whereby an
administrator 
can add a person to an event by selecting the event's name
and the 
person's name from a pair of drop-down menus.

It's already possible to do this with DataQuery using
pagelists, but 
pagelists are so slow that if you have two or three
drop-downs on a 
page, the page may time out and so cannot be used at all. 
Plus, since 
DataQuery can't predict which field of the joined table you
will want to 
use for labels, you have to manually create each drop-down's
pagelist 
template, which is tedious and time consuming.  So I'm
working to 
provide a faster, easier way to do it.

In UpdateForm, I used (:update select etc etc for this
same 
functionality, because all of UpdateForm's tags were
variations on 
(:update.  But
DataQuery doesn't use (:update tags (or
any other 
custom markup), it uses regular (:input tags, and
(:input select is 
already in use.  ZAP used to provide a (:select tag, but
no longer 
does so, so I'm tempted to nab that markup unless someone
objects.

Here's what I'm looking at:

  (:select name=eventid label=eventname
or just
  (:select eventid eventname
would pull the eventnames from the joined table and
generate:
  (:input default eventid "{*$:eventid}"
  (:input select eventid "1" "Kung Fu
Fighting"
  (:input select eventid "2" "Fish Slapping
Dance"
  ...
  (:input select eventid "42" "Brockian
Ultra-Cricket"

If no label is provided, for example
  (:select personname
then the labels would be taken from the same field where
they are stored:
  (:input default personname "{*$:personname}"
  (:input select personname "John Smith"
  (:input select personname "Mickey Smith"
  ...
  (:input select personname "Sarah Jane Smith"

So, my question: Is (:select too
general a tag name for this specific 
function?  If so, what would you suggest instead?  Thanks in
advance for 
the feedback.  --Ben S.

_______________________________________________
pmwiki-devel mailing list
pmwiki-develpmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Re: markup advice needed: (:select:) tag?
country flaguser name
Australia
2007-06-08 17:43:39
On Fri, Jun 08, 2007 at 05:16:35PM -0500, Ben Stallings
wrote:
> Hi, folks.  I'm in the process of adding a function to
the DataQuery 
> recipe that will generate select (drop-down menu)
inputs based on a 
> previously configured database query, and I could use
some advice about 
> the markup to avoid conflicts with other recipes.

> So, my question: Is (:select too
general a tag name for this specific 
> function?  If so, what would you suggest instead? 
Thanks in advance for 
> the feedback.  --Ben S.

How about (:dataquery select name=eventid
label=eventname?
The advantages of this are:
- guaranteed not to conflict
- expandable to other custom markup you might want to add in
future,
  just use a different "command" rather than
"select"
- only one Markup needed -- match on (:dataquery command
args
and use
  ParseArgs to parse the args.

Kathryn Andersen
-- 
 _--_|     | Kathryn Andersen	<http://www.katspace.com&g
t;
/          | 
_.--.*/    | GenFicCrit mailing list <http://www.
katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia ->
Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy
-> Universe

_______________________________________________
pmwiki-devel mailing list
pmwiki-develpmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )