VLF-ONE "Sub" Command
Posted: Wed Nov 07, 2018 2:45 am
I am trying to figure out how to get this to work in VLF-ONE. I have an idea, but want to see if there is a better approach.
I also feel like I have already asked this but for life of me I can't find it. If I have please forgive the incompetence.
I have a business object that will have about 10 command handlers associated with it (only two are shown below). The problem is that some of these commands are really complex and should themselves be broken down into "sub" commands. With the exception of the "Summary" all these "sub" commands have their own load/save logic, each being a different "aspect" of an Associate. Each "sub" command is a View inside a ViewContainer controlled by a Menu.
The problem comes up when trying to invoke command based functionally in a child component. For example, queuing an async operation, or executing that operation.
My idea was to create a "Base" View that all the other views would extend and use that base to hold a reference to the actual command and a reference to the Associate instance from the instance list.
Then my sub commands could use the this command to trigger command functionality. I can't use async queue functionality because that requires the avExecuteAsyncOperation to be redefined, but I can use avGoToBusyState, etc.
I can set those properties from my command as such
Its not ideal but I think it could work. What I would really like is to have a Business Object WITHOUT an Instance List. That way I could model the "Details" command as a Details Business Object.
Any thoughts on how to better handle this?
Thanks,
Joe
I also feel like I have already asked this but for life of me I can't find it. If I have please forgive the incompetence.
I have a business object that will have about 10 command handlers associated with it (only two are shown below). The problem is that some of these commands are really complex and should themselves be broken down into "sub" commands. With the exception of the "Summary" all these "sub" commands have their own load/save logic, each being a different "aspect" of an Associate. Each "sub" command is a View inside a ViewContainer controlled by a Menu.
The problem comes up when trying to invoke command based functionally in a child component. For example, queuing an async operation, or executing that operation.
My idea was to create a "Base" View that all the other views would extend and use that base to hold a reference to the actual command and a reference to the Associate instance from the instance list.
Code: Select all
begin_com role(*EXTENDS #PRIM_VIEW) displayposition(1) tabposition(1)
define_com class(#VF_AC010O) name(#Command) reference(*DYNAMIC)
define_com class(#ASCSRHAssociate) name(#Associate) reference(*DYNAMIC)
define_pty name(Command) get(*REFERENCE #Command) set(*REFERENCE #Command)
define_pty name(Associate) get(*REFERENCE #Associate) set(*REFERENCE #Associate)
end_com
I can set those properties from my command as such
Code: Select all
mthroutine name(uExecute) options(*REDEFINE)
if ((#SwitchCallerReference *IsNot *NULL) *And (#SwitchCallerReference *Is #ASCSRHAssociate))
#Associate <= #SwitchCallerReference *As #ASCSRHAssociate
else
#avFrameworkManager.avIssueMessage autoclear(False) requester(#COM_OWNER) text("Missing Current Associate")
endif
endroutine
evtroutine handling(#ViewContainer.ActiveViewChanged)
#CurrentView <= #ViewContainer.ActiveView *As #MGSCommandView
#CurrentView.Command <= #COM_OWNER
#CurrentView.Associate <= #Associate
endroutine
Any thoughts on how to better handle this?
Thanks,
Joe