Multiple field values

6 views
Skip to first unread message

Eep²

unread,
Jul 25, 2007, 6:30:08 AM7/25/07
to Semantic Forms
On http://discoursedb.org/SemanticForms/ the standard way of adding
multiple values for the same field is to create a template for
"additional" entries of a certain field type. Why not just use the
same existing field type on the current template and simply allow it
to be "called" multiple times instead of having to create yet another
template? Also, why not use client-side scripting and/or CSS tricks to
reveal hidden DIVs without having to make another call to the server?
Then, simply concantenate the multiple same-named fields into a single
field (and split up for editing later).

How I want to allow for multiple fields will require a lot of text-
entry fields (as on http://tnlc.com/eep/compare/gameform.html ) and I
would prefer multiple values stringed back together as in my game
comparison table at http://tnlc.com/eep/compare/table.html but I don't
want the form to accept multiple values in this way because each value
will have its own category and comma-separated lists will screw up
that auto-categorization.

Yaron Koren

unread,
Jul 25, 2007, 11:05:55 AM7/25/07
to semanti...@googlegroups.com
The reason a field isn't added multiple times to the same template is
that MediaWiki doesn't support such a thing. A template represents a
one-to-one dictionary, where every time a field shows up it's replaced
by its value, and if a field had more than one value assigned in the
template call it would create ambiguity about what gets substituted.

Also, having templates allows for more than one value per repeated
block; this isn't really a usable feature right now, but it will be
once there's support for (I'm sure everyone's sick of hearing this
term already!) n-ary relations.

Using Javascript for multiple templates is a very good idea; it was
brought up in a recent thread and it's a planned development.

If by multiple values on your form you mean the checkboxes like
"explosions", "fire" etc., as I wrote before those can be implemented
as simply boolean attributes, which might be the simplest solution. Or
are you talking about something else?

-Yaron

Eep²

unread,
Jul 26, 2007, 12:30:41 AM7/26/07
to Semantic Forms
On Jul 25, 8:05 am, "Yaron Koren" <yaro...@gmail.com> wrote:
> The reason a field isn't added multiple times to the same template is
> that MediaWiki doesn't support such a thing. A template represents a
> one-to-one dictionary, where every time a field shows up it's replaced
> by its value, and if a field had more than one value assigned in the
> template call it would create ambiguity about what gets substituted.

I don't see how the ambiguity would arise; simple output a <insert
character here>-separated list of ALL values in the same-named
field(s).

> Also, having templates allows for more than one value per repeated
> block; this isn't really a usable feature right now, but it will be
> once there's support for (I'm sure everyone's sick of hearing this
> term already!) n-ary relations.
>
> Using Javascript for multiple templates is a very good idea; it was
> brought up in a recent thread and it's a planned development.

Not just javascript but CSS too.

> If by multiple values on your form you mean the checkboxes like
> "explosions", "fire" etc., as I wrote before those can be implemented
> as simply boolean attributes, which might be the simplest solution. Or
> are you talking about something else?

Well, for example, if the form has checkboxes for footstep surface
sounds for dirt, mud, sand, and water, and all are checked, I want the
table field to show "dirt, mud, sand, water" and not checkboxes (which
take up more room)--and have links to those categories (which show
other games that have such footsteps). And I want a text-entry field
for other surfaces that aren't available to select from. Autocomplete
is nice but I'd rather have a multi-select listbox that shows all (or
most anyway) of the options immediately without some silly delayed
fade-in/out effect.

Checkboxes are fine up to a point, but when you get to, say, MediaWiki
namespace search options, it becomes frustrating having to check/
uncheck those boxes when you only want to search the main namespace.
This is why I'm working on an extension/hack to convert namespace
search checkboxes into multi-select listboxes (see
http://mediawiki.org/wiki/Extension:Multi-select_Namespace_Search )

Yaron Koren

unread,
Jul 26, 2007, 9:29:44 AM7/26/07
to semanti...@googlegroups.com
Okay, now I think I finally understand what you're talking about. You
want a dual input for each of these fields: a multi-selection
dropdown, and a text box for allowing "other" values. It's odd that
you didn't implement it this way on your "mockup" form, but I'm
assuming that's what you want; please let me know if I'm wrong.

Given that, a few issues:

- it's very important to stress that dropdowns/listboxes (of whatever
form) and autocompletes/checkboxes are not interchangeable. The former
don't allow entry of new data, the latter do; the former are
represented in SMW as "Enumeration"s, the latter are just "String"s.
Usually one makes more sense than the other for a given application;
in your case, it looks like it should be an Enumeration. Though you
really want an Enumeration that allows new values as well; I think
that's fine - I'm pretty sure there's nothing in SMW that checks to
make sure an Enumeration's value is actually one of its "allowed
values".

