NetTalk Central

Author Topic: Filter 2nd Browse based on 1st Browse selection  (Read 5218 times)

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Filter 2nd Browse based on 1st Browse selection
« on: June 02, 2012, 03:54:42 PM »
This is a NT 5.43 Static page with dynamic content application.

I'm needing to have a screen with two browses on it.  Browse 1 is on the left side of the page and Browse 2 is on the right side.  That all works great.

Now, I need to filter Browse 2 based on which row in Browse 1 is clicked on.  Browse 1 contains a field that will act as the filter for Browse 2.  When I click on a row in Browse 1, I look up a field from that record and do a SSV of that field's data, which I want to then be the basis for the filter of the records in Browse 2.

Alas, I cannot get Browse 2 to filter based on clicking a row on Browse 1.  I have verified that the field value is being saved in the session queue.  It is like I need to "reset" the Browse 2 queue, but I don't know what the proper method is in NT to force the browse to refilter.

I'm using the browse template Filter tab and the filter is:

'p_web.GSV(''CourseTitle'') = GRO:CourseTitle'

Can someone point me in the right direction?
Thanks,
Mike

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #1 on: June 02, 2012, 09:10:57 PM »
Hallo Mike,

Try this: 'GRO:CourseTitle = '&p_web.GSV('CourseTitle')

/Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #2 on: June 02, 2012, 09:22:30 PM »
if CourseTitle is a string then;

'GRO:CourseTitle = ''' & p_web.GSV('CourseTitle') & ''''

also, set it up so the second browse is a "child" of the first (to the right) and then embed just the first browse in your static page. Then the child gets automatically updated when the parent is clicked.

If you can't do that then you need t refresh the child manually;
which _probably_ just consists of calling the chile browse from the Clicked routine in the parent browse. As in,
after the session value is set,

! you may need to delete a parameter (value queue field) here. not sure.
SomeChildBrowse(p_web)

Cheers
Bruce

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #3 on: June 03, 2012, 02:02:19 AM »
Thanks guys,
The filter string is working now - I appreciate it.

Bruce, I could not get the "child" browse method to work, so I tried the "manually" refreshing the Course browse, and that didn't seem to do anything.  So, I just refreshed the page when the Program browse row is clicked and the Course browse filtered properly.

So, it is looking like I wanted and working quite well.  Thanks for getting me off in the right direction.
Mike

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #4 on: June 03, 2012, 09:28:11 PM »
>> I just refreshed the page...

ugg.. that's the last thing you want to do because it means everything on the page is refreshed, which looks bad, and takes longer.

If you whip up an example of your basic layout etc, perhaps we can refine the idea for you so you don't have to resort to a page refresh.

cheers
Bruce

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #5 on: June 04, 2012, 03:37:58 AM »
Bruce,
Yep, I see what you mean - it is a very noticeable repaint.  I'm traveling the next couple of days, so I'll whip up an example for you to look at then.
Thanks,
Mike

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #6 on: June 07, 2012, 10:00:54 AM »
Bruce,
I've put together an example app/dct/datafiles/and web folder with a static page and emailed it to you with some details on the example.

Thanks for your help.
Mike Springer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #7 on: June 07, 2012, 10:12:53 AM »
Thanks Mike - I'm in Brazil this week, but I'll take a look when I'm back in the office next week.

cheers
Bruce

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #8 on: June 14, 2012, 02:25:01 AM »
Just a reminder...

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #9 on: June 16, 2012, 11:33:06 AM »
Bruce,
It looks like the email I sent you just got returned unsent.  Ugh...
So, here is the example (attached).
Mike

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filter 2nd Browse based on 1st Browse selection
« Reply #10 on: June 17, 2012, 10:15:40 PM »
>> This is a NT 5.43 Static page with dynamic content application.
>> Can someone point me in the right direction?

the right direction is not to try to embed dynamic data on static pages, unless you really know what you're doing. That's because it's a lot harder to do. (I know, I know, you think it's easier, but really it's not.)

Plus of course everything about it will become harder and harder over time.

so my first piece of advice (which you, and others, will no doubt ignore) is to reverse direction, and rather either
a) make the dynamic pages look the way you want them to look - you do, after all have complete control or
b) embed static content onto dynamic stuff - not the other way around.

Before you panic - yes "dynamic on static" is supported (although not all features are supported.) But, as I say, unless you're some sort of wizard with HTML, CSS and JavaScript you'll find mixing the two becomes quite difficult, and you'll fall at pretty much every hurdle.

For example, your ListWebCourses browse should simply be a "child" of the ListWebPrograms browse, and your whole problem would never have happened.

Now, assuming you've ignored all of that;
your problem is that you've manually embedded all the javascript, and style files in your static htm page. All you need to include the NetTalk stuff is
<!-- Net:c:Head -->
not lots of
<link href="/styles/jquery-ui-1.8.custom.css" rel="stylesheet" />
<script src="/scripts/modernizr-1.6.min.js" type="text/javascript"></script>
lines.

If you remove all the unnecessary then it seems to work ok.

Cheers
Bruce