You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by walnutmon <ju...@gmail.com> on 2008/09/13 02:52:07 UTC

A few more newbie questions

Because a wicket application runs on a server, could you have an internet
application has a listener that responds to messages sent from another
instance of the web app in another browser through a static object that can
send targeted "announcements", or messages?


A little psuedo...


class MyWebApp extends WicketWebApp{
            private static UserInstances;
            getHomePage()
            {
                Page freshHomePageInstance = new
FreshPageClass(UserInstances.getMessageSender());
                UserInstances.add(freshHomePageInstance);
                return freshHomePageInstance;
            }
        }
        
        class FreshPageClass{
            
            onMessage(messageContents)
            {
                //does something with the message, make ajax call
            }
        }
        
        class UserInstances
        {
            private final static messageSender;
            static getMessageSender()
            {
                return messageSender;
            }
            sendMessageToAllUsers(message){...}
            sendMessageToSomeUser(userInstance, message){...}
        }


Hopefully that makes some sense, it's a kind of half baked idea, just
wondering if it's feasible.


-- 
View this message in context: http://www.nabble.com/A-few-more-newbie-questions-tp19466367p19466367.html
Sent from the Wicket - User mailing list archive at Nabble.com.

Re: A few more newbie questions

Posted by walnutmon <ju...@gmail.com>.
Yes, that's exactly what I was looking for.  Thanks!


jwcarman wrote:
> 
> Are you basically wanting each users' browser to be notified of some
> change in state on the server?  Well, there are a couple of ways to go
> about this.  You can either implement server "push" or you can have
> your application "poll" via Ajax.
> 
> On Fri, Sep 12, 2008 at 8:52 PM, walnutmon <ju...@gmail.com>
> wrote:
>>
>> Because a wicket application runs on a server, could you have an internet
>> application has a listener that responds to messages sent from another
>> instance of the web app in another browser through a static object that
>> can
>> send targeted "announcements", or messages?
>>
>>
>> A little psuedo...
>>
>>
>> class MyWebApp extends WicketWebApp{
>>            private static UserInstances;
>>            getHomePage()
>>            {
>>                Page freshHomePageInstance = new
>> FreshPageClass(UserInstances.getMessageSender());
>>                UserInstances.add(freshHomePageInstance);
>>                return freshHomePageInstance;
>>            }
>>        }
>>
>>        class FreshPageClass{
>>
>>            onMessage(messageContents)
>>            {
>>                //does something with the message, make ajax call
>>            }
>>        }
>>
>>        class UserInstances
>>        {
>>            private final static messageSender;
>>            static getMessageSender()
>>            {
>>                return messageSender;
>>            }
>>            sendMessageToAllUsers(message){...}
>>            sendMessageToSomeUser(userInstance, message){...}
>>        }
>>
>>
>> Hopefully that makes some sense, it's a kind of half baked idea, just
>> wondering if it's feasible.
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/A-few-more-newbie-questions-tp19466367p19466367.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/A-few-more-newbie-questions-tp19466367p19471503.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: A few more newbie questions

Posted by James Carman <ja...@carmanconsulting.com>.
Are you basically wanting each users' browser to be notified of some
change in state on the server?  Well, there are a couple of ways to go
about this.  You can either implement server "push" or you can have
your application "poll" via Ajax.

On Fri, Sep 12, 2008 at 8:52 PM, walnutmon <ju...@gmail.com> wrote:
>
> Because a wicket application runs on a server, could you have an internet
> application has a listener that responds to messages sent from another
> instance of the web app in another browser through a static object that can
> send targeted "announcements", or messages?
>
>
> A little psuedo...
>
>
> class MyWebApp extends WicketWebApp{
>            private static UserInstances;
>            getHomePage()
>            {
>                Page freshHomePageInstance = new
> FreshPageClass(UserInstances.getMessageSender());
>                UserInstances.add(freshHomePageInstance);
>                return freshHomePageInstance;
>            }
>        }
>
>        class FreshPageClass{
>
>            onMessage(messageContents)
>            {
>                //does something with the message, make ajax call
>            }
>        }
>
>        class UserInstances
>        {
>            private final static messageSender;
>            static getMessageSender()
>            {
>                return messageSender;
>            }
>            sendMessageToAllUsers(message){...}
>            sendMessageToSomeUser(userInstance, message){...}
>        }
>
>
> Hopefully that makes some sense, it's a kind of half baked idea, just
> wondering if it's feasible.
>
>
> --
> View this message in context: http://www.nabble.com/A-few-more-newbie-questions-tp19466367p19466367.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org