NetTalk Central

Author Topic: Action for custom button in a browse  (Read 3801 times)

Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Action for custom button in a browse
« on: October 01, 2016, 12:59:43 PM »
Hi All,

Long time I was on this forum, but I have a new webserver project to work on so I guess this is the place to ask.

I have a simple NetWebBrowse procedure in which I need a need the set a SessionValue with the RecordID of the selected record. I thought I could do that with a custom button in the row, but I cannot get that working. Any suggestions how I can do that?

And if it is possible I would also like to “close” that form, or better said return to the home page once the selection is made.

Thanks in advance for helping me.

Cheers,
Koen

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Action for custom button in a browse
« Reply #1 on: October 04, 2016, 11:36:09 PM »
when you select a row in a browse the ID field for the browse is automatically moved into the SessionValue. So your button would be superfluous.
So what are you really trying to do? Does the button do something _other_ than set the session value?

cheers
Bruce



Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: Action for custom button in a browse
« Reply #2 on: October 05, 2016, 12:18:47 AM »
Hi Bruce,

The database contains data for several clients. Each client sees only its data because every browse will have a filter on ClientID. That ClientID is a SessionValue that is set during the login. This particular browse will only visible for the administrators. It must make it possible for them to choose a client and set the ClientID which will be used as a filter in all other browses.

I didn’t realize that selecting a record sets a SessionValue. However the SessionValue I want to set must be remembered when the administrator leaves the browse so I think setting a separate SessionValue is needed. Thereby a button will it make more clear to the user that they really are setting the filter to that client.

Ideally the button I working on does two things. It sets a SessionValue and it kind of closes the browse a.k.a. goes back to the homepage. Now I vaguely remember that a browse procedure van be placed in a form procedure, is that the solution? I have to reread the manual for that.

Cheers,
Koen

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Action for custom button in a browse
« Reply #3 on: October 11, 2016, 11:59:34 PM »
Hi Koen,

>> The database contains data for several clients.

as an aside, it's generally considered to be a better practice to separate the client's data into separate databases. (or in the case of TPS separate TPS files.) NetTalk supports this allowing you to set the full path name for the TPS file, or glo:owner in the case of SQL, in the WebHandler (ProcessLink method, before parent call.)

>> However the SessionValue I want to set must be remembered when the administrator leaves the browse so I think setting a separate SessionValue is needed

Don't think of this as a "button" (although that's what the user may click on) think of it as "row selected". As such check out the "rowclicked" event in the TakeEvent routine of the browse. (which leads to the CallClicked routine.)

the browse itself can have an in-row button which takes the user to another URL, but that actually happens on a separate thread to the row being clicked.

cheers
Bruce




Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: Action for custom button in a browse
« Reply #4 on: December 07, 2016, 06:03:50 AM »

Hi Bruce,

Well it took a few weeks before I could get back on this. But now my webserver project has the priority again. Thank you the answer, it clarifies a bit more how to treat this. I got it working. Actually I used the server side code embed point so that the code is only executed when the button is clicked and not anywhere else in the row.

A bit late, but thanks for the response. :)