Skip to main content
Hi,

Can ANyone please help me to make K2Checkboxlist work with XML fields.

I created a XML field with few elements and which are set to boolean.

Now in my smart form i had a checkboxlist which had the same list as the elements of the xml field. The XMl field was set up as the datafield of the checkboxlist.

So when a user selects some options in the checkbox list, those options in xml field should be set to true.

Can anyone give me suggestion how to do this.

Thanx
N
When binding an XML field to a k2 Checklist box, the values stored in the field are the selected items from the list, not the list elements.

So, if you bind a listbox to an xml datafield, the xml will have a structure similar to this:
<root>
<Listbox>
<item/>
</Listbox>
</root>

when the listbox is bound to this field, the selected values will be recorded. On subsequent pages, the items corresponding to these values will be selected. The <item> element will be repeated in the xml field for each item selected.

The XML schema isn't used to popluate the listbox, this must be done in the smartform itself.

Reply