User Defined Data

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

User Defined Data

Post by DaveLClarkI »

I had the following in the rowclick event of my grid and I was seeing the pop-up message telling me how many grid rows were selected, in real time, as each row was selected and unselected. Note that "wob" is the name of our Genie skin so we created a JavaScript "wob" object to hold all of our custom JavaScript functions.

Code: Select all

window.setTimeout(function()
{
  var cnt = wob.countGridRowSelections("ACSYAPPS", "SELECTED");
  pui.set("txtMessage", cnt + " selections active."); // build popup mesage
  wob.displayMessageText(null, "txtMessage", 0, "mouse", event);
}, 100);
Well, now I wanted to be able to pass that same selection count back to my RPG program. So, I added a user defined data property to my panel widget and bound it to an RPG field. Then, I modified the above code to add the single line shown below.

Code: Select all

window.setTimeout(function()
{
  var cnt = wob.countGridRowSelections("ACSYAPPS", "SELECTED");
  getObj("pnlApplications").pui.properties["user defined data"] = cnt;
  pui.set("txtMessage", cnt + " selections active."); // build popup message
  wob.displayMessageText(null, "txtMessage", 0, "mouse", event);
}, 100);
However, no matter how many rows are selected, my RPG program sees only a zero count. This is in spite of the fact that the pop-up message continues to show the correct count in the browser. Hence, the problem is with the following new line of code.

Code: Select all

  getObj("pnlApplications").pui.properties["user defined data"] = cnt;
"pnlApplications" is the id property associated with my panel widget. Is this wrong? What should I be doing differently? Thanks.
SeanTyree
Profound User
Posts: 76
Joined: Fri Jan 11, 2013 6:11 pm
First Name: Sean
Last Name: Tyree
Company Name: US HealthWorks
State / Province: California
Zip / Postal Code: 91355
Country: United States
Contact:

Re: User Defined Data

Post by SeanTyree »

Dave,

I would think the code to update the value of pnlApplications' user defined data would be:

Code: Select all

applyProperty("pnlApplications","user defined data",cnt);
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: User Defined Data

Post by DaveLClarkI »

doh! OK, thanks.
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: User Defined Data

Post by DaveLClarkI »

Well, that is still not giving me the desired result. Also, I looked back in some of my existing JavaScript code, which is working from previous projects, and I find that I have used both methods for setting the PUI properties and, as I said, they both work. So, something else is going on here.

The only thing I can figure is that widget property values can be set from RPG but changes to those properties at the client (other than the "value" property and the like) are not subsequently returned to RPG. Would someone at Profound please confirm or debunk this theory? Thanks.
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: User Defined Data

Post by DaveLClarkI »

I changed to using a hidden text box, instead of the "user defined data" property, and all is working as desired, now. Thanks.

<editorial>
I hate having to create yet another hidden widget every time I turn around in the Profound UI. They just make a mucking mess out of the design interface with an ugly clutter of greyed-out elements. It can also be a pain to find places to put them where they won't either disappear behind other widgets (and get "lost") or overlay the more "visible" elements. This makes it difficult to "see" and evaluate the overall layout of the screen or container on the basis of cosmetic impact.

User-defined widget properties are a much better means of keeping track of "extra" data needs. This includes giving the "screen"-level and "grid"-level objects the ability to carry "user defined data" -- which they don't currently have.

If only widget property bindings would return data to RPG as well as they receive them. I see all kinds of uses of such bi-directional functionality for widget property bindings.
</editorial>
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: User Defined Data

Post by Scott Klement »

Unfortunately, "user defined data" is not considered a "response property" (i.e., it's output-only), so variables bound to it will not be returned to your RPG program. If you would like this to be changed (sounds like you would) I could discuss this with the team, let me know.

On some widgets, setting pui.properties["prop name"] directly may work. But, it depends on the type of widget, and although it may work today, it could break in a future release of Profound UI. Please use the applyProperty() API instead, this should always work.
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: User Defined Data

Post by DaveLClarkI »

Scott Klement wrote:Unfortunately, "user defined data" is not considered a "response property" (i.e., it's output-only), so variables bound to it will not be returned to your RPG program. If you would like this to be changed (sounds like you would) I could discuss this with the team, let me know.
I haven't had a problem with the "user defined data" property as long as I am setting the bound field from RPG -- then I get the same value back. This is the first time I have tried setting the "user defined data" property from the client side. So, yes, I would like it changed so that client-side changes to the value of the "user defined data" property are passed along to the bound field for RPG consumption. Thanks.

While you're at it, I'd like to request that "user defined data" be added to the "screen"-level properties list and to the properties list for the grid widget. Thanks.

Further, since you brought up the issue regarding what is considered to be a "response property," I get the idea that other widget properties (besides the "user defined data" property) would have the same "problem" with being able to transfer client-side changes to those properties through to the RPG program -- e.g., the top, left, and width properties.

If this is so, then I see it as valuable if Profound Logic would "throw away" the concept of what is considered to be a "response property" and make it so that any bindable widget property be able to pass client-side changes to those properties through to the RPG program. I also see this as a consistency and flexibility issue which speaks to whether the PUI interface is more intuitive, or less so, to use from a customer standpoint.
Scott Klement wrote:On some widgets, setting pui.properties["prop name"] directly may work. But, it depends on the type of widget, and although it may work today, it could break in a future release of Profound UI. Please use the applyProperty() API instead, this should always work.
Will do.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests