Im trying to implement a method that allows my user to add html snippets into forms as explanatory text sections. I have created a custom field type that correctly displays the content picker when setting the field up but if I try to edit the field the javascript fails and nothing happens when I click to edit.
I'm assuming there is something wrong with my editor setup but I can't find an example of what editor I should be using so I'm not sure what to do next.
Heres the error being thrown;
Uncaught TypeError: Cannot read property '_itemIdValueClientID' of undefined
Which is thrown from the SetPickerValue method in umbracoforms.js. It fails because it can't find the element with the ID thats being passed into the function (pickerClientId).
Here is my editor constructor;
private ContentPickerWithXpathOption cc = new ContentPickerWithXpathOption();
public override System.Web.UI.WebControls.WebControl Editor { get { cc.ShowXPath = false; cc.ID = "cc_" + this.Id; if (!String.IsNullOrEmpty(NodeToShow)) cc.Value = NodeToShow; return cc; } set { base.Editor = value; } }
Thanks for looking into this for me. Yes the content picker is a setting on the custom fieldtype, everything works except the edit field option.
I was just guessing at the editor setup above and was wondering if I should be using the content picker from the Umbraco.Forms.Core.FieldSetting.Pickers namespace for the editor. The issue I'm having there is trying to get it output as some kind of WebControl as I cant embed that picker in a panel or return it directly in the getter.
We are using version 3.0.9 and we have the same issue. Everything works great, except for the edit button that causes the javascript exception. Could you please look in to this? Thanks in advance.
Just to muddy the waters we are using Umbraco 4.11.4 and Contour 3.0.9 but its the same steps as Kees to reproduce the issue and I can also provice source for the fieldtype if that will help.
I updated a clone of my production site and I now when I add my custom fieldtype I get a javascript error and the field fails to show the content picker in additional settings. On previously created fields I get the same error when trying to edit.
Uncaught TypeError: Cannot call method 'ClearSelection' of undefined
Its falling over when it hits the ClearPickerValue function with the error above. In the snippet above I'm dumping out the selected node and then the picker id after you have finished stripping out certain strings just before it trys;
Its a bit of a mash up of bits I've found in the forum and in examples on contour.contrib so as I think I said right at the beginning of this thread I have no idea if I am calling the right picker types in here.
The relevent bits are
[Setting("Html To Show", prevalues = "",
description = "HTML content to be displayed",
control = "Umbraco.Forms.Core.FieldSetting.Pickers.Content")]
public string NodeToShow { get; set; }
and the editor is
private ContentPickerWithXpathOption cc = new ContentPickerWithXpathOption();
///
/// Gets or sets Editor
///
///
public override System.Web.UI.WebControls.WebControl Editor
{
get
{
cc.ShowXPath = false;
cc.ID = "cc_" + this.Id;
if (!String.IsNullOrEmpty(NodeToShow)) cc.Value = NodeToShow;
return cc;
}
set
{
base.Editor = value;
}
}
I have emailed you the entire class file to your umbraco.dk address.
Everything works well until I started to use Umbraco.Forms.Core.FieldSetting.Pickers.Content as control for my porperty from Additional settings, here is code:
[Setting("ParentNode", control = "Umbraco.Forms.Core.FieldSetting.Pickers.Content", description = "Enter the parent node for prevalues")]
public string ParentNode { get; set; }
For example if I use Umbraco.Forms.Core.FieldSetting.Pickers.DocumentType it works well.
The console throws exception of umbracoforms.js:
Uncaught TypeError: Cannot read property 'inst' of undefined
Content picker used in field type
Hi all,
Im trying to implement a method that allows my user to add html snippets into forms as explanatory text sections. I have created a custom field type that correctly displays the content picker when setting the field up but if I try to edit the field the javascript fails and nothing happens when I click to edit.
I'm assuming there is something wrong with my editor setup but I can't find an example of what editor I should be using so I'm not sure what to do next.
Heres the error being thrown;
Which is thrown from the SetPickerValue method in umbracoforms.js. It fails because it can't find the element with the ID thats being passed into the function (pickerClientId).
Here is my editor constructor;
Any help or direction appreciated.
Simon
Comment author was deleted
So the contextpicker is an setting on your custom fieldtype, don't think that it fully supported at the moment, will take a look
Hi Tim,
Thanks for looking into this for me. Yes the content picker is a setting on the custom fieldtype, everything works except the edit field option.
I was just guessing at the editor setup above and was wondering if I should be using the content picker from the Umbraco.Forms.Core.FieldSetting.Pickers namespace for the editor. The issue I'm having there is trying to get it output as some kind of WebControl as I cant embed that picker in a panel or return it directly in the getter.
Any advice would be great.
Thanks
Simon
Comment author was deleted
Looking into this today so more details will folow shortly
Comment author was deleted
Thought it was a bug but it is just not supported atm so will need some work to support the content picker, will do the updates this week
Hello Tim,
We are using version 3.0.9 and we have the same issue. Everything works great, except for the edit button that causes the javascript exception. Could you please look in to this? Thanks in advance.
With kind regards,
Kees de Wit
Here is the bug report for this issue: http://issues.umbraco.org/issue/CON-328
Comment author was deleted
Ok assigned it to the next maintenance release so a fix should be part of the 3.0.10 release
Many thanks! When do you plan to release the 3.0.10?
Comment author was deleted
1 May or sooner
Is there any way (maybe if we pay some money) to get this fixed earlier?
Comment author was deleted
Soonest I can look is Monday so more news will follow then, hope it's an easy fix
Monday would be great. We just bought the license. Let's hope it's a minor fix.
Comment author was deleted
Yup will keep you posted on the progress
Comment author was deleted
Hmm just tested and don't get the bug, could you tell me what Umbraco version you are running
We are using Umbraco v6.0.3 (Assembly version: 1.0.4836.20227) with contour 3.0.9
Steps to reproduce:
I can also send the source code of the field that contains the content picker setting or any other sourcecode if that will help.
Comment author was deleted
Ok thanks will try with that version
Comment author was deleted
Ok can reproduce the bug if I'm using Umbraco 6.0.3
Hi Tim,
Just to muddy the waters we are using Umbraco 4.11.4 and Contour 3.0.9 but its the same steps as Kees to reproduce the issue and I can also provice source for the fieldtype if that will help.
Comment author was deleted
Ok thanks for the extra details, looking into a fix now
Comment author was deleted
Ok looks like it's due to some changes made in the core Umbraco content picker, fix eta today/tomorrow
Comment author was deleted
Almost there, just need to do some additional tests but you can expect a fix later today
Great news! I've been waiting for this all day ;)
Comment author was deleted
Ok looks good could you try your custom fieldtype with a 3.0.10 install
nightly.umbraco.org/.../
If that works you can upgrade
our.umbraco.org/.../Upgrade
Hi Tim,
I updated a clone of my production site and I now when I add my custom fieldtype I get a javascript error and the field fails to show the content picker in additional settings. On previously created fields I get the same error when trying to edit.
Here are some details from an inital look
Its falling over when it hits the ClearPickerValue function with the error above. In the snippet above I'm dumping out the selected node and then the picker id after you have finished stripping out certain strings just before it trys;
I've checked and double checked my deployment of the wip patch and can't see anything I've missed.
Hope that helps a little.
Simon
Comment author was deleted
Thanks for the details Simon, will test on the umbraco version you are running, 4.11.4 right?
Yup,
Thanks for the fast reply :)
Comment author was deleted
@Kees any chance you can also try to see if your issue has been resolved on umbraco 6
I'm temporarily on another project with priority so I can test this tomorrow morning. First thing tommorow.
Comment author was deleted
@Kees ok thanks, but I'm pretty sure the content picker is working it's the content picker with xpath that is still giving issues
Comment author was deleted
@Simon just tested and contentpickerwithxpath is also working in my setup
Any chance you can share the code of your custom fieldtype?
Sure,
Its a bit of a mash up of bits I've found in the forum and in examples on contour.contrib so as I think I said right at the beginning of this thread I have no idea if I am calling the right picker types in here.
The relevent bits are
and the editor is
I have emailed you the entire class file to your umbraco.dk address.
Comment author was deleted
Ok found and fixed the issue, new build is up, so upgrade to the latest 3.0.10 WIP http://nightly.umbraco.org/Umbraco%20Contour/3.0.10%20WIP/ make sure to clear browser cache since it involves a couple of js updates
That one worked a treat, you just made quite a few people here very happy.
Thanks for all your time on this one :)
Simon
Comment author was deleted
Sweet, thanks for confirming!
I'm also glad to confirm that this fix works. Thank you very very much!
Comment author was deleted
Great, thanks for confirming :)
Hi guys!
It looks like that I have a related issue with 3.0.18.
I've set up Umbraco 7 release and Contour 3.0.18 from http://nightly.umbraco.org/Umbraco%20Contour/3.0.18/.
Everything works well until I started to use Umbraco.Forms.Core.FieldSetting.Pickers.Content as control for my porperty from Additional settings, here is code:
For example if I use Umbraco.Forms.Core.FieldSetting.Pickers.DocumentType it works well.
The console throws exception of umbracoforms.js:
Uncaught TypeError: Cannot read property 'inst' of undefined
Am I doing something wrong?
Any help will be appreciated. Thanks in advance
I just hit this issue with Contour v3.0.21 on Umbraco 7.1.5
This happens when one of my Settings for a custom type is set to Umbraco.Forms.Core.FieldSettings.Pickers.Content.
Uncaught TypeError: Cannot read property 'inst' of undefined
Simple types are fine.
Any help on this one Tim would be ace.
I am having the same issue as Peter
is working on a reply...