Perspective Property Editor is empty

Hi,

I was working in the designer and added a new custom session property. The idea being to store file Bytes before sending the file to a database table. I have done this in other projects without issue. Following this, the designer started to lag, taking a long time to respond to any input. Eventually the designer crashed.

Now when I open the project in the designer, the Perspective Property Editor is completely blank.

I have opened different projects in the designer and these all have the session properties that I would expect to see.

Does anyone have any idea of what has gone wrong? Is there any way to get these properties back?

[edit]
I have just tried opening a few different views in the designer. The views all showed "synchronizing" for a few seconds then eventually opened.

Then when I went back to the page configuration, the property editor was no longer empty, but still was not showing what I would normally expect to see.

[further edit]
I went into an event script on one of my components and clicked on the browse properties button. It shows no session properties.

Thanks,
Leigh

I'm not sure why the props didn't recover, but you cannot store bytes in Perspective properties. Perspective properties JSONify everything assigned to them, destroying the original object. (For byte arrays, blowing them up into lists of single-byte QualifiedValue objects.)

Consider using my sessionVarMap() to hold your bytes as bytes.

1 Like

@pturmel Thanks for your reply. I have an older copy of the project that I can use if need be, it would just mean losing a little bit of work.

It would be nice to avoid that if possible.

I have a project in which a user fills out a form. They can chose to include a document if they wish. The file upload component stores the bytes in a custom session property for later use. Once the form is complete, the user presses a button and the script uses the jarray library to convert the custom session property data back into a byte array, and a prepUpdate query sends the form data and any files to the database.

I don't know if this is the correct or most efficient way to do it, but it does work. So, I just wanted to reuse the functionality in a different project. Not sure why it has caused such an issue this time around.

A JSONified byte array is many times larger than a native byte array. It will work for small objects. Also, unless marked "private", Perspective properties are held in both gateway and browser, and transferring large objects to the browser can break the websocket.

Really, don't store java byte arrays in Perspective properties. If you cannot use my alternate solution, use temporary files in the gateway.

( You might also consider my pageVarMap() instead of sessionVarMap(), as it would allow your users to open multiple, non-interfering, tabs to the same forms/workflow. )

2 Likes

Thank Phil, I will speak with some colleagues. We already use your blob server module, so I don't imagine it will be an issue to add the integration toolkit as well.

The 'root cause' here is probably a failure to synchronize the enormously long stringified representation of your binary file object between the 'frontend' session running inside an embedded browser window and the 'backend' session that is your actual Ignition Designer (and/or the actual 'backend' that is the session running on the Ignition gateway).

Definitely don't attempt to store arbitrary objects, especially large ones, directly in Perspective props. I would be cautious about storing a dataset type property with more than a few tens of thousands of rows, and not store an array property with any thousands of rows.

2 Likes

I updated the script on the file upload and made it so that the custom session properties were overwritten with None values.

I reopened the project in the designer and the session properties were back.

I will look at other ways of achieving what I am trying to do, possibly with Phil's module.

Thank you both for the help.

2 Likes