2

I am following these instructions provided by Sitecore to create a simple custom form element with an additional text property for managing a tooltip value. I have created the necessary coreDB components for the form designer UI, the masterDB field template, and the view model class (inheriting StringInputViewModel, marked as Serializable).

This all appears fine when I'm working in the form designer - I can see/edit my new property using the designer and I can see breakpoints getting hit on my property get/setters on my new FieldViewModel type. However, the value being passed to the model is always the original value set against the generated form field content item (empty by default, or whatever value I set manually if I edit the form field item directly using the content editor).

As best I can tell, the issue is the Speak field is not binding correctly to my view model. The only reference I can find to this binding process is in the above doc at the step labelled Configuring the Field Editor Parameters where there is an obtuse reference to 'FormData' and mapping the field model property name (implied to be a camelCase reference to the property name in my view model) to the front-end form designer control value.

In my case, my FieldViewModel implementation has just one additional string property for Tooltip, so my BindingConfiguration pairing is tooltip | Value to match what appears in these instructions.

I'm seeking any more information on the 'FormData' referred to herein, as I feel like this is perhaps related to my issue, and any steps I can take to troubleshoot this binding process. Any help or advice is very much appreciated!

1 Answer 1

2

The issue appears to be that 'Tooltip' is a reserved field name which led to my own field not being properly handled during the binding process (despite the appearance of returning the correct data from the saved field content item).

Changing the name/BindingConfiguration of the field in the FormTextBox Parameters item and renaming the property in my view model class immediately resulted in the binding working as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.