[Kss-devel] Marshalling of form data

Hedley Roos hedley at upfrontsystems.co.za
Mon Feb 26 16:48:51 CET 2007


kss_MarshallTest-value_record: currentFormVar('arecord:record') record

I like that idea.

As for the currentFormVar method and marshalling, I implemented a few 
missing features.

Let's say we have

Case A
------
<input class="personclass" name="person.name:record" value="John">
<input class="personclass" name="person.surname:record" value="Smith">

then this KSS for a click event on any input with class personclass

kss_MarshallTest-person|record: currentFormVar()

will fill the person variable with {'name':'John', 'surname':'Smith'}

Case B (more impressive :)
--------------------------
First person
<input class="personsclass" name="persons.name:records" value="John">
<input class="personsclass" name="persons.surname:records" value="Smith">
Second person
<input class="personsclass" name="persons.name:records" value="Jane">
<input class="personsclass" name="persons.surname:records" value="Doe">

then this KSS for a click event on any input with class personsclass

kss_MarshallTest-person|record: currentFormVar()

will fill the person variable with {'name':'John', 'surname':'Smith'} if 
the user clicked on the first "element" and  {'name':'Jane', 
'surname':'Doe'} if the user clicked on the second "element".

These odd bits of functionality have drastically simplified my templates 
  and Python scripts.

Let me know when you have more time then we can chat some more.



More information about the Kss-devel mailing list