DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:struct:bureaucracy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:struct:bureaucracy [2019-10-30 13:53] – [Templates] anndaplugin:struct:bureaucracy [2022-11-04 07:38] (current) – [Prefilling] Add image, Clarification on the format of the data saggi
Line 61: Line 61:
 </form> </form>
 </code> </code>
 +
 +==== Prefilling ====
 +
 +You can prefill fields by adding a ''='' after the field name. You must pre-fill with the formats stored in the database, not the formats you get when the table or page is displayed (e.g. dates are in Y-m-d format, independent of your locale). \\
 +When you set a ''Text'' use ''%%"=some text"%%'', for a date use ''=2020-01-01'' or simple variables like ''=%Y-%m-%d''. \\
 +For Lookup-Fields on Page-Schemes you must setup the complete namespace to the target (e.g. ''%%"=[""ns:ns1:ns2:page"",0]"%%''). For Lookup-Fields in in Lookup-Schemes you must set the ''rid'' (e.g. ''%%"=["""",1]"%%'') of the row. Watch out for the double-quotes! This form is valid for struct-db starting from version 16.
 +
 +Following code
 +
 +<code>
 +<form>
 +action struct_lookup
 +struct_field "employeetraining.employee"
 +struct_field "employeetraining.training" "=[""ns:ns1:ns2:page"",0]"
 +struct_field "employeetraining.date" =%Y-%m-%d
 +struct_fieldhidden "employeetraining.last date" =%Y-%m-%d
 +submit "Save into lookup"
 +</form>
 +</code>
 +
 +will result in this (localized in Schema-Editor):
 +
 +{{https://i.ibb.co/B2Q6Y59/sampleform-struct-lookup.png|struct-lookup}}
  
plugin/struct/bureaucracy.1572439991.txt.gz · Last modified: 2019-10-30 13:53 by annda

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki