NetTalk Central

Author Topic: Auto Refresh A Browse  (Read 4002 times)

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Auto Refresh A Browse
« on: September 03, 2008, 06:25:07 AM »
4.31 PR11

On a NetWebBrowse, under the Advanced tab, I have set the timer to 30 sec and the refresh to current.  On my webserver the log shows that every 30 seconds a request is made for the browse.  However, the browse does not update until click on the link again.

Anyone have a thought as to what I am missing?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Auto Refresh A Browse
« Reply #1 on: September 04, 2008, 07:00:35 AM »
Hi David,

I suppose the question is - what are you expecting to see?
"Current" shows the current position (as distinct from first, or last) so unless one of the records you are looking at changes, there won't be anything to see.

The other issue is if any of your browse columns have "allow xhtml" ticked on. Or you have allowed xhtml in the header, or on the xhtml tab. It what you've got is not _strict_ xHtml then the browse will not display. The most common mistakes are;

a) a tag not closed properly. like <p> (should be <p /> or <br> (should be </br>).
b) an "illegal" char, like & in the text.

Cheers
Bruce

oeb

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • Email
Re: Auto Refresh A Browse
« Reply #2 on: September 16, 2008, 03:18:52 AM »
I'm having the same problem. I've managed to get a NetWebSource to refresh using AJAX, but not NetWebBrowse. Also, I'm only using the browse to view information so I'd like the whole table to refresh, not just one row.

--------------------
Ole

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Auto Refresh A Browse
« Reply #3 on: September 16, 2008, 03:35:08 AM »
Hi Ole,

Can you duplicate the effect in an example?
I don't really understand exactly what you are doing, or what you are expecting.

The timer does refresh the whole browse, not just one row.

Cheers
Bruce

oeb

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • Email
Re: Auto Refresh A Browse
« Reply #4 on: September 16, 2008, 04:12:09 AM »
I have a memory table that I want to represent as a table on the website. NetWebBrowse seemed like the closest match, it could also be practical in order to add possible interactive functions later - as opposed to hand-coding a table.
This works fine, but I'd like to refresh it without having to re-load the whole page. I've set the timer to 1 second for testing purposes. What does the Disabled/First/Current/Last settings really mean? The documentation on this is very limited.
Are there any other parameters required for the refresh to work, i.e. session variables or a unique key?
I'll try to put together an example.

How come there is no refresh timer for NetWebForm btw.?
--------------------
Ole

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Auto Refresh A Browse
« Reply #5 on: September 16, 2008, 06:05:44 AM »
Hi Ole,

The memory table sounds like the right approach.
Is your browse File-Loaded or Page-Loaded?

The Disabled/First/Current/Last setting applies to Page loaded browses mostly. A refresh needs to know which "page" of the browse to fetch. If you're looking for new records, then either first or last is usually appropriate. However this will inhibit the person paging down because it'll continually be jumping to the top, or bottom. If you're looking for "refreshing the page the user is looking at" then choose current.

I'm not sure what a timer on a form should refresh... Clearly not the entry fields that the user has already entered...

If you want to update a "display" part of the form, then the best approach is to embed a NetWebSource on the form.

Cheers
Bruce



oeb

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • Email
Re: Auto Refresh A Browse
« Reply #6 on: September 16, 2008, 11:26:54 PM »
The browse is file-loaded as the user should see all information at the same time (the maximum amount of rows would maybe be 10). So setting the refresh to "current" seems the way to go. This is also what I've been testing mostly. I will try it out some more.

This web interface mainly shows status information, thus there is not much user input (only a few buttons). I've used a form to build the layout of the main section of the page. I guess embedding a NetWebSource is the way to go.

Update: It turns out the refresh didn't work because the browse was placed inside a form. When I placed the browse on a NetWebPage instead it worked fine.
« Last Edit: September 17, 2008, 02:53:01 AM by oeb »
--------------------
Ole

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Re: Auto Refresh A Browse
« Reply #7 on: September 17, 2008, 07:27:18 AM »
oeb, thanks for posting your update.  I also had my browse in a form.  Once I moved it out of the form, the refresh started working.

Bruce, is it possible to get the browse refresh to work on browses that are in a form?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Auto Refresh A Browse
« Reply #8 on: September 17, 2008, 10:39:56 PM »
Thanks for the analysis guys - I'll see what I can do to fix this.

Cheers
Bruce