[Solved] Changing Output in VP panel

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
PointsWell
Posts: 1463
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

[Solved] Changing Output in VP panel

Post by PointsWell »

Hi

Is there a way to use a button to insert a query's output into a panel on a VP?

I have a number of queries that are related to a record on the screen.

What I'd like to do is press a button (run a process) and swap out the current query in a panel with another query.

I have about 5 different queries but only want to show one on screen at a time driven by button choices by the user.

Thanks
Last edited by PointsWell on Thu Feb 09, 2017 3:28 am, edited 1 time in total.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Changing Output in VP panel

Post by tford »

The only way I know to accomplish that is to set up various VPs and have your process display a new VP based on the user's choice.
Tom - V8.8 build 3137 - MySql / PostGres
hpl123
Posts: 2611
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Changing Output in VP panel

Post by hpl123 »

Pointswell,
This isn't possible IF this hasn't been implemented in v7+ which I doubt. One workaround you can use:
http://www.awareim.com/forum/viewtopic.php?f=4&t=7423
Henrik (V8 Developer Ed. - Windows)
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Changing Output in VP panel

Post by tford »

Ah, yes, Henrik .. great link. I forgot all about your tip and sample BSV there.
Tom - V8.8 build 3137 - MySql / PostGres
pureist
Posts: 427
Joined: Sun Jan 24, 2016 10:00 pm

Re: Changing Output in VP panel

Post by pureist »

"What I'd like to do is press a button (run a process) and swap out the current query in a PANEL with another query. "

Set the PANEL to be a html panel whose refresh, is triggered by the process run via the button, and carried out by another process.

Check-out the 'Refresh...' setting at the bottom of the properties for content panels, I think on the second properties tab.

A limitation of this feature is an instance in context cannot be passed as input, however if need be you can save the instance to use as criteria in an attribute of RegularUser of SystemSettings, which the process that carries out the refresh can access.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Changing Output in VP panel

Post by tford »

Building on pureist's post, attached is a simple BSV that demonstrates how this can be done:

1- Add WhichQuery to RegularUser BO.
2- In "Button" Content Panel of the Administrator VP, place two buttons to select between two queries. Each button simply sets LoggedInRegularUser.WhichQuery value via a process.
3- Process run by #2 then does DISPLAY PERSPECTIVE Administrator to refresh the perspective
4- The "Conditional query via process" Content Panel of Administrator VP runs a process that displays a query based upon the value in LoggedInRegularUser.WhichQuery

Note that an initialization process sets the initial value of LoggedInRegularUser.WhichQuery to 'Users 1' when the user first logs into this BSV.
RefreshQuery.zip
(34.57 KiB) Downloaded 789 times
Tom - V8.8 build 3137 - MySql / PostGres
PointsWell
Posts: 1463
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Changing Output in VP panel

Post by PointsWell »

Wow. Went to bed and woke up with a bunch of great responses. :D

Thanks, will look into these today.
aware_support
Posts: 7532
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Changing Output in VP panel

Post by aware_support »

Do you know that among the options for the output there is one called "Same Panel"?

Seems like this is what you need here unless I misunderstood what this is about...
Aware IM Support Team
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Changing Output in VP panel

Post by tford »

Do you know that among the options for the output there is one called "Same Panel"?
Ahhh .. didn't think of that. Simple is better.
RefreshQuery_SamePanel.zip
(34.56 KiB) Downloaded 746 times
Attachments
refresh2.jpg
refresh2.jpg (85.49 KiB) Viewed 24407 times
refresh1.jpg
refresh1.jpg (48.07 KiB) Viewed 24407 times
Last edited by tford on Sun Feb 05, 2017 11:49 pm, edited 1 time in total.
Tom - V8.8 build 3137 - MySql / PostGres
Jaymer
Posts: 2483
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Changing Output in VP panel

Post by Jaymer »

I tried the sample BSV, but I wonder if its going to work for Pointswell.
It really does work as a stand alone test. But if you've got a query and you're parked on a record in the list, and you want to see Query 3 in the "query results" panel, I don't think he's gonna be happy with the entire screen redrawing, cause you're probably going to lose focus on the row you were on... or cause undue load on the server re-running the outer query just to run one of the 5 sub-queries.

personally, there's a delay on my screen as the processes initiate and redraw. for comparison, add a 3rd button "Users 3" that doesn't call the process, but just calls either Query 1 or 2 and you'll see how fast it CAN happen without the extra manipulating.

In fact, I checked my CPU usage.
You can see the overhead needed to accomplish this. This is on a 3.5 gig ram Microsoft Server.
I'm not trying to be argumentative, just not sure its the right solution. Lets see what the OP says.
Attachments
Screen Shot 2017-02-05 at 6.25.11 PM.png
Screen Shot 2017-02-05 at 6.25.11 PM.png (35.59 KiB) Viewed 24407 times
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
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Changing Output in VP panel

