Page 1 of 1

Refresh/Reload Visualization

Posted: Tue May 17, 2016 12:21 am
by moymike
Okay, still playing with visualizations here.

I have a visualization that populates a dropdown via a file on a maintenance web page. Within the web page, there is an event that can cause an update to the file that drives the visualization. I have not found a way to get the visualization to reload programatically. I can hit F5 to manually reload the web page, which reloads the dropdown. I'd like trigger a reload of the dropdown's visualization within the event that updates the file.

Re: Refresh/Reload Visualization

Posted: Tue May 17, 2016 1:13 am
by Stewart Marshall
Field Visualizations are really little more than simple replacements for the default edit box shown for a field. They were never intended to be anything more than that. This is why they're limited to getting and setting a single property.

The sort of functionality that you're talking about requires a reusable part that can be directly addressed by the application code and that can respond to application events. This is a job for a completely separate and discrete reusable part.

Regards

Re: Refresh/Reload Visualization

Posted: Tue May 17, 2016 4:16 am
by moymike
I get that. I was hoping there was a method to ask it to redraw itself, which I figure was possible, as it is pretty generic. If not, asking the parent to redraw the entire web page would be the next best bet. (which I am not sure how to do either)

Re: Refresh/Reload Visualization

Posted: Tue May 17, 2016 9:18 am
by dannyoorburg
Hi,

just out of curiousity, which one of the different types of field visualization are you using in this scenario ?

Danny

Re: Refresh/Reload Visualization

Posted: Wed May 18, 2016 6:15 am
by moymike
A VisualHost -> Reusable Part. The reusable part is a DropDown containing DepartmentID / DepartmentName. We are doing all our development on Web Forms, using the latest version 14.

The Visualization works great in several pages, but not on the one I am maintaining departments in. If I do an add, change or delete, the Visualization DropDown of department does not reflect the changes until I hit <F5> to reload the form.

I am new to Lansa, so it may be that the other choice for Visualization "New Visual Part" is more appropriate. I can't find any documentation or examples that help me out.

Re: Refresh/Reload Visualization

Posted: Wed May 18, 2016 5:28 pm
by dannyoorburg
Hi,

All visualizations are basically a combination of a label and a control.

If you define a *Visual_Host, you define your own panel to take the place of the control, the label is still created for you.

If you define a *Visual_Part, you define your own panel for the whole visualization, LANSA no longer creates a label for you.

The Visual_Host visualization creates an instance of the Reusable Part, which is inaccessible from your RDMLX code, as you found.

The Visual_Part visualization is different, the Reusable Part becomes the ancestor of your field class, so its methods, properties and events ARE accessible on the field instances.


I agree with Stewart that it is usually clearer if you just use a Reusable Part directly, drag and drop it onto wherever you need an instance of it. Unless you have a specific requirement to tie it to a field that I don't know about...

Hope this helps, good luck.

Danny