response property custom widget

Use this board to ask questions or have discussions with other Rich Displays users.
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

response property custom widget

Post by kyosuke »

Hello,

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

Thanks.
User avatar
matt.denninghoff
Profound Logic Staff Member
Posts: 115
Joined: Wed Feb 10, 2016 3:53 pm
First Name: Matthew
Last Name: Denninghoff
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: response property custom widget

Post 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.
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Re: response property custom widget

Post 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 250 times
User avatar
matt.denninghoff
Profound Logic Staff Member
Posts: 115
Joined: Wed Feb 10, 2016 3:53 pm
First Name: Matthew
Last Name: Denninghoff
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: response property custom widget

Post 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.
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Re: response property custom widget

Post 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.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: response property custom widget

Post 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.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: response property custom widget

Post 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.
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Re: response property custom widget

Post by kyosuke »

Ok thank you for your answer and your time.
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Re: response property custom widget

Post 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 2379 times
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: response property custom widget

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests