having a summary/confirm page at the end of the form?
I would like to have a kind of summary page after a user has filled out the contour formular so they can see what they typed in, and confirm the inputted data.
I just don't know how best (how at all) to code/create that feature. Can anybody help me out? Maybe point me to the right tools... could i do it by using workflows, and how? or should/could it be done by code?
yes, that sounds like it could work. Because then you could loop through all fields with data in them, show then to the user and ask the user to approve or to go to previous step and change whatever they need to...
I will give it a try. Also a good task for me to becoming more familiar with creating custom fieldtypes :)
It is allmost perfect. It does in fact update the value so that it is empty. But the RecordField still returns as HasValue. This is a minor thing (in this case), but would of course be nice if that worked to.
having a summary/confirm page at the end of the form?
I would like to have a kind of summary page after a user has filled out the contour formular so they can see what they typed in, and confirm the inputted data.
I just don't know how best (how at all) to code/create that feature. Can anybody help me out? Maybe point me to the right tools... could i do it by using workflows, and how? or should/could it be done by code?
Any help is alot of help :-)
Regards,
Christian
Comment author was deleted
Maybe a custom fieldtype that you then place on the second step..
yes, that sounds like it could work. Because then you could loop through all fields with data in them, show then to the user and ask the user to approve or to go to previous step and change whatever they need to...
I will give it a try. Also a good task for me to becoming more familiar with creating custom fieldtypes :)
Thanks for the input Tim
Now i got the custom fieldtype working. It only displays what have been filled out in prev step, so all is good there.
But when i test it and go back to a prev step and alter some values, specific, if i set a textbox value to blank, the change does not save.
Any idea why this happens?
Comment author was deleted
Mind sharing the code?
sure, is there a way to format the code a bit when you submit it? (in the forum editor i mean)
Just so that it don't fill 2 screenheights :)
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Web;
using
System.Web.UI.WebControls;
using
System.Xml.XPath;
using
Umbraco.Forms.Core;
using
Umbraco.Forms.Data.Storage;
namespace
Stenfors.Contour.FieldTypes
{
publicclassOrderSummary : Umbraco.Forms.Core.FieldType
{
[Umbraco.Forms.Core.Attributes.Setting(
"Intro tekst", description = "En tekst som bliver vist før opsummeringen", control = "Umbraco.Forms.Core.FieldSetting.TextField")]
publicstring IntroText { get; set; }
public System.Web.UI.WebControls.Label lb;
publicList<Object> _value;
public OrderSummary()
{
//Provider
this.Name = "Opsummering af bestilling";
this.Id = newGuid("D6A2C406-CF89-11DE-B075-55B055D89593");
this.Description = "Dette vil vise en opsummering af det som er blevet bestilt";
//FieldType
this.Icon = "label.png";
this.DataType = FieldDataType.String;
lb =
new Label();
_value =
newList<object>();
}
publicoverride WebControl Editor
{
get
{
WebControl wc =
new WebControl(System.Web.UI.HtmlTextWriterTag.Div);
Literal lt =
new Literal();
try
{
lt.Text =
"<h2>Bekræft din bestilling</h2>";
Umbraco.Forms.Data.Storage.FormStorage fStorage =
new Umbraco.Forms.Data.Storage.FormStorage();
Form form = fStorage.GetForm(
"ordSum");
string cookieStuff = Umbraco.Forms.Core.Services.RecordService.GetCookieReference(form);
string cookie = umbraco.library.RequestCookies(cookieStuff);
RecordStorage rs =
new RecordStorage();
Guid g = newGuid(cookie);
Record r = rs.GetRecord(g);
foreach (Guid fieldId in r.RecordFields.Keys)
{
RecordField rf = r.RecordFields[fieldId];
if (rf.HasValue())
{
Field field = rf.Field;
FieldSet fieldSet =
new FieldSetStorage().GetFieldSet(field.FieldSet);
lt.Text +=
"<p>" + fieldSet.Caption + ", " + field.Caption + " = " + rf.ValuesAsString() + "</p>";
}
}
}
catch (Exception ex)
{
lt.Text =
"<p>log ID : " + _logger + ", grapper: " + _grapper + ", besked: " + ex.Message + "</p>";
}
wc.Controls.Add(lt);
return wc;
}
set
{
base.Editor = value;
}
}
publicoverridebool HideLabel
{
get
{
returntrue;// base.HideLabel;
}
set
{
base.HideLabel = value;
}
}
publicoverrideList<object> Values
{
get
{
return _value;
}
set
{
_value =
value;
}
}
publicoverridestring RenderPreview()
{
return"label tekst";
}
publicoverridestring RenderPreviewWithPrevalues(List<object> prevalues)
{
return RenderPreview();
}
}
}
Comment author was deleted
Ok thanks I'll take a look and report back :)
cool. Thank you for helping.
What i don't understand is why this problem happens to the normal fieldtypes.
Umbraco CMS version = 4.7.1
Contour version = 1.1.11
Comment author was deleted
Looks like it's a bug in Contour, it doesn't clear the value , checking a fix now
Comment author was deleted
Works ok with razor render so it's the webcontrols
Comment author was deleted
Fixed will be part of 3.0.8 http://issues.umbraco.org/issue/CON-272
What version are you currently using that I can see if it's possible to provide a patch for you install
Comment author was deleted
Nevermind so you are using Contour version = 1.1.11 :) will see if I can provide you with a patch
Comment author was deleted
Ok should work gimme 15 mins :)
Like you said it's happening with the default fieldtypes so nothing wrong with your code!
Would be so cool if you could help me out with some sort of patch for this :)
Comment author was deleted
Try this: https://dl.dropbox.com/u/886345/PatchForChristian.zip
Unzip and place in the bin directory overwriting the existing providers assembly
Let me know if that does the trick
hephey, my very own patch! Very VIP stuff here :D
It is allmost perfect. It does in fact update the value so that it is empty. But the RecordField still returns as HasValue. This is a minor thing (in this case), but would of course be nice if that worked to.
Is that fixable?
Comment author was deleted
Well it has a value, an empty string, so you can also include a check for that (stringnullorempty) would that work ?
yes, in this case that is just fine :)
thank you for helping me out, your a life-saver!
I will mark your suggestion for using a custom fieldtype as the answer, and then Hi5 you for the patch.
Have an awesome day..
You can see the endresult here if you are interested:
http://janssmoerrebroed.dk/bestilling-af-smoerrebroed.aspx
Comment author was deleted
Nice :)
is working on a reply...