Skip to main content
I'm having problems updating a XML Field in a Smart Form and this is how my page is set up:

I have a K2 Textbox that has as its datafield a XML Field from my K2 Process, and I give it a DataXPath to get the xml into the textbox. From the xml that is recieved when the page loads, I load an XMLDocument from the text in the K2Textbox and iterate through that in the Page_Load event to populate a Listbox webcontrol that displays email addresses. From there I have 2 buttons (Add, Remove) to update the values in the listbox. This all works fine.

My problem is when I click on the K2Submit button, in the event handler of the K2Button I recreate the xml string from the values in the Listbox and populate the K2Textbox text property with the new xml. This does not update the xml field in the K2 Process. Is there a way to update this xml field with my new values?
Well, I figured it out. Either I need to update the K2Textbox using client side javascript, or on the Page_Load event by getting all of the items in the Listbox. Updating the K2Textbox inside the event handler for the K2Submit button won't update the xml field for the K2 process.

Reply