Board index JavaServer Faces General 2.2-Final/2.2.1/3.0-SNAPSHOT Regression-core.js line 171

2.2-Final/2.2.1/3.0-SNAPSHOT Regression-core.js line 171

Components, Ajax Framework, Utilities and More.


Posts: 723
Location: United States
I updated to 3.0-SNAPSHOT today from 2.2-SNAPSHOT and noticed that I get a JavaScript error now on line 171 of core.js. This looks related to the issue discussed here:

http://primefaces.prime.com.tr/forum/viewtopic.php?f=3&t=7658

I'll start to debug and update you with what I find.


Posts: 723
Location: United States
OK, so it appears the problem is with the spinner display fix discussed here:

http://primefaces.prime.com.tr/forum/viewtopic.php?f=3&t=5051

It no longer works! In particular, I've got the following attribute on my dialog:

onShow="PrimeFaces.ajax.AjaxRequest('/bta/faces#{facesContext.viewRoot.viewId}',{formId:'openForm'},{'javax.faces.partial.render':'openForm'});"


This attribute was required to fix the spinner display issue. With the latest code, this attribute causes a JavaScript error on line 171 of core.js:

cfg.source is undefined

(FireFox)

OR

'source.id' is null of not an object

(IE)


Posts: 723
Location: United States
So it seems that the source parameter is now required. I added it and now everything is fine.

onShow="PrimeFaces.ajax.AjaxRequest('/bta/faces#{facesContext.viewRoot.viewId}',{formId:'openForm',source:'menubarForm:openMenuItem',process:'@none',update:'openForm'});"


Posts: 15115
Location: Cybertron

I believe you were using the client side api directly?
PrimeFaces Lead


Posts: 723
Location: United States
Yup


Posts: 723
Location: United States
I guess something in the low-level API changed again in the latest 3.0-SNAPSHOT because this isn't working again. I'm going to stop using the low-level API and just use the remote command:

...
<p:remoteCommand name="myFormSpinnerBugFix" update="myForm" process="@this"/>
...
<p:dialog onShow="myFormSpinnerBugFix();"...
    <h:form id="myForm">
...


This is cleaner anyways.


Posts: 15115
Location: Cybertron

Yes, low level api is simplified, no longer url and formdId is needed, for example;

PrimeFaces.ajax.AjaxRequest('/showcase/ui/pprUpdate.jsf',{formId:'j_idt43',async:false,global:true,source:'j_idt43:j_idt46',process:'@all',update:'j_idt43:display'})


became

PrimeFaces.ab({source:'j_idt43:j_idt46', process:'@all', update:'j_idt43:display'});


ab is shortcut to reduce page size, url and formId is retrieved at client side.

Still using remoteCommand is suggested to avoid changes like these.
PrimeFaces Lead


Return to General