Page 1 of 1

VL Web Material Design

Posted: Thu Jun 14, 2018 12:34 pm
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

Re: VL Web Material Design

Posted: Fri Jun 15, 2018 3:53 pm
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

Re: VL Web Material Design

Posted: Fri Jun 15, 2018 6:39 pm
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!