Hi, Andrew,

This is probably most easily done by having the browser refresh the page. HTTP is not a push technology. The browser has to make a request before the app can send it anything.

The easiest way to do this is to add something like the following to the header of your page:

  <meta http-equiv="refresh" content="5">

That would cause the browser to re-request the page every 5 seconds. However, simply doing this will probably get you a "Backtracked too far" error message in a few refreshes. To address this problem, Chuck Hill suggested the following on the mailing list a while back:

============================================
I'd make a component to drop in the HEAD, here is quick sketch:

---
        <webobject name="RefreshTag"/>
    </head>
        ...
---
RefreshTag: WOString {
    value = refreshTag;
    escapeHTML = false;
}
---
    /**
* Returns a refresh meta tag to refresh this page in the number of seconds indicated by the metaRefresh * or null if that is not bound. The refresh references a non- existant action method so that no side effects
     * occur as a result of the page being refreshed.
     *
* @return refresh meta tag to refresh this page or null if refreshing is not desired
     */
    public String refreshTag()
    {
        Object metaRefresh = valueForBinding(Meta_Refresh);

        if (metaRefresh != null)
        {
return "<meta http-equiv=\"refresh\" content=\"" + metaRefresh + ";" + context().componentActionURL() + "\">";
        }

        return null;
    }
============================================

Hope this helps.

Regards,
Jerry

On Sep 16, 2007, at 12:06 PM, Andrew.Yi.Huang wrote:

Hi

How can I implement timing refresh of WebObjects page? For example, refresh a page every 5 seconds! Can I implement a WOComponent as a thread class? And put them together into some Thread Pool? Thank you for any suggestions!

Best Regards!

Andrew
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/jerrywwalker% 40gmail.com

This email sent to [EMAIL PROTECTED]




--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems

    [EMAIL PROTECTED]
    203 278-4085        office



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to