Page 1 of 2

response property custom widget

Posted: Thu Mar 10, 2016 11:38 am
by kyosuke
Hello,

I got a simple question, how to add response property to a custom widget without use pui.widgets.getStyledButtonProxy( defaults ) ?

Thanks.

Re: response property custom widget

Posted: Fri Mar 11, 2016 5:52 pm
by matt.denninghoff
I'm not sure I understand what you're asking. I assume this is for a button widget. Are you trying to handle what happens when the button proxyHTML loads?

getStyledButtonProxy() returns some HTML that is displayed when you are dragging the widget from the toolbox onto the design canvas.

Re: response property custom widget

Posted: Mon Mar 14, 2016 3:27 am
by kyosuke
Yes its for a button widget and I don't use getStyledButtonProxy()
I want add my button in response control
custombutton.js
(5.84 KiB) Downloaded 299 times

Re: response property custom widget

Posted: Fri Mar 18, 2016 5:40 pm
by matt.denninghoff
So you are making a custom button and you want to bind something to the "response" property?

If so, then you can add this to your button.js file:

Code: Select all

pui.addCustomProperty({
name: "response",
type: "long",
help: "response property",
controls: ["Custom Menu Button"],
category: "Identification",
readOnly: true,
hideFormatting: true,
validDataTypes: ["indicator", "char", "zoned"],
format: "1 / 0"
});
That will add a "response" property to the widget. You can bind an indicator, character, or decimal to the button response.

Re: response property custom widget

Posted: Mon Mar 21, 2016 6:17 am
by kyosuke
Yes, and I already tryed this solution but if I do this my custom button works well but the standard button like button or styled button dosen't work anymore like my custom property overide the original.

Re: response property custom widget

Posted: Mon Mar 21, 2016 6:44 pm
by Scott Klement
What you are describing here is the known/expected behavior.

Properties are not "subordinate" (if that is the right word?) to a widget as many people expect. For example, the response property of the "button" widget is the same property as the response for an "image" widget. There is not two properties named button/response and image/response as you might expect, there is just one property named "response", and it has been applied to the button and the image.

So if you create your own "response", it replaces the one that we include with the product, and will likely cause problems.

Unfortuntely, even if you use your own property name, there is no way to make it bi-directional. This is a limitation of custom widgets. Please file a feature request with support@profoundlogic.com so that this can be fixed. We already have this on our to-do list, but the more customers that report it, the higher it will be prioritized.

Re: response property custom widget

Posted: Mon Mar 21, 2016 6:47 pm
by Scott Klement
What you are describing here is the known/expected behavior.

Properties are not "subordinate" (if that is the right word?) to a widget as many people expect. For example, the response property of the "button" widget is the same property as the response for an "image" widget. There is not two properties named button/response and image/response as you might expect, there is just one property named "response", and it has been applied to the button and the image.

So if you create your own "response", it replaces the one that we include with the product, and will likely cause problems.

Unfortuntely, even if you use your own property name, there is no way to make it bi-directional. This is a limitation of custom widgets. Please file a feature request with support@profoundlogic.com so that this can be fixed. We already have this on our to-do list, but the more customers that report it, the higher it will be prioritized.

Re: response property custom widget

Posted: Tue Mar 22, 2016 3:24 am
by kyosuke
Ok thank you for your answer and your time.

Re: response property custom widget

Posted: Tue Mar 22, 2016 3:36 am
by kyosuke
I just want to add,
i tried to add in your original designer.js my custom button in the list of controllers and its works perfectly but i know thats not a good way cause this is proddata file, but I wondering if there is no little trick to add my button in this list ?
Capture.JPG
Capture.JPG (25.27 KiB) Viewed 2621 times

Re: response property custom widget

Posted: Tue Mar 22, 2016 10:26 pm
by Scott Klement
Currently, no.. there is no way to add this aside from manually editing the files as you've done. If you manually modify the proddata files, you'd want to change it in runtime.js, genie.js and designer.js. But, changing these files is not recommended because your changes will be lost if you upgrade or install a patch.