NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rob Kolanko on August 13, 2013, 12:27:27 PM
-
Hi,
I have a NetWebBrowse inside a NetWebForm. The user can delete records via delete button on the browse rows. When all the records are deleted from the browse table, I wish to refresh (or regenerate) the NetWebForm screen containing the browse. Is there a way to do this?
Thanks,
Rob
-
"refresh" in what sense? Are you going to affect specific controls on the form - hide / unhide etc?
It is possible - if not "only on last delete" then certainly on "all deletes". But exactly what's going to look different after the refresh will dictate the approach somewhat.
cheers
Bruce
-
HI Bruce,
Yes, hide controls and display text will change. I have a session variable with the number of records that the condition can be tested on any delete, but of course would prefer "refreshing" the form on "only last delete". If I could get a "only last delete" event, then it would be simpler to regenerate the whole page.
Rob
-
Hi Rob,
>> If I could get a "only last delete" event
yeah, that's probably a little too specific. It implies a chain of events, leading to a result, triggering another event. That could get very tricky to manage.
But there is a "childUpdated" event sent to the form after the row is deleted from the browse. So if you have a sessionValue to test, then you could embed code in the form, something like this;
Validate::BrowseLineItems Routine
if p_web.Event = 'childupdated' and p_web.GSV('AreThereRecords') = 0
do Refresh::somefield
do Refresh::someotherfield
end
In the above the AreThereRecords is the session value you alluded to earlier.
Does this help?
cheers
Bruce
-
p_web.event ?
What is this witchery? that thou has created!!
I checked "Send Stage to DebugView" and look, not only is the stage displayed, but this new browse event value also displayed. Also the stage description (thanks). I hope that you will cover the browse events during the CIDC training.
Thanks, your suggestion will work great!
Rob
-
Hi Rob,
>> What is this witchery? that thou has created!!
remember all that refactoring that went on in June? I told you it would pay off :)
One of the goals has been to make embedding easier, which in turn means trying to create familiar patterns and also show how to understand those patterns.
Rather than seeing a Browse or Form etc as a "Procedure" it's helpful to think of it as an "Event Processor" - or in ABC terms, as a "Take Event".
There's still some refinement to go to make the code a bit easier to read, but I think the Event metaphor will be easier to understand.
And yes, this is definitely on the agenda for the NetTalk Training.
Cheers
Bruce