Try our conversational search powered by Generative AI!

XForms html markup

Vote:
 

Hi, I'm working in a new EPiServer 8 MVC project, and I've followed this nice post (thanks Nicola) to get the XForms working:

http://nicolaayan.blogspot.com.es/2015/03/using-xforms-in-episerver-8-mvc.html.

But now I need a complete different rendering html markup for my xform, it has many fields and some kind of a special design (some fields per row, with label for each field).

What would be the way to achieve this??? I'm thinking about creating a specific viewmodel, that accepts a xform as a property, and rendering the fields in a new view that accepts this viewmodel, so in this way I've complete control of the markup. But it seems a little complicate to me, I want to keep it simple...is there a better way to render a XForm with complete control on the html markup?

Anyway, I'm not sure how can I get the fields from the XForm to render them as desired........suggestions????

Regards

#131543
Jul 29, 2015 23:08
Vote:
 

Hi,
http://www.eyecatch.no/blog/2013/09/full-customization-of-xforms-with-episerver-7-and-mvc/

Another simple(not best) way to render can be...
If your XForm is of fixed fields and editors will not extend the XForm ...
then write your HTML and design as complex as you want in HTML and post the XFORM in coding.

/K

#131551
Jul 30, 2015 9:10
Vote:
 

I'll try in some way...Thank you.

But how "and post the XFORM in coding."??? Have you a link to a code sample to do this????

Regards

#131556
Edited, Jul 30, 2015 9:31
Vote:
 

XForms are most likely going away and I wouldn't bet on some kind of conversion tool being able to convert between XForm forms+data and their replacement.

So if you are already needing a bunch of custom stuff and also complete markup control I would look into putting the data somewhere custom as well and add some plugin where the data can be viewed and exported.

#131586
Jul 30, 2015 15:05
Vote:
 

"putting the data somewhere custom as well and add some plugin where the data can be viewed and exported."...............hhhhmmmmm interesting idea, can you be more specific about "putting the data somewhere somewhere" and "some plugin"??????

Regards

#131588
Jul 30, 2015 15:12
Vote:
 
//On form submit

xForm = EPiServer.XForms.XForm.CreateInstance(Your X form guid);
//set xForm properties
xForm.Save();



#131590
Edited, Jul 30, 2015 15:22
Vote:
 

I would add my own database table(s) and use Dapper or Entity Framework for saving the data collected from the form.

In my own edit or admin mode plugin I would query that table and output data as required (usually with some export, search and filtering functionality).

The form and actions would be done similiar to this:
http://krompaco.nu/2015/01/working-with-your-own-forms-in-episerver-and-mvc/

#131592
Jul 30, 2015 15:27
Vote:
 

As easy as it looks.........Thank you Mr. Khan!!!

#131593
Edited, Jul 30, 2015 15:27
Vote:
 

Thank you Johan!!!!...you and Mr. Khan propose different solutions,...I'll think which is best/simple for my project.

Regards

#131596
Jul 30, 2015 15:35
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.