NetTalk Central

Author Topic: force click of browse row  (Read 6988 times)

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
force click of browse row
« on: February 09, 2018, 09:14:45 AM »
     While waiting for Bruce to look at an example app I sent him, I wonder if anyone here has a way to force a row of a browse to be clicked. 
     The scenario is I have a memory form that is a container for a browse and another form.  This other form has buttons to act as a data menu.  On the browse I set code in the UserClicksRowInBrowse embed.  When the user clicks the browse row it fires as it should.  I then click on a button in the data menu and call a seperate browse/form as a pop up.  Upon returning, I want the current row of the original browse to re-fire and run the code in the embed.  Any thoughts?

Thanks,

Jeff King

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: force click of browse row
« Reply #1 on: February 11, 2018, 03:56:04 AM »
Hi Jeff,

This sounds like something i do.

When something happens in your child-memory-form and you need your parent for to be updated. Place this in the embed point where you realise an update is required.

When the page IS a NetWebForm(memory) which in turn contains a NetWebBrowse:

p_web.Script('sv('''',''YOURBROWSENAME_YOURBROWSECONTAINERNAME'','''',''_refresh_=current'','''','''',''_parentproc_=YOURBROWSECONTAINERNAME'');')

YOURBROWSENAME = name of NetWebBrowse
YOUBROWSECONTAINERNAME = name of NetWebForm(Memory) than contains the NetWebBrowse

Otherwise:

p_web.Script('sv('''',''YOURPAGENAME'','''',''_refresh_=current'','''','''','''');')

Hope that helps (use lower case for your names, the CAPS is just to help you spot my placeholders).


Regards
Bill

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: force click of browse row
« Reply #2 on: February 11, 2018, 07:59:32 AM »
Bill,

     Thanks for this, I'll try as soon as I get my server back up.  In the meantime, I'm confused as to which embed to use.  I'm thinking I need to put your code in the GOTFOCUS embed of the browse or maybe the container for the browse.  Maybe it should be in the CLOSE embed of the "child" Browse/Form I call?  What do you recommend?

Thanks,

Jeff

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: force click of browse row
« Reply #3 on: February 11, 2018, 06:26:25 PM »
Bill,

     I have tried numerous embeds.  It seems the browse is refreshed but this does not cause the currently selected row to be clicked again.  Any thoughts?

Jeff

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: force click of browse row
« Reply #4 on: February 11, 2018, 10:23:52 PM »
Hi Jeff,

Add it to the PostUpdate (and or  PostInsert/PostDelete) of the CHILD procedure (popup). This basically means the script will be added to the scripts that get processed when the popup window is saved. You might if possible detect whether an update to the parent is required and only include in that instance.

Obviously, this happens automatically in the normal Browse-Form paradigm, but if you are doing stuff a bit more complicated you may need to request updates.

Regards
Bill

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: force click of browse row
« Reply #5 on: February 12, 2018, 06:58:10 PM »
Bill,

     I have tried the embed as you suggested.  Still, upon returning to the main browse, the selected record is not clicked automatically.  I have attached two images, one showing my procedures and the other showing the code as I entered it.  The container procedure is Enrollment, the browse procedure is BrowsePatientEnrollment.  The called browse form is BrowseCRF001.
     Is your code simply doing a refresh or is it supposed to click the row as well?

Thanks,

Jeff

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: force click of browse row
« Reply #6 on: February 12, 2018, 08:20:04 PM »
Hi Jeff,

I see the problem.

Your child procedure is a child of Enrollment not BrowsePatientEnrollment.

I place my "DataMenu" style screens as children of the main browse. Therefore when that browse refreshes its children will refresh. As Enrollment is a Form, its not going to cascade updates to any other children.

You could try:

p_web.Script('sv('''',''datamenu'','''',''_refresh_=current'','''','''','''');')

in the same embed point. It can probably be moved to another Embed within BrowsePatientEnrollment so each time that browse refreshes your data menu is refreshed.

You'll need to be careful as to what fields (session variables) contain data that DataMenu reads to do its refresh.

Frankly I'd make it a child of the browse, but that may cause you some screen design issues.

I've added a screen capture which may clarify how I do the "DataMenu" thingy. On the right hand side the bunch of tabs starting with "Worksheet" are my DataMenu thingy. It is a child of the browse and the browse is a child of a memory form which manages filters etc that are passed to the browse. My DataMenu contains heaps of stuff, browses, forms, hand coded stuff, lots of crazy stuff that refreshes correctly.

Regards
Bill


jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: force click of browse row
« Reply #7 on: February 13, 2018, 07:14:51 AM »
Bill,

     Still no luck.  I have tried your code suggestions in the Post Insert of the CRF001 form and also in the GotFocus embed of the main browse.  There does seem to be a refresh going on but the currently selected row is not clicked.
     As for making the Data Menu, a form procedure, a child of the main browse, is this allowed?  I see in the children tab that only browse and source procedures can be children.  Has this changed in the latest versions of NT?  I'm on NT 10.15.

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: force click of browse row
« Reply #8 on: February 13, 2018, 07:55:08 PM »
Hi Jeff,

A NetWebForm (Memory) does work. Worked back in NT7 still works in NT10. However that being said, once you do this you do take on some responsibility to manage things for yourself. Under most circumstances you don't have to do anything. Given this (and if Bruce is reading this) you must be prepared for Bruce to one day "fix" this undocumented feature :)

If values displayed within DataMenu are dependant upon the value of the selected row of BrowsePatientEnrollment, you want it as a child of the browse (as it will do the refreshes for you).

Regards
Bill

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: force click of browse row
« Reply #9 on: February 14, 2018, 07:30:37 PM »
Bill,

     Perhaps Bruce "fixed" this in NT 10.15.  The Data Menu is set as a child to appear to the right, but as you can see in the attached image, something is not quite right (pun intended!).  The data menu is active here but still does not update as expected an requires a manual row click.  Still hoping.

Jeff

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: force click of browse row
« Reply #10 on: February 15, 2018, 03:44:39 AM »
Hi Jeff,

If you can put the site public somewhere I can look at the CSS. You might not want to tweak the CSS, but i find it necessary to get my stuff where i want it.

Regards
Bill