I have a web application used richfaces4.1.0.Final. the issue is when have two requests like below will cause js error:"element is null" and browser crash.

1. first request sending, and don't have response arrived.

2. the second request start, will add this request into queue.

3. first response arrived , the second request will be dequeue and send request, it will find source element first, and our page had changed, the element is null, but the code like this:

if(typeof source==="string"){element=document.getElementById(source)}else{if(typeof source==="object"){element=source}else{throw new Error("jsf.request: source must be object or string")}}if(!element.name){element.name=element.id}

Since, it look like a bug. the element need do non-null judgment. Can you give me a solution for resolve this?

By now, there is no deocument discusses the queue mechanism of richfaces, it maybe a weak design in asynchronize. Perhaps, we can use the global queue component to debug this issue and find the point occurs the crach during the request period.

Addition to the code, I think the below code should be improved to check the element. If necessary, please indicate where the code from.

if(typeof source==="string"){

element=document.getElementById(source)

}else{

if(typeof source==="object"){

element=source

}else{

throw new Error("jsf.request: source must be object or string")

}

}

if(!element.name){

element.name=element.id

}

Others ,do you know this kind of queue issue and if it's really a bug, does richfaces4.2.x have fixed this issue?