Navigating RAMP through different Re-usable Parts

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
jtaljaard
Posts: 36
Joined: Thu Sep 21, 2023 9:29 pm

Navigating RAMP through different Re-usable Parts

Post by jtaljaard » Wed Nov 29, 2023 1:47 am

Hi

We have a Re-usable part called POS_CONN (for connection) which has the following:

Mthroutine Name(uInitialize) Options(*REDEFINE)
* * In the command's uInitialize method routine, set the screen wrapper's uCommand property to #com_owner
Set Com(#POSCONN) uCommand(#com_owner)
Invoke Method(#POSFMAIN.ShowForm)
Endroutine

Mthroutine Name(uExecute) Options(*REDEFINE)
Invoke Method(#Com_Ancestor.uExecute)
Invoke Method(#POSCONN.MakeRampTSAvailable)
Endroutine

Evtroutine Handling(#POSCONN.RampTSAvailable)
Invoke Method(#POSCONN.NavigateToScreen) Name('HN2000')
Endroutine


Evtroutine Handling(#POSCONN.vHandleArrive) ArrivedScreen(#CurrentScreen) PreviousScreen(#PreviousScreen) ArrivedPayload(#Payload)
Define Field(#debNr) Reffld(#DEB)
Define Field(#salesNr) Reffld(#VMAN)
Case (#CurrentScreen)
When Value_Is(= 'HN2000')
Message Msgtxt('At HN2000')

When Value_Is(= 'DB0100LS_OptionCL')
Message Msgtxt('At DB0100LS_OptionCL')
Endcase

Endroutine


How would I go about Navigating to another screen from a different Re-usable part, lets say when Enter is pressed on an edit field on a different Re-usable part?

Ive tried creating a method routine:

Mthroutine Name(HN2000)
#POSCONN.NavigateToScreen Name('DB0100LS_OptionCL')
Endroutine

and then calling that method routine on the other re-usable part:
#POS_CONN.HN2000 or Invoke method(#POS_CONN.HN2000)

But based on the message and the trace, it does not navigate at all. Can someone provide some guidance please and thank you.

User avatar
Dino
Posts: 409
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Navigating RAMP through different Re-usable Parts

Post by Dino » Wed Nov 29, 2023 10:35 pm

Hi
You may need to post here what is that posscon reusable part doing.
Is that using axes robot?
What other methods and events do you have there?

jtaljaard
Posts: 36
Joined: Thu Sep 21, 2023 9:29 pm

Re: Navigating RAMP through different Re-usable Parts

Post by jtaljaard » Thu Nov 30, 2023 5:42 pm

Here is my full code of POS_CONN if that helps..

Function Options(*DIRECT)

Begin_Com Role(*EXTENDS #VF_AC010) Height(270) Width(500)
Define_Com Class(#vf_sy122) Name(#POSCONN) Parent(#COM_OWNER) Visible(False)
Define_Com Class(#POSFMAIN) Name(#POSFMAIN)
Define_Com Class(#POS_RP_SALEDEB) Name(#POS_RP_SALEDEB)
* Define_Com Class(#POS_SKUF) Name(#POS_SKUF)
Define_Com Class(#POS_AUTH) Name(#POS_AUTH)

Mthroutine Name(uInitialize) Options(*REDEFINE)
* * In the command's uInitialize method routine, set the screen wrapper's uCommand property to #com_owner
Set Com(#POSCONN) uCommand(#com_owner)
Invoke Method(#POSFMAIN.ShowForm)
Endroutine

Mthroutine Name(uExecute) Options(*REDEFINE)
Invoke Method(#Com_Ancestor.uExecute)
Invoke Method(#POSCONN.MakeRampTSAvailable)
Endroutine

Evtroutine Handling(#POSCONN.RampTSAvailable)
Invoke Method(#POSCONN.NavigateToScreen) Name('ALG0015')
Endroutine

Evtroutine Handling(#POSCONN.vHandleArrive) ArrivedScreen(#CurrentScreen) PreviousScreen(#PreviousScreen) ArrivedPayload(#Payload)
Define Field(#debNr) Reffld(#DEB)
Define Field(#salesNr) Reffld(#VMAN)
Case (#CurrentScreen)

When Value_Is(= 'ALG0015')
If Cond((#COMPCODE = 0) *And (#BRCHCODE = 0))
Dountil Cond(#POS_AUTH.IsRealized = True)
Invoke Method(#POS_AUTH.ShowForm)
Enduntil

Endif


When Value_Is(= 'HN2000')
Message Msgtxt('At HN2000')

When Value_Is(= 'DB0100LS_OptionCL')
Message Msgtxt('At DB0100LS_OptionCL')
Endcase

Endroutine

Evtroutine Handling(#POSFMAIN.DetailSet)
If Cond(#POSFMAIN.HN2000Det( #VMAN #DEB ) = 'Y')
#POSFMAIN.HN2000Det( #VMAN #DEB )
Endif
* Use Builtin(MESSAGE_BOX_ADD) With_Args('Traveller')
* Use Builtin(MESSAGE_BOX_SHOW)
Endroutine

Mthroutine Name(HN2000)
#POSCONN.NavigateToScreen Name('DB0100LS_OptionCL')
Endroutine
End_Com

User avatar
Dino
Posts: 409
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Navigating RAMP through different Re-usable Parts

Post by Dino » Thu Nov 30, 2023 9:46 pm

Hi
Looks like you are using
What is called
Screen wrappers
In vlf-win

Documentation is here:
https://docs.lansa.com/15/en/lansa050/i ... s%7C_____0

You basically have to
Listen to the events after
Navigate to a destination

Evtroutine Handling(#myscreen_wrapper.vHandleArrive) Arrivedscreen(#CurrentScreen) Previousscreen(#PreviousScreen) Arrivedpayload(#Payload)


Look this example
https://docs.lansa.com/15/en/lansa050/i ... f153693692

Post Reply