Page 1 of 1

Custom Widget Names (Field Type) and ProfoundUI Visual Designer

Posted: Wed Apr 29, 2015 5:57 am
by Mark Smart
Hi All,

I have a custom widget with the name "info button", which works perfectly. I was having some problems creating a new widget, so I copied the working .js to anotherinfobutton.js and changed it's name property in pui.widgets.add to "another info button". This also works fine.

However, when I attempt to name a widget "todo list", I receive a "Widget name is invalid" alert when I try to put it on the design surface. I get the same message on another widget called "user messages". All I've done is change the name property from "another info button" to "todo list".

What's interesting is if I put a working "info button" on the design surface and look at the available field types, both "user messages" and "todo list" are listed. I just can't put them on the design surface without getting the "Widget name is invalid" alert.

Works:
// Define Base widget
pui.widgets.add({
name: "info button",
newId: "standardInfoButton",
menuName: "Information Button",

Doesn't work:
// Define Base widget
pui.widgets.add({
name: "todo button",
newId: "standardInfoButton",
menuName: "Information Button",

Has anybody else experienced this behaviour?

Many thanks,

Mark

Re: Custom Widget Names (Field Type) and ProfoundUI Visual Designer

Posted: Thu Apr 30, 2015 3:51 pm
by Scott Klement
I'm at a conference right now, so this is off the top of my head, but...

There are two places where you have to specify the widget name, both the "pui.widgets.add" that you show, and "pui.toolbox.add" as well. Is it possible that one of them has 'todo list" and the other has something difference? If the two don't match, you can get an error like this.

Could that be it?

Re: Custom Widget Names (Field Type) and ProfoundUI Visual Designer

Posted: Thu Apr 30, 2015 3:56 pm
by Scott Klement
If it helps, you can find more info on custom widgets here:
http://www.profoundlogic.com/docs/displ ... om+scratch

Re: Custom Widget Names (Field Type) and ProfoundUI Visual Designer

Posted: Fri May 01, 2015 5:13 am
by Mark Smart
Thanks Scott,

You're spot on:

pui.widgets.add({
name: "todo list",
.
. //blah
.
pui.toolbox.add({
widget: "todo list",

Works a treat.

Cheers,

Mark