It's based on output formats in types. Output formats are handled inside the setOutputFormat function of the relevant DataValue subclass.
It's primarily targeted towards custom types where you have some sort of internal localization or whatnot. It's a pretty bad example, but here's one using the Temperature type which has an output format that accepts °C °F and K. If you have a property like this: This property has a [[has type::temperature]] type and is labeled with [[has field label format::K|kelvins]]. It is limited to the temperatures [[Allows value::15°C]], [[Allows value::20°C]], [[Allows value::25°C]], and [[Allows value::30°C]]. Then when using a form that uses that property in a dropdown it will display the values there in kelvins, but put the °C into the template field. Bad example, but more useful with things like localized types. Other than countries, languages would be good, mapping language codes to Language names. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] Yaron Koren wrote: > Hi, > > Can you explain how this would be used? What would be a sample value > for "Has field label format" - is it a template name, a function name, > or something else? > > -Yaron > > On Thu, Nov 19, 2009 at 1:01 AM, Daniel Friesen > <li...@danielfriesen.name > <mailto:li...@danielfriesen.name>> wrote: > > I was in need of something in Semantic Forms so I implemented a small > new feature. > > My use case was countries. I wrote a country datatype that used > country > codes and displayed the localized country name on the wiki (factboxes, > content areas, etc...). > The issue of course was a limitation in Semantic Forms, values are > used > as labels in dropdowns, etc... and you can't customize them. > > > So I implemented a small label setup that takes advantage of output > formats in semantic types. > If you use [[Has field label format::formatstring]] along with > [[Allows > value::]] then SF will pass that formatstring to the output format of > the type for that property and use the formatted value as the label in > the case of dropdowns, listboxes, multiple checkboxes, and radio > boxes. > > Now that I think about it, a |label format= in the {{{field might be > possible. Perhaps along with something like |label[value]= for > when you > are using |values=. > > -- > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) > [http://daniel.friesen.name] > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports > 2008 30-Day > trial. Simplify your report design, integration and deployment - > and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Semediawiki-devel mailing list > Semediawiki-devel@lists.sourceforge.net > <mailto:Semediawiki-devel@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > ------------------------------------------------------------------------ > > _______________________________________________ > Semediawiki-devel mailing list > Semediawiki-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel