NetTalk Central

Author Topic: Browse Selector Position Setting  (Read 5503 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Browse Selector Position Setting
« on: September 25, 2008, 04:59:36 PM »
Hi,

I have a NetWebBrowse that is controlled by parameters set in a memory table with a NetWebForm.  Works fine except for one issue.

After the user has generated the browse and selected a record,  the next time the user generates the browse from the form, the browse selector bar is placed in some unexpected places.

I would like the selector bar to be set to the first record of browse set each time the user generates the browse using the memory table form.  What is the setting that controls selector position on opening a browse page and what should I set it to to generate a fresh browse from the memory form.

Many thanks in advance.

   

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Browse Selector Position Setting
« Reply #1 on: September 25, 2008, 05:02:49 PM »
Forgot to mention these are Page Loaded browses.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Browse Selector Position Setting
« Reply #2 on: September 26, 2008, 01:15:07 AM »
The browse has a unique key.
This unique key has a field.
I'm gonna call this field
cus:id

if you right-click on the browse procedure in the tree, you'll see a line like this;

  Loc:Selected = Choose(p_web.IfExistsValue('Cus:Id'),p_web.GetValue('Cus:Id'),p_web.GetSessionValue('Cus:Id'))

Loc:Selected now holds the record id for the record it thinks should be selected.
So if you cleared loc:selected then "nothing is selected" and then the first row will be selected.

This works fine if this browse is _only_ called from this form. (remember "returning from a form counts as "calling the browse"). So for most people the above technique will not work.

So the alternative is to _clear_ the value, and session value, before the browse is called. ie on the form in the app tree, right-click and choose source.
search for the routine called
Value::BrowseCustomers
at the top of this routine embed the following;
p_web.SSV('cus:id','')
p_web.SetValue('cus:id','')

Cheers
Bruce




ozejohn

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
    • Email
Re: Browse Selector Position Setting
« Reply #3 on: September 27, 2008, 06:53:07 PM »
Hi,

Does your control of a browse from a memory form allow the user th hide and reorder columns at runtime. If so would you mind sharing some outline of how you do this? I am sure a number of developers would like to give their users this feature.

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Browse Selector Position Setting
« Reply #4 on: September 28, 2008, 02:19:52 PM »
Thanks a lot, Bruce.




CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Browse Selector Position Setting
« Reply #5 on: September 28, 2008, 02:26:51 PM »
It doesn't but there shouldn't be much problem doing that.  Define one or more fields in the memory file to hold the user's choices and then use the value of the those field for conditional hiding or choosing the sort order in the browse procedure itself.

Remember you are opening another thread so you will have to open the Memory table and retrieve the record you just created to use the values.  You also have to delete the memory table record after you are done with it.

Hi,

Does your control of a browse from a memory form allow the user th hide and reorder columns at runtime. If so would you mind sharing some outline of how you do this? I am sure a number of developers would like to give their users this feature.