Re: Tynamo on T5:conversation.moderator component doesn't work with IE7.

2010-08-19 Thread cleverpig
Hi,all!

I worked out this issue!
这是由于IE的cache造成的,因为每次ajax
request的url和参数均相同,因此IE会将cache中response作为回应,而不是去访问service。
因此修改conversation组件的ConversationModerator.js文件,在每次ajax
request的url中加上date参数(当前时间),来防止缓存。
Tynamo's conversation moderator component will send ajax request in
some interval to conversationManager Service,so the conversation id
can be keeping.

since IE has a complete  big cache mechanism,after moderator
component sent first request to service.
then this component will resent with the same url and parameters,this
time IE will treat cached response as response to it,instead of
sending real request.so after a little time past,our conversation will
out of time.

solution:
modify ConversationModerator.js,with add a date parameter to make url
differently every time:
...
var date = new Date();
new Ajax.Request(this.baseURI + checkidle +
this.defaultURIparameters + this.keepAlive + 'warn=' +
this.warnBeforeSeconds+'date='+date.getTime(), {
method: 'get',
evalJSON:true,
onSuccess: this.handleIdleCheckResult.bind(this)
});

On Fri, Aug 13, 2010 at 6:37 PM, cleverpig greatclever...@gmail.com wrote:
 hi, all!

 I found conversation.moderator seem like doesn't work with IE7.I'd
 tested conversation moderator component,it work well at chrome.
 my tapestry version:5.2.0-20100208,when I use this component in page
 with IE browser,it never send ajax request to server after page
 loaded.
 but with chrome,everything is fine.

 my code is seem like tynamo offical guide
 example:http://tynamo.codehaus.org/tapestry-conversations+guide

 Page class:
 Public class MyPage{

        ...
       �...@inject
        private ConversationManager conversationManager;
        private String conversationId;

        private Object createConversation(){
                
 conversationId=conversationManager.createConversation(resources.getPageName(),60*60*2);
                return this;
        }

        Object onActivate(){
                if (paging==null)
                        return createConversation();
                else
                        return null;
        }

        Object onActivate(String conversationId){
                if(!conversationManager.isActiveConversation(conversationId)){
                        return createConversation();
                }

                this.conversationId=conversationId;
                return null;
        }

        String onPassivate(){
                return conversationId;
        }
        ...
 }

 tml:
 ...
 t:conversation.moderator t:keepalive=true/
 ...


 --
 cleverpig(Dan)
 Location: Beijing
 Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
 Zipcode: 100031
 MSN: great_liu...@hotmail.com
 QQ: 149291732
 Skype: cleverpigatmatrix
 Facebook ID:cleverpig
 Blog: cleverpig.name/dan/
 Tags: del.icio.us/cleverpig
 Twitter: twitter.com/cleverpig
 新浪微博: t.sina.com.cn/cleverpig
 Organization: www.beijing-open-party.org
 or...@facebook: http://www.facebook.com/group.php?gid=8159558294




-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liu...@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: cleverpig.name/dan/
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
or...@facebook: http://www.facebook.com/group.php?gid=8159558294

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Tynamo on T5:conversation.moderator component doesn't work with IE7.

2010-08-13 Thread cleverpig
hi, all!

I found conversation.moderator seem like doesn't work with IE7.I'd
tested conversation moderator component,it work well at chrome.
my tapestry version:5.2.0-20100208,when I use this component in page
with IE browser,it never send ajax request to server after page
loaded.
but with chrome,everything is fine.

my code is seem like tynamo offical guide
example:http://tynamo.codehaus.org/tapestry-conversations+guide

Page class:
Public class MyPage{

...
@Inject
private ConversationManager conversationManager;
private String conversationId;

private Object createConversation(){

conversationId=conversationManager.createConversation(resources.getPageName(),60*60*2);
return this;
}

Object onActivate(){
if (paging==null)
return createConversation();
else
return null;
}

Object onActivate(String conversationId){
if(!conversationManager.isActiveConversation(conversationId)){
return createConversation();
}

this.conversationId=conversationId;
return null;
}

String onPassivate(){
return conversationId;
}
...
}

tml:
...
t:conversation.moderator t:keepalive=true/
...


-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liu...@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: cleverpig.name/dan/
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
or...@facebook: http://www.facebook.com/group.php?gid=8159558294

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org