VL Web Material Design

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
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

VL Web Material Design

Post by soa »

I have V14SP2 Page containing a ViewContainer containing currently two views

CourseView & CentreView

When the user selects a course (by touching) on the Courseview I want to switch to the CentreView to list Centres for that course. I know I could add a function in a global scoped RP that the webpage listened to to tell it to switch to the Centreview but I was wondering if there is some new facility in this new world that lets a view communicate back with its viewcontainer in a more direct way.

Cheers
Jim
dannyoorburg
Posts: 177
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: VL Web Material Design

Post by dannyoorburg »

Hi,

No, nothing new. The paradigm is still the same.


I usually just signal events from Views, in your case something like

Code: Select all

Signal Event(CourseSelected) CourseId( ... )
Since the main Web Page has a reference to all the Views, it is the perfect place to handle View-Events and decide on navigation.

It also keeps the View itself loosely coupled, you could potentially drag it into another application and it could be re-used.


But you might want to ask yourself if you're not better of presenting the "Centres for that course"-data in a (possibly full-screen) Dialog. If the user is zooming in on a bit of information that's generally the better choice.

The user can then simply dismiss the dialog and they're back where they left from...

That code can be as simple as...

Code: Select all

Evtroutine Handling(#CourseList.ItemClick)

Define_Com Class(#CourseCentresDialog) Name(#Dialog)

#Dialog.ShowCourse CourseId(...)

Endroutine
Hope this helps :),

Danny
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: VL Web Material Design

Post by soa »

Thanks Danny. There's a lot to learn but its so much easier and it looks fantastic. We are really going to delight our users!
Post Reply