So, I hope I do have the final PingPong-Game implemented. Next step is to migrate additional handling on FRLF/STORE into the procedures.
The game/procedures looks easy, but there's a bit more going on in the background
Here is the simplified PingPong-Game :-)
Original Message:
Sent: 04-12-2024 10:50
From: Ingo Stiller
Subject: Check on FRLF and depending on answer saty or leave form ...
Hi UnifAce
The ping-pong-game works.
But how to activate the STORE-trigger before a postmessage will call the ASYNC?
Challenge:
A user can switch focus from E00->D00->E00 (or any other sequence)
When ever in D00 something was modifed, the user has to be aske if he/she want's to store
As our store-proccode is in the STORE-trigger, we need to activae the trigger
This is my (simplified) code
Component D00/FRLF
a little bit of ping-pong to get both instancce (FRLF and FRGF)
postmessage as in a FRGF no askmess is allowed
postmessage $instancename(),"DO_STORE_UNDER_CONDITION"
Component D00/ ASYNC
CASE "DO_STORE_UNDER_CONDITION"
aksmess ...
macro "^store"
postmessage $instancename(),"CHK_STORE"
CASE "CHK_STORE""
check a few global variables if or if not the store was okay
IF (okay) setfomfocus v_INST_E00
But doing so, the pendig message will befired first and the the macro.
So no changes to 'watch' the store
any idea
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
Original Message:
Sent: 04-12-2024 03:04
From: Ingo Stiller
Subject: Check on FRLF and depending on answer saty or leave form ...
So, here is my solution for the ping-pong-game :-)
E00, D00 are the involved instances. DTF is a framework.
E00, D00, DTF are symbolic component names, at runtime this could be any instance.
(so a postmessage from D00/FRLF to E00/FRGF is not possible)
The components could be in different libraries, that's why I can't use a global vaiable as message-stack.
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
Original Message:
Sent: 04-11-2024 12:08
From: Michael Taylor
Subject: Check on FRLF and depending on answer saty or leave form ...
It may be possible to return 0 out of the loseFocus trigger and use postmessage.
trigger receiveMessage
throws
variables
string vInstance
endvariables
selectcase $uppercase($result)
case "MESSAGE"
selectcase $uppercase($msgid)
case "FOCUS1"
vInstance = $formfocus ; Remember the form that has the focus
setformfocus $instancename ; Set the focus back to this form
postmessage $instancename, "FOCUS2", vInstance ; a postmessage here will allow this form to get focus
case "FOCUS2"
askmess "Swap focus?"
if ( $status )
; Do store here
setformfocus $msgdata
endif
endselectcase
endselectcase
end
trigger loseFocus
throws
if ( !checkValidation() )
postmessage $componentname, "FOCUS1"
endif
return 0
end
Kind regards,
Mike
------------------------------
Michael Taylor
Rocket Internal - All Brands
Original Message:
Sent: 04-11-2024 03:21
From: Ingo Stiller
Subject: Check on FRLF and depending on answer saty or leave form ...
That's what I try to code now: a Ping-Pong-game between the two involved instances :-)
Problem challenge is, for a user this should look like he/she could jump everywhere and the jump-target ( after a possible query) is still the same.
@UnifAce: you do have the information of the jump target (instance,entity, field) already in the memory, why not present it to us by a (few) simple function(s)?
$TargetInstance()
$TargetEntityname()
$TargetFieldname()
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
Original Message:
Sent: 04-10-2024 09:06
From: Neil Payne
Subject: Check on FRLF and depending on answer saty or leave form ...
maybe instead let the focus go to the new component, then detect there you came from the old component and refocus it, now you know both instances?
------------------------------
Neil Payne
MRI Occupier LLC
London GB
Original Message:
Sent: 04-09-2024 10:38
From: Ingo Stiller
Subject: Check on FRLF and depending on answer saty or leave form ...
Hi Freaks
My challenge:
In a non modal world I have to check on FormLoseFocus some conditions and ask the user how to proceed.
I.e stay in the instance or leave it to the clicked one.
Under certain circumstances, data is also stored
As mentioned in the documentation, in a FRLF trigger the allowed statments are limited, especialy a ask-message should not be presented to the user
So my idea is to send a message to the current(old) instance (and return with -1) which calls the ASYNC-trigger. In this I can call check routines and ask the user,
But now I run into a problem:
If the user say leave the current instance and go to the clicked (new) instance, which instance is this?
Question:
Is there any way to get (in FRLF) the instance, which should get the focus next?
BTW:
For the good old version 9.7 I did a comlpex ping-pong coding to get such information and handle checks and stores on FRLF
But with 10,4 the sequnce was changed and I did not find a way to implement our needs ...
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------