Creating custom FieldType with multiple SingleLine textboxes
I'm just getting started with creating my own field type and after following a few examples I have the basics down. But I seem to have fallen of perhaps a lack of experience with System.Web.UI.WebControls.
What I'd like to do with a number of Datatypes is include multiple <inpt type="text"> elements in a single FieldType. That I might generate output like the example bellow.
My trouble I is I'm not sure what element to create to return in the public override WebControl Editor or indeed if I will need to define a custom Control to match up with this.
I also believe I'd be right in thinking that I would need to add an additional view to control the rendered output.
Has anyone tackled this previously who might be able to point me in the right direction?
The webcontrols are needed if you want to render the form with the usercontrol macro if you want to render with the razor macro you'll need to setup the view
What will you be using then I can give you some extra details
The project I'm working on is MVC based so it's razor Macros for me at pressent. I've got custom controllers setup to handle social sign in but for dealing with the longer forms where data requirements may chop and change I was hoping to use custom FieldTypes and Contour to collect data.
I've already made little modifications to my forms view files so I'm pretty sure I know what I'm doing that end, it's at the FieldType and Control end I've managed to get lost.
Thanks Tim that is enoumously handy and has saved me hours of confusion. Looks like this whole process is much simpler than I thought it would be once your looking at it in MVC.
Just one more reason I can be glad I stuck to keeping this a Umbraco 6 MVC project =)
Well you'll probably need to fine tune it a bit but the basics are working and yes you don't need to worry about the webcontrols stuff :) glad I could help :)
Creating custom FieldType with multiple SingleLine textboxes
I'm just getting started with creating my own field type and after following a few examples I have the basics down. But I seem to have fallen of perhaps a lack of experience with System.Web.UI.WebControls.
What I'd like to do with a number of Datatypes is include multiple <inpt type="text"> elements in a single FieldType. That I might generate output like the example bellow.
My trouble I is I'm not sure what element to create to return in the public override WebControl Editor or indeed if I will need to define a custom Control to match up with this.
I also believe I'd be right in thinking that I would need to add an additional view to control the rendered output.
Has anyone tackled this previously who might be able to point me in the right direction?
Thanks everyone ^-^
Drew
Umbraco 6.0.3 - Contour 3.0.10
Comment author was deleted
Hey Drew,
The webcontrols are needed if you want to render the form with the usercontrol macro if you want to render with the razor macro you'll need to setup the view
What will you be using then I can give you some extra details
Hi Tim,
The project I'm working on is MVC based so it's razor Macros for me at pressent. I've got custom controllers setup to handle social sign in but for dealing with the longer forms where data requirements may chop and change I was hoping to use custom FieldTypes and Contour to collect data.
I've already made little modifications to my forms view files so I'm pretty sure I know what I'm doing that end, it's at the FieldType and Control end I've managed to get lost.
Comment author was deleted
Ok you don't need to worry about the webcontrol stuff then, gimme a couple of minutes and I'll post an example here
Thanks Tim thats very much appreciated. With a working example I should be able to repurpose this to all my multi textbox tasks.
Comment author was deleted
Ok this is an example of an mvc only fieldtype
The fieldtype:
The view:
Comment author was deleted
basicly I added a second input but added _second to the name of the input
then in the fieldtype I need to override the ProcessValue method to make sure the value of this one also get's added
Comment author was deleted
Link to the sourcecode: https://dl.dropboxusercontent.com/u/886345/Contour.MvcOnlyFieldType.zip (give it a couple of minutes it's still uploading)
Thanks Tim that is enoumously handy and has saved me hours of confusion. Looks like this whole process is much simpler than I thought it would be once your looking at it in MVC.
Just one more reason I can be glad I stuck to keeping this a Umbraco 6 MVC project =)
Comment author was deleted
Well you'll probably need to fine tune it a bit but the basics are working and yes you don't need to worry about the webcontrols stuff :) glad I could help :)
How do I install this in Umbraco?
Comment author was deleted
Unzip and drop the dll in the bin directory
Thank you Tim! Your sample helped me in getting something similar done.
is working on a reply...