VFP9SP2. Scenario: pageframe with several pages. Goal: force user to stay on page if invalid data entry on that page.
I'm trying to think of the best, non-kludgey way to prevent the user navigating to a different tab if an invalid condition exists. I was dabbling with the Page.Activate but I'm starting to get kludgey with flags and trickery. There is no Page.Valid event.
Suggestions?
In the VALID Event of that offending control: RETURN 0
Which means: don't move the focus from that control.
If several controls together can do harm to the page control, just disable all other pages. That's the equivalent of a modal page :)
FOR EACH oPage IN Pageframe.pages oPage.Enabled = oPage.name = thisPage.name ENDFOR && set appropriate objectNames for your code
wOOdy
-----Ursprüngliche Nachricht----- Von: ProFox profox-bounces@leafe.com Im Auftrag von MB Software Solutions, LLC Gesendet: Donnerstag, 2. Januar 2020 15:50 An: ProFox Email List profox@leafe.com Betreff: Easiest way to keep person from navigating off a page
VFP9SP2. Scenario: pageframe with several pages. Goal: force user to stay on page if invalid data entry on that page.
I'm trying to think of the best, non-kludgey way to prevent the user navigating to a different tab if an invalid condition exists. I was dabbling with the Page.Activate but I'm starting to get kludgey with flags and trickery. There is no Page.Valid event.
Suggestions?
[excessive quoting removed by server]
You may use the Page's DEACTIVATE event to prevent switching to other tabs, by issuing a NODEFAULT when data is invalid.
On Thu, Jan 2, 2020 at 2:50 PM MB Software Solutions, LLC < mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
VFP9SP2. Scenario: pageframe with several pages. Goal: force user to stay on page if invalid data entry on that page.
I'm trying to think of the best, non-kludgey way to prevent the user navigating to a different tab if an invalid condition exists. I was dabbling with the Page.Activate but I'm starting to get kludgey with flags and trickery. There is no Page.Valid event.
Suggestions?
[excessive quoting removed by server]
That seems to be exactly what I needed. Thanks!
On 1/2/2020 10:22 AM, António Tavares Lopes wrote:
You may use the Page's DEACTIVATE event to prevent switching to other tabs, by issuing a NODEFAULT when data is invalid.
On Thu, Jan 2, 2020 at 2:50 PM MB Software Solutions, LLC < mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
VFP9SP2. Scenario: pageframe with several pages. Goal: force user to stay on page if invalid data entry on that page.
I'm trying to think of the best, non-kludgey way to prevent the user navigating to a different tab if an invalid condition exists. I was dabbling with the Page.Activate but I'm starting to get kludgey with flags and trickery. There is no Page.Valid event.
Suggestions?
[excessive quoting removed by server]