Post by tford »

Good point Jaymer. Now that I have my mind around the Same Panel operation (something I haven't used much), I simplified even further.

Interested to see what your metrics say now. BTW, I've edited my post above to eliminate the refresh question as it's now not needed.
Refresh_Simple.zip
(34.48 KiB) Downloaded 721 times
Tom - V8.8 build 3137 - MySql / PostGres
PointsWell
Posts: 1463
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Changing Output in VP panel

Post by PointsWell »

Jaymer wrote:I tried the sample BSV, but I wonder if its going to work for Pointswell.
It really does work as a stand alone test. But if you've got a query and you're parked on a record in the list, and you want to see Query 3 in the "query results" panel, I don't think he's gonna be happy with the entire screen redrawing, cause you're probably going to lose focus on the row you were on... or cause undue load on the server re-running the outer query just to run one of the 5 sub-queries.

personally, there's a delay on my screen as the processes initiate and redraw. for comparison, add a 3rd button "Users 3" that doesn't call the process, but just calls either Query 1 or 2 and you'll see how fast it CAN happen without the extra manipulating.

In fact, I checked my CPU usage.
You can see the overhead needed to accomplish this. This is on a 3.5 gig ram Microsoft Server.
I'm not trying to be argumentative, just not sure its the right solution. Lets see what the OP says.
Hi Jaymer

I've played about with this and you are right it is not the best.

I've also come to the conclusion that my original approach is sub optimal in its concept too.

My challenge is that I have a number of contact records that have a number of child relationships. The class of the parent drives which relationships might be in place. For example a Contact of class Company will have Employees and Subsidiaries while a Person will not.

What I was trying to achieve is a list on the left and the right hand split into Parent on top and child on bottom.

I cannot use a single form as the top has a number of attributes that are dependent on the Class (date of birth for example is a Person attribute). So if I were to just put the tabs on the bottom of the parent form I'd have to redundantly repeat a whole series of different tabs.

So I came up with a second idea. What if I use two processes for the right top and right bottom to populate two different versions of the Contact form.

Then it all went to mush.

If I use a process with DISPLAY then I cannot specify the form. If I use VIEW USING then it overwrites the page with the View. So then I created two extra panels to run the process and then output to a different panel each.

I am still having the issue of it just showing just one version and it is still overwriting the VP.

Seems like the best ideas don't always come in the shower :?
Jaymer
Posts: 2483
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Changing Output in VP panel

Post by Jaymer »

I don't think the "same panel" thing works... isn't the idea that you'd be in panel A viewing customers, and you'd pick a customer and click 1 of 5 buttons, and have Panel B show the output?
So "same panel" where you are clicking isn't where you'd want the output.

anyway, since you asked Tom, On User 1 query, I needed to add a button that just ran Query 2, so next to your button, I have a simple button to do that. Then on User 2's panel buttons, I added a User 1 button. So my buttons so the same thing as yours, but your's is doing the VP thing and I can't see a difference, except your way uses a tiny bit more CPU.
Screen Shot 2017-02-05 at 7.16.59 PM.png
Screen Shot 2017-02-05 at 7.16.59 PM.png (45.27 KiB) Viewed 24404 times
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: 1463
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Changing Output in VP panel

Post by PointsWell »

PointsWell wrote:
Then it all went to mush.

If I use a process with DISPLAY then I cannot specify the form. If I use VIEW USING then it overwrites the page with the View. So then I created two extra panels to run the process and then output to a different panel each.

I am still having the issue of it just showing just one version and it is still overwriting the VP.

Seems like the best ideas don't always come in the shower :?
DOH!

Forgot to switch off the output from the original settings.

Works perfectly now (screen sizing issues aside)
Jaymer
Posts: 2483
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Changing Output in VP panel

Post by Jaymer »

I need to go rewatch the VP video tutorial cause I'm kinda lost in that whole concept.
I'm not sure if in normal operation of an application, you're supposed to change VPs dynamically, or just set the desired one at login time?

For me personally, I think many Aware screens staRt looking 'all the same' and I'd rather have some blatant visual clues to let me know I'm in the A/P section, Employee section, Customer, orders, etc.
So some background coloring or colored headings help u easily (or more 'at a glance') know where you are.
But thats just me.

So I haven't figured out if Visual Perspective is how I make this happen?
(or do I change the template during runtime? or some basement-level CSS coloring codes?)
We're kinda limited on how many examples of nice, finished Aware apps we can view. So you don't know what you don't know.
One new developer may do an entire system looking the same and never change VP while another realized there's some power in changing it... or not? I dunno.
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
Post Reply