- I don't really know what you mean by using CSS, but I'm assuming
it's not a big deal.

- I'm assuming that, if someone enters a new value for a field, you
don't want it to end up in the main dropdown/listbox. Is that true?

-Yaron

Eep²

unread,
Jul 26, 2007, 10:48:44 PM7/26/07
to Semantic Forms
On Jul 26, 6:29 am, "Yaron Koren" <yaro...@gmail.com> wrote:
> Okay, now I think I finally understand what you're talking about. You
> want a dual input for each of these fields: a multi-selection
> dropdown, and a text box for allowing "other" values. It's odd that
> you didn't implement it this way on your "mockup" form, but I'm
> assuming that's what you want; please let me know if I'm wrong.

Well, that form uses checkboxes and text-entry fields because combo
boxes aren't available in HTML. I may still use that method instead of
multi-select list boxes because for some checkbox entries, the text
field allows more info for that specific feature.

> Given that, a few issues:
>
> - it's very important to stress that dropdowns/listboxes (of whatever
> form) and autocompletes/checkboxes are not interchangeable. The former
> don't allow entry of new data, the latter do; the former are
> represented in SMW as "Enumeration"s, the latter are just "String"s.
> Usually one makes more sense than the other for a given application;
> in your case, it looks like it should be an Enumeration. Though you
> really want an Enumeration that allows new values as well; I think
> that's fine - I'm pretty sure there's nothing in SMW that checks to
> make sure an Enumeration's value is actually one of its "allowed
> values".

This form doesn't necessarily have to be limited by SMW standards if
it can't do what I want. I've been using 2 different table generators
to make the comparison table ( http://www.tnlc.com/wiki/index.php?title=Comparison_table
) from the same template used by Semantic Forms so far but both have
their limitations, unfortunately. I may look into another form
extension, Simple Forms ( http://www.mediawiki.org/wiki/Extension:Simple_Forms
), too.

> - I don't really know what you mean by using CSS, but I'm assuming
> it's not a big deal.

Well, by CSS I mean, of course cascading stylesheets and their ability
to hide/show <div>s...so, yes, actually, quite a big deal when it
could be done client-side with or without the aid of javascript.

> - I'm assuming that, if someone enters a new value for a field, you
> don't want it to end up in the main dropdown/listbox. Is that true?

Well, yes, but I want any new entries like, say, a new game developer,
to be put into a queue for later verification so one couldn't just go
nuts entering crap/spam in the lists.

I may just stick with checkboxes and text-entry fields after all but,
I'm finding, whenever I edit a template used by Semantic Forms, the
fields aren't retained when I try "edit with form". Bug?

> > > > Onhttp://discoursedb.org/SemanticForms/the standard way of adding


> > > > multiple values for the same field is to create a template for
> > > > "additional" entries of a certain field type. Why not just use the
> > > > same existing field type on the current template and simply allow it
> > > > to be "called" multiple times instead of having to create yet another
> > > > template? Also, why not use client-side scripting and/or CSS tricks to
> > > > reveal hidden DIVs without having to make another call to the server?
> > > > Then, simply concantenate the multiple same-named fields into a single
> > > > field (and split up for editing later).
>
> > > > How I want to allow for multiple fields will require a lot of text-

> > > > entry fields (as onhttp://tnlc.com/eep/compare/gameform.html) and I


> > > > would prefer multiple values stringed back together as in my game

> > > > comparison table athttp://tnlc.com/eep/compare/table.htmlbut I don't

Reply all
Reply to author
Forward
0 new messages