In Umbraco contour Create New Field Type Not Showing Db Saved Value
To add new richtext box editor in my form I followed below steps but i got half way success.
1) created new field type by adding below class inside app_code folder.
public class RichTextEditor : Umbraco.Forms.Core.FieldType
{
//public umbraco.editorControls.tinyMCE3.TinyMCE tn;
//public System.Web.UI.WebControls.TextBox tn;
[Umbraco.Forms.Core.Attributes.Setting("DefaultValue", description = "Default Value")]
public string defaultValue { get; set; }
[Umbraco.Forms.Core.Attributes.Setting("Placeholder", description = "Place Holder")]
public string placeHolder { get; set; }
public RichTextEditor()
{
this.Id = new Guid("D6A2C406-CF89-11DE-B075-55B055D89593 ");
this.Name = "RichTextEditor";
this.Description = "Renders a html input";
this.Icon = "icon-autofill";
this.DataType = FieldDataType.LongString;
}
}
2) In this path ..\Views\Partials\Forms\Fieldtypes
I have created below new field type with name
FieldType.RichTextEditor.cshtml and code looks like
ss @Model.Id // FOR SAMPLE I TRIED TO PRINT THIS VALUE AND IT ALWAYS NULL DON'T NO WHY
3) Now From umbraco admin login I did added new answer type e.g richtexteditor and it get's also appeared at client side and I am able to save that content inside my database table e.g personaldetail_tbl -> remarks column
inside form's .json file below tag automatically added
{
"caption": "General Remarks",
"tooltip": null,
"placeholder": null,
"cssClass": null,
"alias": "testEditor",
"id": "9739aac1-6c8e-4f65-abf9-85a0fb2b93e7",
"fieldTypeId": "d6a2c406-cf89-11de-b075-55b055d89593",
"prevalueSourceId": "00000000-0000-0000-0000-000000000000",
"dataSourceFieldKey": null,
"mandatory": false,
"regex": null,
"requiredErrorMessage": null,
"invalidErrorMessage": null,
"condition": {
"id": "00000000-0000-0000-0000-000000000000",
"enabled": false,
"actionType": "Show",
"logicType": "All",
"rules": []
},
"settings": {
"defaultValue": "[%generalremarks]",
"placeHolder": "",
"HTML": ""
},
"preValues": []
}
Now main problem is that ,a data which saved inside table is html data and when i open my form again then already saved data's value not able to coming. i mean to say newly added field type values not getting updated on form ( which I already saved inside database )
In Umbraco contour Create New Field Type Not Showing Db Saved Value
To add new richtext box editor in my form I followed below steps but i got half way success. 1) created new field type by adding below class inside app_code folder. public class RichTextEditor : Umbraco.Forms.Core.FieldType { //public umbraco.editorControls.tinyMCE3.TinyMCE tn; //public System.Web.UI.WebControls.TextBox tn; [Umbraco.Forms.Core.Attributes.Setting("DefaultValue", description = "Default Value")] public string defaultValue { get; set; }
}
2) In this path ..\Views\Partials\Forms\Fieldtypes I have created below new field type with name FieldType.RichTextEditor.cshtml and code looks like
@model Umbraco.Forms.Mvc.Models.FieldViewModel
ss @Model.Id // FOR SAMPLE I TRIED TO PRINT THIS VALUE AND IT ALWAYS NULL DON'T NO WHY
3) Now From umbraco admin login I did added new answer type e.g richtexteditor and it get's also appeared at client side and I am able to save that content inside my database table e.g personaldetail_tbl -> remarks column inside form's .json file below tag automatically added { "caption": "General Remarks", "tooltip": null, "placeholder": null, "cssClass": null, "alias": "testEditor", "id": "9739aac1-6c8e-4f65-abf9-85a0fb2b93e7", "fieldTypeId": "d6a2c406-cf89-11de-b075-55b055d89593", "prevalueSourceId": "00000000-0000-0000-0000-000000000000", "dataSourceFieldKey": null, "mandatory": false, "regex": null, "requiredErrorMessage": null, "invalidErrorMessage": null, "condition": { "id": "00000000-0000-0000-0000-000000000000", "enabled": false, "actionType": "Show", "logicType": "All", "rules": [] }, "settings": { "defaultValue": "[%generalremarks]", "placeHolder": "", "HTML": "" }, "preValues": [] } Now main problem is that ,a data which saved inside table is html data and when i open my form again then already saved data's value not able to coming. i mean to say newly added field type values not getting updated on form ( which I already saved inside database )
is working on a reply...