I had a similar problem on one of my projects.

Options are:

1. When in offline mode, just disable all interface buttons that
require online access (after all, in most of the cases user will not
have internet access in offline mode)

2. Let the buttons in place and upon pressing on them, display a modal
window with something "Offline mode detected, trying to fetch offline
data..." and do it with an ajax request in the background

3. Make all the data available offline (this is Gears for ;) )

4. Cache a latest report when going offline. Depending of the data
format can be a html page with the latest data or some kind of xml
snapshot. When in offline mode user press the button, show them the
cache and tell them how old is and to go in online mode if he wants a
more recent one.

On Dec 14, 11:58 pm, Alex Duhamel <[email protected]> wrote:
> Jose - thanks for the reply, I really appreciate it.
>
> Everything is already running great on the localserver and local database
> (Gears is awesome btw!).
>
> The issue is that I have 4 buttons that users can press that display data
> not stored locally.  Ideally what I'd like to accomplish is not allowing
> users to press these buttons if I know that I have no database connection
> (vs having them press the button and having an error message display).
>
> Just trying to make the user interface as friendly as
> possible...thanks...Alex
>
> On Mon, Dec 14, 2009 at 4:40 PM, Jose Gonzalez <[email protected]> wrote:
> > My two cents:
>
> > Make your app work via the local database and have a background thread
> > update the server.
>
> > Why?  No matter how frequent you make your test, Murphy's law tells
> > you that the failure will happen halfway between the two tests....
>
> > On Dec 13, 7:50 am, FlyFisher <[email protected]> wrote:
> > > I’m struggling a bit with how to know if my user has an internet
> > > connection so I can disable certain server dependent processes while
> > > they are offline.
>
> > > My first inclination is to create a function to be called periodically
> > > (once a minute?) that makes a quick query to the database with a very
> > > short timeout and enable/disable user buttons that need to access the
> > > server based on the success of the database call.  My questions about
> > > this solution are
>
> > > (1): is this a decent way to test for online/offline?; and
> > > (2) If I have 500 kiosks that are all sending 1 query/minute to test
> > > for connection, is that going to slow down the real data sync
> > > connections that need to take place?
>
> > > I’ve also seen a javascript solution with a script in an .js file
> > > (isOnline from Gears FAQ) that runs on a timer in the background and
> > > I’ve been able to get this to work in demos.  This solution
> > > essentially uses httprequest to ping a file in the war directory of
> > > the server…but I have 2 issues with that:
>
> > > (1) just because I can ping a file doesn’t mean my database server is
> > > up; and
> > > (2) I’m having trouble figuring out how to access the javascript
> > > success/fail variable in my GWT java code.
>
> > > Any thoughts you have would be great!

Reply via email to