-
1. Re: Why is my jsfunction action only called once?
liuliu Nov 2, 2012 3:54 AM (in response to jackielii)hi
i think it is because you have created a queue.
-
2. Re: Why is my jsfunction action only called once?
jackielii Nov 2, 2012 5:46 AM (in response to liuliu)Hello Hu,
Thanks very much for your reply.
I just tried removing that line but it's still the same. The action was just executed once.
Regards,
Jackie
-
3. Re: Why is my jsfunction action only called once?
liuliu Nov 2, 2012 6:23 AM (in response to jackielii)your version de RF and JSF?
-
4. Re: Why is my jsfunction action only called once?
jackielii Nov 2, 2012 6:45 AM (in response to liuliu)jsf-facelets-1.1.15.B1.jar
richfaces-ui-3.3.1.GA.jar
is this what your are asking?
Thanks
-
5. Re: Why is my jsfunction action only called once?
liuliu Nov 2, 2012 7:16 AM (in response to jackielii)have you removed requestDelay attribute too?
-
6. Re: Why is my jsfunction action only called once?
jackielii Nov 2, 2012 7:36 AM (in response to liuliu)Just did, still doen't work.
Original I tried it without
eventsQueue
ignoreDupResponses
requestDelay
, it didn't work, and then I tried with the parameters on. -
7. Re: Why is my jsfunction action only called once?
jackielii Nov 5, 2012 8:55 AM (in response to jackielii)Found the answer myself:
Firstly, I turned on the log:
{code:xml}<a:log level="ALL" popup="false" width="400" height="200"/>{code}
And found out, if two requests in one request queue are "similar", (didn't find out how is similar), the second request is ignored. so the problem is down to specify a difference request queue, (or similarityGroupingId, which is for grouping the jsFunction, maybe this is how to identify is it's "similar"). The problem is, though, the eventsQueue parameter is evaluated before <a:actionparam>, so I can't set the eventsQueue using #{bean.data}
So my solution is:
create another closure myself, keep the same id and name as the jsFunction:
{code:xml}<a:jsFunction name="saveEdit" id="saveEditFunc" action="#{bean.saveEdit()}"
<a:actionparam name="data" assignTo="#{bean.data}" />
</a:jsFunction>
<script type="text/javascript">
saveEdit=function(data){
A4J.AJAX.Submit('_viewRoot','common',null,{
'oncomplete':function(request,event,data){},
'similarityGroupingId':'saveEditFunc'+data,
'parameters':{'data':data,'saveEditFunc':'saveEditFunc'} ,
'eventsQueue':'queue_saveEdit',
'actionUrl':'/work/task/edit.seam'}
)
};
</script>{code}
Thanks for everyone who commented(although just liumin hu) and viewed this thread.
Jackie