Save and Restore Instance Lists - VLF One

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
dhunt
Posts: 35
Joined: Fri Feb 08, 2019 3:06 am

Save and Restore Instance Lists - VLF One

Post by dhunt » Wed Oct 30, 2019 9:31 am

How can i save and restore instance list columns in VLF One when someone exits a browser? If i change the order of the columns, i need it to be that way when it loads again. I don't need it to save the instance list data per se but i need the columns the same. I thought there would be code sample in the documentation for VLF-WIN but i don't see it.

MarkDale
Posts: 106
Joined: Wed Dec 02, 2015 10:06 am

Re: Save and Restore Instance Lists - VLF One

Post by MarkDale » Wed Oct 30, 2019 10:43 am

As far as I know, VLF-ONE already does remember instance list column positions.

If for example, in a VLF-ONE shipped framework, using Chrome, I go to Examples -> foundation --> business object 102 and drag the salary column over to the left of the instance list, I can load the column with data ok.

If I then close the framework, close the browser, and start the browser again, and logon and go to business object 102, it has remembered that the salary column is on the left of the instance list.

Is that what you see?

Business object 102 uses the standard instance list for VLF-ONE - vf_um040O. It may be that your business object is using a different instance list.

dhunt
Posts: 35
Joined: Fri Feb 08, 2019 3:06 am

Re: Save and Restore Instance Lists - VLF One

Post by dhunt » Thu Oct 31, 2019 2:57 am

We have a custom grid list with #VF_AC012O. is that why its not working?

This is how the columns are at first:
Untitled.png
Untitled.png (15.64 KiB) Viewed 95 times
Now i want to move this column
Annotation 2019-10-30 103755.png
Annotation 2019-10-30 103755.png (31.21 KiB) Viewed 95 times
its moved but wont stay like this next time i come to this page, I want this to stay in this order now for this user.
Annotation 2019-10-30 103937.png
Annotation 2019-10-30 103937.png (21.75 KiB) Viewed 95 times

MarkDale
Posts: 106
Joined: Wed Dec 02, 2015 10:06 am

Re: Save and Restore Instance Lists - VLF One

Post by MarkDale » Fri Nov 01, 2019 3:52 pm

If you are using your own snap in instance list you would have to code it.

In it you have (or can redefine) a uTerminate and a uInitialize.

Mthroutine Name(uInitialize) Options(*REDEFINE)
Mthroutine Name(uTerminate) Options(*REDEFINE)

In the uTerminate you can save the grid column positions to the virtual clipboard, using something like:

For Each(#Column) In(#Grid.Columns)
#Count += 1

#AVFRAMEWORKMANAGER.avSaveValue Withid1(MYINST) Withid2(MYBUSOBJ) Withid3(#Count.AsString) Withid4(POSITION) FromNvalue(#Column.DisplayPosition)

endfor

And in the initialize, you can read the saved display positions from the virtual clipboard and apply them to the Grid columns.

MarkD
Posts: 630
Joined: Wed Dec 02, 2015 9:56 am

Re: Save and Restore Instance Lists - VLF One (RESOLVED)

Post by MarkD » Tue Nov 05, 2019 10:55 am


Post Reply