Refresh Panels in VP

Contains tips for configurators working with Aware IM
Post Reply
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Refresh Panels in VP

Post by PointsWell »

So this is an alternative to a suggestion that was provided to me in another thread which if I can find I will cross link.

I had a challenge in a VP whereby I wanted a three panel screen:
Left full length panel showing a query of all Contacts
Right Top showing the Master
Right bottom showing various views of child objects.

My challenge was that Contacts Type: Company and Contacts Type: Person have different child relationships and I wanted to keep the Right Bottom context correct all the time.

One option is to use a blank HTML panel as per pureist and BLOMASKY and then attach a refresh process to that.

I realised however that this resulted in the user being presented with a blank lower screen until they made a selection.

My work around was to add a variety of Operations to the bottom tool bar for the Master to open a variety of Queries in the bottom panel. The operations are visible based on Contact Type

For each of the Query views that are shown in the bottom panel I then had an Auto Refresh to ensure that the Query was always in the Context of the currently selected Contact. I set the refresh to be executed by a process and then within that process I checked the Contact type and the relevance of the view to that Contact for example:
If the Contact is not of Type Company and View= Employees then Change view to ContactAddresses given that Employees are attributes of Companies not People.

Whilst this seems like a longer way round than just using the refresh on HTML, it actually becomes easier because:
1 - there is only one refresh process running ever - whereas with the HTML method there are two, one to update the Query context and one to check the View
2 - the HMTL refresh process was becoming more and more unwieldy to manage.
3 - I no longer have to keep track of the last view selected
4 - I can set a default View to open when the page loads initially.

I realise this is probably teaching your granny to suck eggs for those longer in the tooth, but I thought it may help someone new.

Tags for this:
Visual Perspectives
Update Panel
Auto Refresh
Query
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Refresh Panels in VP

Post by customaware »

Can you post a small demo bsv please?
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Refresh Panels in VP

Post by PointsWell »

eagles9999 wrote:Can you post a small demo bsv please?
Will do once I have some time. My model is now quite big so faster to just build a new one.
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Refresh Panels in VP

Post by PointsWell »

Put the BSV into Test

Press the Populate Data Button

Refresh the browser page - the grid won't auto refresh with no records.

Select Big Co - then Show Factories
Then select Barbara - Factories grid changes to Addresses
Attachments
QueryPanelRefresh.bsv.zip
(41.45 KiB) Downloaded 865 times
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Refresh Panels in VP

Post by customaware »

Thanx...

Will have a look. Always interesting to see how others construct VPs
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: Refresh Panels in VP

Post by rbross »

Nice! thanks for sharing
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: Refresh Panels in VP

Post by rbross »

So in your demo, your address view is not linked to a person or company, it is showing all addresses.
What method are you using to show only the addresses for a person or company?
Are you running a process when a Contact is selected and updating a field in RegularUser BO and using it the Where clause of the query for addresses, WHERE Address.Contact=LIRU.SelectedContact or using "This"
WHERE Address.Contact=ThisContact
I Know in some cases "This" does not work and you need to use the selected field that has been updated and stored in the RegularUser BO.
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Refresh Panels in VP

Post by PointsWell »

Hi, the bsv was really just a quick and dirty to demonstrate the switching, so the Address query should have a filter of

Code: Select all

FIND Contact WHERE Contact=LIRU.Contact
There is probably A missing refresh on the Address view as well.

My understanding of This is to use it only when there is some ambiguity as to which Contact record you were referring to (I.e. you had brought a second or more Contact into Context)
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: Refresh Panels in VP

Post by rbross »

I thought so, thanks for clarifying that.
I found that using "This" can be used in most where clauses but in VP's many times you have to use the LIRU attribute that was updated when the Parent record was selected.

Just a side note, calling a process to update the LIRU attribute with the selected record in a query does not work when you have "Allow Inline Edit: turned on.
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: Refresh Panels in VP

Post by rbross »

If you could, what are your thoughts on this post: https://www.awareim.com/forum/viewtopic ... 075#p45075
I started planning the layout just as I saw your post on Refreshing Panels in VP.
Any input would be most appreciated.
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Refresh Panels in VP

Post by Jaymer »

Sean, so are there 2 changes that need to be done to the BSV (address Query & address View), or have you updated it?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Refresh Panels in VP

Post by PointsWell »

Jaymer wrote:Sean, so are there 2 changes that need to be done to the BSV (address Query & address View), or have you updated it?
Don't really have time at the moment to make an update. It was posted to demonstrate a particular principle, ie restricting access to and refreshing panels based on a parent BO's attributes which it does.

Hopefully the concept of a query filtered off the LIRU is an understood one.
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: Refresh Panels in VP

Post by rbross »

PointsWell wrote:Hi, the bsv was really just a quick and dirty to demonstrate the switching, so the Address query should have a filter of

Code: Select all

FIND Contact WHERE Contact=LIRU.Contact
There is probably A missing refresh on the Address view as well.

My understanding of This is to use it only when there is some ambiguity as to which Contact record you were referring to (I.e. you had brought a second or more Contact into Context)
Jaymer, see his comments above, there are some references missing, but an attribute in LIRU is what is used to filter on the address or any other views that are related to the contact or company selected.
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
Post Reply