From: Van de B. <van...@gm...> - 2011-07-05 18:41:34
|
Hi Yaron, I done few tests with "input type=checkboxes". This input type produces a list of values, separated by "delimiter". (BTW, it means, that "delimiter" should not occur in any of values.) "default" parameter contains a list of values, separated by "delimiter". Using the same delimiter for separating items in "values" is direct and straightforward, and easy to remember and use. Another objective is based on nature of PHP scripts versus MediaWiki templates. The first is much closer to full-size programming language than the second. For example, try to generate a table in template. It is a nightmare. Handling parameter in PHP script much more reliable and robust compared to escaping commas in template. Van. On Tue, 2011-07-05 at 08:56 -0400, Yaron Koren wrote: > Hi, > > > Well, using the "delimiter" parameter for both kinds of delimiters > won't work, because a single field could make use of both kinds (the > "checkboxes" input could, for instance). But here's a simpler > solution: allow the "values=" parameter to have escaped commas, using > "\,", which wouldn't be split on. So in your case, it would be > "values=0\,5 ч,1 ч,1\,5 ч". That's the solution that > Special:CreateProperty uses already. What do you think? > > > -Yaron > > On Mon, Jul 4, 2011 at 7:00 PM, Van de Bugger > <van...@gm...> wrote: > > I think there's no solution, since it always just splits on > commas - > which is probably bad. > > > Unconditional splitting on commas is *definitely* bad. Let us > implement > a solution. I could take a look into sources and probably > prepare a fix > if you agree with approach. If "delimiter" specify delimiter > for > multi-value field, why don't use it as a delimiter for another > list? > > > Although if the "Time" field corresponds to a property, you > could > instead add those values to the property itself, using "Allows > value::" > - that should definitely work. > > > No, I do not like this idea. The property may be defined to > any time > value, dropdown input is just a convenient way to enter one of > frequently used values with no typing. Probably I will replace > it with a > combobox in future. Or provide two forms for edit -- a form > for dummies > with dropdown input and a form for gurus with a text input. > > Regards, > Van. > > > > On Mon, 2011-07-04 at 17:39 -0400, Yaron Koren wrote: > > Hi, > > > > > > There's a misunderstanding here, and probably the > documentation should > > be clearer: the "delimiter" defined there is the delimiter > for > > *users*, when they enter multiple values, for instance in an > > autocompletion field. It's not relevant for dropdowns, since > they only > > produce one value. For your issue, I think there's no > solution, since > > it always just splits on commas - which is probably bad. > Although if > > the "Time" field corresponds to a property, you could > instead add > > those values to the property itself, using "Allows value::" > - that > > should definitely work. > > > > > > -Yaron > > > > On Mon, Jul 4, 2011 at 4:35 PM, Van de Bugger > > <van...@gm...> wrote: > > Hi, > > > > I have a field in a form, something like: > > > > {{{field|Time|input type=dropdown|values=0.5 h,1 > h,1.5 h}}} > > > > Everything works good. Now I want to translate in to > Russian > > language. > > The problem: in Russian language comma is a decimal > character > > (a symbol > > to separate integer and fractional parts of a > number), so I > > cannot use > > comma as value separator. I tried to use "delimiter" > > parameter: > > > > {{{field|Time|input type=dropdown|delimiter=;| > values=0,5 ч;1 > > ч;1,5 ч}}} > > > > but with no success: values string is divided into > parts by > > commas, so > > my dropdown list includes values: > > > > 0 > > 5 ч;1 ч;1 > > 5 ч > > > > The question: Is it a bug or feature? Should value > of > > "delimiter" effect > > "values"? > > > > Thanks, > > Van. > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > All of the data generated in your IT infrastructure > is > > seriously valuable. > > Why? It contains a definitive record of application > > performance, security > > threats, fraudulent activity, and more. Splunk takes > this data > > and makes > > sense of it. IT sense. And common sense. > > http://p.sf.net/sfu/splunk-d2d-c2 > > _______________________________________________ > > Semediawiki-user mailing list > > Sem...@li... > > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > > > > > > > > -- > > WikiWorks · MediaWiki Consulting · http://wikiworks.com > > > > > > > > > -- > WikiWorks · MediaWiki Consulting · http://wikiworks.com > |