You can't. Contour uses it's own data types, only they're called field types. You can write your own field types, but they aren't as flexible as data types are. For more information on writing field types, refer to the Contour documentation (page 11). You can also take a look at how the current field types were written as HQ released the source code for the Contour Providers. The Contour Contrib project is open source and also has a few field types that you can take a look at and see how they were coded.
I've hit this one before and managed to come up with a solution that uses a custom field type and a jquery plugin called chosen to aproximate a multinode tree picker.
Basically the custom field type renders an asp list box with its selection mode set to multiple. (I wrapped the list box in a custom web control so I could do validation of the number of items selected)
The jquery plugin transforms the multiple select into something like a multinode tree picker. (See here http://harvesthq.github.com/chosen/ specifically the multiple select example for a demo of the plugin's functionality)
The field type works with contour prevalue sources (which can come from umbraco nodes) and saves the selected node id's as a csv. It can therefore be used to populate any multinode tree picker datatype that stores its data as CSV.
If you think it could do what you need, I could look at packaging up my code and releasing it at some point over the next couple of days.
After it's been used by a few people and any bugs that I've missed have been ironed out it might be worth looking at putting it in the contrib. For now I've marked it down as a beta until some more people have used it and it's had a chance to prove itself / fall over! :)
Aha! Think I've spotted it - it's an issue when no default value is selected. Apologies. Fixed in version 1.2 available from the package page. Also includes missing icons. If you uninstall the package and then reinstall the latest version it should sort it. Let me know?
uComponents in Contour
Hey
How do i add a MultiNodeTreePicker to a Contour form?
Thanks
Anyone?
You can't. Contour uses it's own data types, only they're called field types. You can write your own field types, but they aren't as flexible as data types are. For more information on writing field types, refer to the Contour documentation (page 11). You can also take a look at how the current field types were written as HQ released the source code for the Contour Providers. The Contour Contrib project is open source and also has a few field types that you can take a look at and see how they were coded.
Thanks for your anwser.
I know about field types and how to make them. The problem is how to implement a uComponent into a field type.
I guess it's not possible :(
Hi Stefan,
I've hit this one before and managed to come up with a solution that uses a custom field type and a jquery plugin called chosen to aproximate a multinode tree picker.
Basically the custom field type renders an asp list box with its selection mode set to multiple. (I wrapped the list box in a custom web control so I could do validation of the number of items selected)
The jquery plugin transforms the multiple select into something like a multinode tree picker. (See here http://harvesthq.github.com/chosen/ specifically the multiple select example for a demo of the plugin's functionality)
The field type works with contour prevalue sources (which can come from umbraco nodes) and saves the selected node id's as a csv. It can therefore be used to populate any multinode tree picker datatype that stores its data as CSV.
If you think it could do what you need, I could look at packaging up my code and releasing it at some point over the next couple of days.
Tom
It sounds exactly like what I need. I you don't mind I would love to try it out.
Thanks a lot!!
Hi Stefan, OK - I'll package it up and post again here once it's released. Should have it done in 48 hrs max :)
Awesome! I owe you!
Sounds awesome! Any chance you might want to include it in Contour Contrib or are you wanting to release it standalone?
Hi All,
OK; here it is http://our.umbraco.org/projects/backoffice-extensions/cogworks-multi-node-tree-picker-style-field-type-for-contour
After it's been used by a few people and any bugs that I've missed have been ironed out it might be worth looking at putting it in the contrib. For now I've marked it down as a beta until some more people have used it and it's had a chance to prove itself / fall over! :)
Many Thanks,
Tom
Thanks a lot!
This really helped me :)
Hi Stefan,
No worries, I've just noticed and fixed a bug in the validation that caused it to fail after 1 postback,
You may wish to uninstall the package, download version 1.1 from the link above and install,
Apologies,
Tom
For some reason i can't get the multipicker to show at all.
It's like it doesn't get rendered since not even the ListBox gets rendered.
It just shows like this:
<div>
<!-- The data entry control -->
</div>
It works in the backend just not on the actual form :/
Hi Stefan,
Apologies, what version of Umbraco / Contour are you using?
I'll see if I can replicate at this end,
Tom
All newest.
Umbraco 4.7.2
Contour 1.1.12
Hi Stefan,
Aha! Think I've spotted it - it's an issue when no default value is selected. Apologies. Fixed in version 1.2 available from the package page. Also includes missing icons. If you uninstall the package and then reinstall the latest version it should sort it. Let me know?
Tom
Works like a charm :)
Thanks !
is working on a reply...