Direct process output to <div>

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
nhofkes
Posts: 94
Joined: Mon Sep 07, 2020 6:03 am
Location: Netherlands

Direct process output to <div>

Post by nhofkes »

I have a form for a BO (let's call it ParentBO) with a panel operation. This starts a simple process:

Code: Select all

ENTER NEW ChildBO WITH ChildBO.Parent = ParentBO USING 'Create'
The result is that the form for the ChildBO opens in a popup window. Ideally I would like to display that form in a div on the form of the Parent BO (as was explained here. But that does not work. In fact, it does make any difference whatever setting I choose for the Output of the panel operation: whether it's New Tab, Modeless Window, Same Panel - this is all ignored, I still get the popup window each time regardless of this setting.

Is it not possible to redirect the output of a process, or am I doing something wrong?
Niels
(V9.0 build 3241 - MariaDB - Windows)
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Direct process output to <div>

Post by Jaymer »

this is a "simple process" with only the 1 rule that you show?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
nhofkes
Posts: 94
Joined: Mon Sep 07, 2020 6:03 am
Location: Netherlands

Re: Direct process output to <div>

Post by nhofkes »

Yes, just this one rule.

Meanwhile, I found this on page 217 of the user guide which might explain why it doesn't work:
In most cases intermediate actions are displayed in a popup window. The final action is displayed according to the designated output of the process, specified either in a form/query operation or a menu command (depending on where the process is used).
As my process requires user input, I assume it is regarded as an 'intermediate action' which means that the default output of the popup window is used and the designated output setting has no effect because it only relates to the final output.

Now I wonder whether I could use as a workaround one of the 'startProcess' javascript functions (as described on page 462-463), with the <div> as the renderOption? I tried that but without any success so far.
Niels
(V9.0 build 3241 - MariaDB - Windows)
customaware
Posts: 2392
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Direct process output to <div>

Post by customaware »

Have you tried in the Process a CREATE immediately followed by an EDIT?
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
nhofkes
Posts: 94
Joined: Mon Sep 07, 2020 6:03 am
Location: Netherlands

Re: Direct process output to <div>

Post by nhofkes »

eagles9999 wrote: Wed Nov 25, 2020 2:43 am Have you tried in the Process a CREATE immediately followed by an EDIT?
Yes, I tried that but it makes no difference, I still get the popup window.
Niels
(V9.0 build 3241 - MariaDB - Windows)
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Direct process output to <div>

Post by PointsWell »

From memory ENTER NEW is always a pop up. There is a modifier AND VIEW or AND VIEW IN TAB (can’t remember off hand) that will force it to be a page element (though how you’d get that to view in div I don’t have an answer)
nhofkes
Posts: 94
Joined: Mon Sep 07, 2020 6:03 am
Location: Netherlands

Re: Direct process output to <div>

Post by nhofkes »

I tried to add the modifier AND VIEW and this indeed results in the child BO entry form showing in the div on the parent form ( :) ). However, that's only for a split second, as control is then handed back to the Parent BO form which redisplays and the div is empty again ( :( ).

Perhaps what I am trying to do is just too difficult, it means nesting two forms (the child form within the Parent form). Although similar 'nesting' is possible elsewhere, for example it's possible to edit a child BO directly within a query by expanding the row.
Niels
(V9.0 build 3241 - MariaDB - Windows)
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Direct process output to <div>

Post by PointsWell »

I haven't played with display in div yet, but there are other alternatives to what you are trying to do. I will leave it to you to decide on how elegant that is.

I am assuming you have a relationship of Parent may have one or more Child. (Parent.omChildren)

You could create a peer single Child relationship (Parent.psChild). Peer singles can be displayed as a grid, combo value or form (and others)
You then create a specific form on the Child BO and on the parent have the Parent.psChild display as that form from the Child BO.
Create a specific form for Parent for the creation of Child records using that psChild displayed as form

Then
Create Child with Child.obParent
Parent.psChild=Child
Display the Parent Form with the psChild sub form.
Edit and save with a process after the save to set Parent.psChild =UNDEFINED and display the original Parent form

The psChild attribute would just be for the temporary creation of the child element. It may (you will need to test) automatically create the psChild record for you when you open the Parent form showing psChild form, I can't remember. One caveat is that the subform is not a great solution if you have cascading drop downs there is an unresolved issue where the form refreshes and the initial field is blanked when you select the second drop down and it will not handle multiple nested sub forms ie the form for Child cannot have its own child records displayed as a form.

EDIT - in a multi user environment this will cause contention errors. E.g
User 1 edits parent with child 1, this inserts Child 1 into Parent.psChild
User 2 edits parent with child 2, this inserts Child 2 into Parent.psChild

User 1 saves
User 2 attempts save and gets an error that another user has updated the Parent.
Post Reply