Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 17, 2014 @ 13:02
    Fuji Kusaka
    0

    FieldType.Label not displaying in V3.0.21

    Has anyone run into this issue before.

    I have created a FiledType.Label.Cshtml with the following in contour 3.0.21

    @model Umbraco.Forms.Mvc.Models.FieldViewModel
    <p>@Model.AdditionalSettings.FirstOrDefault(x => x.Key == "TextToShow").Value</p>
    But when form is renderedi get the following error message.
    String was not recognized as a valid Boolean   
    Anyone had this before  ??
    //fuji

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Comment author was deleted

    Oct 17, 2014 @ 14:03

    Do you have a strack trace for the error?

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 20, 2014 @ 08:08
    Fuji Kusaka
    0

    Hi Tim,

    Yes sure getting this when rendering the form 

    String was not recognized as a valid Boolean.

    and those when doing umb Trace

    DefaultCultureDictionary Error returning dictionary item 'Previous'
    No key Previous exists in dictionary
      at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
      at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    0.041584 0.000116
      In member mode 0.041785 0.000202
      Parsing Member placeholders start 0.041811 0.000026
      Parsing Member placeholders stop 0.041839 0.000028
    DefaultCultureDictionary Error returning dictionary item 'Next'
    No key Next exists in dictionary
      at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
      at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    0.041935 0.000096
      In member mode 0.042082 0.000148
      Parsing Member placeholders start 0.042108 0.000026
      Parsing Member placeholders stop 0.042134 0.000026
      In member mode    
        0.043168 0.000024
      Parsing Member placeholders stop 0.043194 0.000026
      In member mode 0.043922 0.000728
      Parsing Member placeholders start 0.043972 0.000050
      Parsing Member placeholders stop 0.044009 0.000037
    DefaultCultureDictionary Error returning dictionary item 'Half-marathon : Race of 21,1 Kms on road to be done within 4 hours'
    No key Half-marathon : Race of 21,1 Kms on road to be done within 4 hours exists in dictionary
      at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
      at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    0.044158 0.000149
      In member mode 0.044374 0.000216
      Parsing Member placeholders start    
        0.057197 0.000028
      In member mode 0.057230 0.000032
      Parsing Member placeholders start 0.057248 0.000018
      Parsing Member placeholders stop 0.057273 0.000025
    DefaultCultureDictionary Error returning dictionary item 'Please tick as appropriate below'
    No key Please tick as appropriate below exists in dictionary
      at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
      at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    0.057406 0.000133
      In member mode 0.057566 0.000160
      Parsing Member placeholders start 0.057590 0.000024
      Parsing Member placeholders stop 0.057618 0.000028
      In member mode 0.057650 0.000032
      Parsing Member placeholders start 0.057668 0.000018
      Parsing Member placeholders stop 0.057696 0.000028
    DefaultCultureDictionary Error returning dictionary item 'Please tick as appropriate below'
    No key Please tick as appropriate below exists in dictionary
      at umbraco.cms.businesslogic.Dictionary.DictionaryItem..ctor(String key)
      at Umbraco.Web.Dictionary.DefaultCultureDictionary.get_Item(String key)
    0.057788 0.000092
      In member mode 0.057935 0.000147
      Parsing Member placeholders start 0.057959 0.000024
      Parsing Member placeholders stop 0.057989 0.000030
           
        0.088621 0.000041

     Tried another basic form without any Dictionary Item but same issue.

    Any suggestions ?

     

    //fuji

  • Comment author was deleted

    Oct 20, 2014 @ 09:25

    Hmm that doesn't show the String was not recognized as a valid Boolean error

    What happens if you simplify the view so remove the p and the additionalsettings bit just to identify if the error is coming from that bit

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 20, 2014 @ 12:15
    Fuji Kusaka
    0

    same issue nothing changed. I even deleted the view file  FiledType.Label.Cshtml. 

  • Comment author was deleted

    Oct 20, 2014 @ 12:31

    Must be an issue in the fieldtype then, mind posting the label fieldtype c# class? 

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 20, 2014 @ 12:56
    Fuji Kusaka
    0

    you mean the FieldType.Label.cshtml ? 

    @model Umbraco.Forms.Mvc.Models.FieldViewModel
    <p>@Model.AdditionalSettings.FirstOrDefault(x => x.Key == "TextToShow").Value</p>

     

  • Comment author was deleted

    Oct 20, 2014 @ 13:19

    No the actual fieldtype class, so the c# class that inherits from FieldType and where the label fieldtype is defined

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 20, 2014 @ 13:58
    Fuji Kusaka
    0
    @inherits WebViewPage<Umbraco.Forms.Mvc.Models.FormViewModel>      
    @using Umbraco.Forms.Core
    @using Umbraco.Forms.Mvc.Models
    @using Umbraco.Forms.Mvc.BusinessLogic
    @using Umbraco.Forms.MVC.Extensions
    
    @if (Model.SubmitHandled)
    {
        <p class="contourMessageOnSubmit">@Html.Raw(Model.MessageOnSubmit)</p>
    }
    else
    {
        Html.EnableClientValidation();
        Html.EnableUnobtrusiveJavaScript();
    
        @Html.Partial(FormViewResolver.GetScriptView(Model.FormId), Model)
    
        if (!Model.DisableDefaultStylesheet)
        {
            <link rel="stylesheet" type="text/css" href="@Url.Content("~/umbraco/plugins/umbracocontour/css/jquery-ui-1.8.18.custom.css")" />
            <link rel="stylesheet" type="text/css" href="@Url.Content("~/umbraco/plugins/umbracocontour/css/defaultform.css")" />
        }                                                                   
    
        <div id="contour_form_@{@Model.FormName.Replace(" ","")}" class="contour @Model.CssClass">
            @using (Html.BeginForm("ContourForm", "FormRender", FormMethod.Post, new { enctype = "multipart/form-data" }))
            {
                @Html.AntiForgeryToken()
                @Html.HiddenFor(x => Model.FormId)
    
                <input type="hidden" name="FormStep" id="FormStep" value="@Model.FormStep"/>
                <input type="hidden" name="RecordId" id="RecordId" value="@Model.RecordId"/>
                <input type="hidden" name="PreviousClicked" id="PreviousClicked" value="@Model.PreviousClicked"/>
    
    
                <div class="contourPage">
                    <h4 class="contourPageName">@Html.Raw(Model.CurrentPage.Caption)</h4>
                    @if (Model.ShowValidationSummary)
                    {
                        @Html.ValidationSummary(false)
                    }
                    @foreach (FieldsetViewModel fs in Model.CurrentPage.Fieldsets)
                    {
                        <fieldset class="contourFieldSet">
                            @if (!string.IsNullOrEmpty(fs.Caption))
                            {   
                                <legend>@Html.Raw(fs.Caption)</legend>
                            }
                            @foreach (FieldViewModel f in fs.Fields)
                            {
                                bool hidden = f.HasCondition && f.ConditionActionType == FieldConditionActionType.Show;
                                <div class="@f.CssClass" @{if (hidden){<text> style="display: none"</text>}}>
                                    @if(!f.HideLabel){<label for="@f.Id" class="fieldLabel">@Html.Raw(f.Caption) @if (f.ShowIndicator){<span class="contourIndicator">@Model.Indicator</span>}</label>}
                                    <div>@Html.Partial(FieldViewResolver.GetFieldView(Model.FormId, f.FieldTypeName, f.Caption), f)
                                    @if (Model.ShowFieldValidaton){@Html.ValidationMessage(f.Id)}</div>
                                    @if (!string.IsNullOrEmpty(f.ToolTip)){<small>@f.ToolTip</small>}
                                </div>
                            }
                        </fieldset>
                    }
                    <div style="display:none">
                        <input type="text" id="HoneyPot"/>
                    </div>
                </div>
    
                <div class="contourNavigation">
                    @if (Model.IsMultiPage)
                    {
                        if (!Model.IsFirstPage)
                        {
                            <input class="cancel" type="submit" value="@Model.PreviousCaption" onclick="document.getElementById('PreviousClicked').value = 'back'"/>
                        }
                        if (!Model.IsLastPage)
                        {
                             <input type="submit" value="@Model.NextCaption"/>
                        }
                    }
                    @if (Model.IsLastPage)
                    {
                        <input type="submit" value="@Model.SubmitCaption"/>
                    }
                </div>                        
    
            }
        </div>
    }
  • Comment author was deleted

    Oct 20, 2014 @ 16:00

    That is the form view :), are you sure the error is coming from the label fieldtype, did you make changes to the field view or is it just the standard one? 

    1)if you remove the label from the form does it work then?

    2)if you remove the contour form from the page does the error go away then?

    From what I can see error isn't coming from the label

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 20, 2014 @ 20:22
    Fuji Kusaka
    0

    Tim,

    1) Label Removed from the form and do confirm the form works well without the label

    2) Did make a Preview of the form from the contour section and same issue so it must be the label field doing this.

     

  • Comment author was deleted

    Oct 21, 2014 @ 13:29

    Ok could you send me that custom fieldtype since it's not a default one... tg at umbraco dot com, thanks

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 21, 2014 @ 14:10
    Fuji Kusaka
    0

    You need the FieldType.Label ? 

  • Comment author was deleted

    Oct 21, 2014 @ 15:18

    Ok looks like you are running a customized version of contour contrib that has an bug in it (when running with latest public source it runs fine), so you'll need to notify your devs that the error exists in the customizations and they'll need to take care of it

    Cheers,
    Tim 

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 22, 2014 @ 07:45
    Fuji Kusaka
    100

    Tim,

    Thats wierd though i installed the package directly. Am i the only one who had that issue ? :) 

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 28, 2014 @ 03:25
    Fuji Kusaka
    0

    To solve this issue i instead created a custom label fieldType

Please Sign in or register to post replies

Write your reply to:

Draft