PDA

View Full Version : Combined 'load' and 'seed' strategy obstacle



Sture
26-Nov-2015, 02:49 PM
Hi there,

Consider the Order.wo of the weborder sample. It displays an order and all the lines of that order.

If you want to bring up the view with a particular order active you can add this procedure to the object


Set pbServerOnShow to True

Procedure OnShow
Send FindByRowId of oOrderHea_DD OrderHea.file_number riSomeRowID
End_Procedure

This works nicely.

If I want to bring up the view with a particular orderline and its adjacent orderheader I add


Set pbServerOnShow to True

Procedure OnShow
Send FindByRowId of oOrderDtl_DD OrderDtl.file_number riSomeRowID
End_Procedure

This also works nicely EXCEPT if the order-view is not already loaded. When this is the case the correct order is found but the intended detail record is not made active.

I have a attached a modified Order.wo and a new view SeedTestView.wo to demonstrate this. If these are copied to WebOrder\AppSrc and oSeedTestView is added to the project the problem can be seen in action. By doing so the test-view will be the defaultly loaded view. Note that the second button only functions when the oOrder view has been activated at least once.

-Sture

Harm Wibier
30-Nov-2015, 08:43 AM
You are right this is indeed a problem and it seems to be caused by the grid / list control jumping through some hoops with the asynchronous server communication. I am working on a fix that should get into the next public build.

FYI: I assume you know that you will have to use web properties to make this work at all outside the debugger ;)

Sture
30-Nov-2015, 05:20 PM
Hi Harm,

Good you recognise it!

Yes, I was aware. Sort of. In my application it's implemented with a web-property, but a small test while sizing my finding for this forum, led me to think it wasn't really necessary.

However, that leads me to suggesting that the debugger constantly display the value of WebAppSession.UseCount (or a similar counter). And that it should say 'ding' everytime it changes value. Or briefly flash red like in Wulfenstein.

-Sture

Sture
1-Dec-2015, 08:37 AM
ps. it's not just this experience that leads me to the suggestion. I have thought about it many times. Knowing when the debugger starts handling a new request is valuable.

Harm Wibier
1-Dec-2015, 10:16 AM
I see what you mean. Somehow visualizing that are debugging a web-service call and showing when something is the next call could definitely be a good teaching tool. Maybe a panel that shows a list of all HTTP requests that came in during this debugging session? Kinda like you see on browser debugging tools...

Sture
1-Dec-2015, 04:05 PM
Even better. But then it starts growing. Because then it could also display the payload content. Another a good teaching tool.

-Sture

Harm Wibier
2-Dec-2015, 03:19 AM
Yeah.. and then it would have to be able to understand JSON and XML ;)

Sture
4-Dec-2015, 12:26 PM
In fact, adding this to the cWebApp object works very well.


Procedure OnDetachProcess
If (IsDebuggerPresent()) Begin
Showln "OnDetachProcess (cWebApp object)"
End
Forward Send OnDetachProcess
End_Procedure

Procedure OnAttachProcess
If (IsDebuggerPresent()) Begin
Showln "OnAttachProcess (cWebApp object)"
End
Forward Send OnAttachProcess
End_Procedure

-Sture