Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Hia, my mail was not answered so it probably went to /dev/null because it was with the same content but not as exact as the one from Ganesh regarding the id issue :-) Werner Matthias Wessendorf schrieb: Sent from my iPod. Am 21.04.2009 um 06:05 schrieb Ganesh gan...@j4fry.org: Hi Matthias and Werner, The partial submit issue I posted to jsr-314-comme...@jcp.org received nearly instant response from Roger Kitain. Definitely not /dev/null, these guys really take their job serious. That was a joke about the hidden discussions on almost all EGs. Werner, it would be great, if you forwarded your mail to the d...@myfaces list, so we can see what happens to it. CC to the original list would be good Afaik the spec doesn't say anything about the view state issue apart from the JS docs (does anybody know any other places that talks about the id of the hidden view state inputs?). The Javascript shouldn't work based on the hidden inputs ids, but based In trinidad we render no ID b/c of that ... on the hidden inputs names. Here's a proposal on how to change the JS docs. If you agree, I'll post it to jsr-314-comme...@jcp.org. +1 and a CC to this list? That would be great Thx Matthias Correct the jsdoc for static jsf.ajax.*response*(request, context) like this: If an |update| element is found in the response with the identifier |javax.faces.ViewState|: |update id=javax.faces.ViewState ![CDATA[...]] /update| Include this |state| in the document as follows: * Extract this |update| element's |CDATA| contents from the response. (remove thes following lines) * If the document contains an element with the identifier |javax.faces.ViewState| replace its contents with the |CDATA| contents. * For each |form| element in the document: o If the |form| element contains an |input| element with the identifier |javax.faces.ViewState|, replace the |input| element contents with the |update| element's |CDATA| contents. o If the |form| element does not contain an element with the identifier |javax.faces.ViewState|, create an |input| element of the type |hidden|, with the identifier |javax.faces.ViewState|, set its contents to the |update| element's |CDATA| contents, and add the |input| element as a child to the |form| element. === (add the following lines) * Set the value of all elements within the document with the name |javax.faces.ViewState |to the CDATA contents * For each |form| element in the document: o If the |form| element does not contain an element with the name |javax.faces.ViewState|, create an |input| element of the type |hidden|, with the name |javax.faces.ViewState|, set its value to the |update| element's |CDATA| contents, and add the |input| element as a child to the |form| element. Best Regards, Ganesh
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
We probably have to point this out to the EG, since it is rather easy to fix this this should be fixed, after all to deal with those cases is what the name attribute in inputs exists for. It would be easy to have several viewState hidden fields one per form with formId:javax.faces.ViewState and the name javax.faces.ViewState... Werner Alexander Bell schrieb: Hi, in the past we did it in this way that we looking for the element only in the affected form. So in the form there is only one element with the id javax.faces.ViewState. It is also necessary that every form contains a hidden field with this id. So for JSF ok but it breaks the w3c standard and you can't use document.getElementById. We've got a appropriate code snippet in the j4fry code. 2009/4/19 Ganesh gan...@j4fry.org mailto:gan...@j4fry.org Hi Werner, 2 elements with the same id truely brake the HTML standard. And it's true, with Mojarra 2.0 and 2 forms on a page I get 2 identical input id=javax.faces.ViewState type=hidden value=j_id1:j_id2 name=javax.faces.ViewState/ elements! Still, I'm not able to find this in the specs, can you please point me to the section you are referring to? The spec says that an element with the identifier javax.faces.ViewState has to be added to every form if it does not exist within the update phase if viewState itself is responded! Best Regards, Ganesh -- Mit freundlichen Grüßen / Kind regards Alexander Bell J4Fry OpenSource Community Internet: http://www.j4fry.org E-Mail: alexander.b...@j4fry.org mailto:alexander.b...@j4fry.org Webprofil: http://www.j4fry.org/alexanderbell.shtml
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Hia... I sent a comment regarding this issue towards the given jcp-comments mail address. Lets see what happens. I think even if you can resolve those things on the javascript side this needs to be fixed, on the Spec side! After all the name attribute normally is there for what the spec and the RI tries to achieve by using multiple elements with the identifier javax.faces.ViewState! Werner Alexander Bell schrieb: Hi, in the past we did it in this way that we looking for the element only in the affected form. So in the form there is only one element with the id javax.faces.ViewState. It is also necessary that every form contains a hidden field with this id. So for JSF ok but it breaks the w3c standard and you can't use document.getElementById. We've got a appropriate code snippet in the j4fry code. 2009/4/19 Ganesh gan...@j4fry.org mailto:gan...@j4fry.org Hi Werner, 2 elements with the same id truely brake the HTML standard. And it's true, with Mojarra 2.0 and 2 forms on a page I get 2 identical input id=javax.faces.ViewState type=hidden value=j_id1:j_id2 name=javax.faces.ViewState/ elements! Still, I'm not able to find this in the specs, can you please point me to the section you are referring to? The spec says that an element with the identifier javax.faces.ViewState has to be added to every form if it does not exist within the update phase if viewState itself is responded! Best Regards, Ganesh -- Mit freundlichen Grüßen / Kind regards Alexander Bell J4Fry OpenSource Community Internet: http://www.j4fry.org E-Mail: alexander.b...@j4fry.org mailto:alexander.b...@j4fry.org Webprofil: http://www.j4fry.org/alexanderbell.shtml
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
On Mon, Apr 20, 2009 at 9:05 AM, Werner Punz werner.p...@gmail.com wrote: Hia... I sent a comment regarding this issue towards the given jcp-comments mail address. Lets see what happens. :-) /dev/null ? Another option is to have Martin (he is the ASF guy in the EG) bringing this to the EG. -Matthias I think even if you can resolve those things on the javascript side this needs to be fixed, on the Spec side! After all the name attribute normally is there for what the spec and the RI tries to achieve by using multiple elements with the identifier javax.faces.ViewState! Werner Alexander Bell schrieb: Hi, in the past we did it in this way that we looking for the element only in the affected form. So in the form there is only one element with the id javax.faces.ViewState. It is also necessary that every form contains a hidden field with this id. So for JSF ok but it breaks the w3c standard and you can't use document.getElementById. We've got a appropriate code snippet in the j4fry code. 2009/4/19 Ganesh gan...@j4fry.org mailto:gan...@j4fry.org Hi Werner, 2 elements with the same id truely brake the HTML standard. And it's true, with Mojarra 2.0 and 2 forms on a page I get 2 identical input id=javax.faces.ViewState type=hidden value=j_id1:j_id2 name=javax.faces.ViewState/ elements! Still, I'm not able to find this in the specs, can you please point me to the section you are referring to? The spec says that an element with the identifier javax.faces.ViewState has to be added to every form if it does not exist within the update phase if viewState itself is responded! Best Regards, Ganesh -- Mit freundlichen Grüßen / Kind regards Alexander Bell J4Fry OpenSource Community Internet: http://www.j4fry.org E-Mail: alexander.b...@j4fry.org mailto:alexander.b...@j4fry.org Webprofil: http://www.j4fry.org/alexanderbell.shtml -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Matthias Wessendorf schrieb: On Mon, Apr 20, 2009 at 9:05 AM, Werner Punz werner.p...@gmail.com wrote: Hia... I sent a comment regarding this issue towards the given jcp-comments mail address. Lets see what happens. :-) /dev/null ? That was mean :-) I will also talk to Martin about it as you said, btw... Another thing which really irks me generally. Since day zero about 90% of the problems of the end users revolve around the fact that there is no decent direct validation control for endusers within the spec. We have immediate, which does not work out for many cases, since it just shifts phases, we have since jsf1.2 the possibility of adding alternate lifecycles which is frankly spoken to complicated for many users and component sets add subforms which also is outside of the spec but work out best so far although they are still more complicated than a simple validation attribute! An attribute in the command links or buttons with validation=true/false would go a long way of removing a huge issue most users have with jsf. (the other one the component api thankfully has been resolved) I am glad Gerhard is adding something along those lines now to extVal, but I think in the long run a simple attribute in the button or command link which automatically turns off validation could help users tremendously. I am not sure why this still has not made it into the spec. Werner
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Hi Alexander/Ganesh there are two parts of the spec one being the PDF the other being the JavaDocs and JSDocs, you can find the issue in the JSDocs for jsf.ajax.response specifically in the section dealing with the updates in the responseXML! here is the section: If an update element is found in the response with the identifier javax.faces.ViewState: . snip other behavior if the form element does not contain an element with the identifier javax.faces.ViewState, create an input element of the type hidden, with the identifier javax.faces.ViewState, set its contents to the update element's CDATA contents, and add the input element as a child to the form element. note the term identifier here, which leaves no discussion that the id has to be used identifier == id in my opinion not the name which would be the proper way to resolve this in a html conform manner! Werner Alexander Bell schrieb: Hi, in the past we did it in this way that we looking for the element only in the affected form. So in the form there is only one element with the id javax.faces.ViewState. It is also necessary that every form contains a hidden field with this id. So for JSF ok but it breaks the w3c standard and you can't use document.getElementById. We've got a appropriate code snippet in the j4fry code. 2009/4/19 Ganesh gan...@j4fry.org mailto:gan...@j4fry.org Hi Werner, 2 elements with the same id truely brake the HTML standard. And it's true, with Mojarra 2.0 and 2 forms on a page I get 2 identical input id=javax.faces.ViewState type=hidden value=j_id1:j_id2 name=javax.faces.ViewState/ elements! Still, I'm not able to find this in the specs, can you please point me to the section you are referring to? The spec says that an element with the identifier javax.faces.ViewState has to be added to every form if it does not exist within the update phase if viewState itself is responded! Best Regards, Ganesh -- Mit freundlichen Grüßen / Kind regards Alexander Bell J4Fry OpenSource Community Internet: http://www.j4fry.org E-Mail: alexander.b...@j4fry.org mailto:alexander.b...@j4fry.org Webprofil: http://www.j4fry.org/alexanderbell.shtml
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Hi Matthias and Werner, The partial submit issue I posted to jsr-314-comme...@jcp.org received nearly instant response from Roger Kitain. Definitely not /dev/null, these guys really take their job serious. Werner, it would be great, if you forwarded your mail to the d...@myfaces list, so we can see what happens to it. Afaik the spec doesn't say anything about the view state issue apart from the JS docs (does anybody know any other places that talks about the id of the hidden view state inputs?). The Javascript shouldn't work based on the hidden inputs ids, but based on the hidden inputs names. Here's a proposal on how to change the JS docs. If you agree, I'll post it to jsr-314-comme...@jcp.org. Correct the jsdoc for static jsf.ajax.*response*(request, context) like this: If an |update| element is found in the response with the identifier |javax.faces.ViewState|: |update id=javax.faces.ViewState ![CDATA[...]] /update| Include this |state| in the document as follows: * Extract this |update| element's |CDATA| contents from the response. (remove thes following lines) * If the document contains an element with the identifier |javax.faces.ViewState| replace its contents with the |CDATA| contents. * For each |form| element in the document: o If the |form| element contains an |input| element with the identifier |javax.faces.ViewState|, replace the |input| element contents with the |update| element's |CDATA| contents. o If the |form| element does not contain an element with the identifier |javax.faces.ViewState|, create an |input| element of the type |hidden|, with the identifier |javax.faces.ViewState|, set its contents to the |update| element's |CDATA| contents, and add the |input| element as a child to the |form| element. === (add the following lines) * Set the value of all elements within the document with the name |javax.faces.ViewState |to the CDATA contents * For each |form| element in the document: o If the |form| element does not contain an element with the name |javax.faces.ViewState|, create an |input| element of the type |hidden|, with the name |javax.faces.ViewState|, set its value to the |update| element's |CDATA| contents, and add the |input| element as a child to the |form| element. Best Regards, Ganesh
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Sent from my iPod. Am 21.04.2009 um 06:05 schrieb Ganesh gan...@j4fry.org: Hi Matthias and Werner, The partial submit issue I posted to jsr-314-comme...@jcp.org received nearly instant response from Roger Kitain. Definitely not / dev/null, these guys really take their job serious. That was a joke about the hidden discussions on almost all EGs. Werner, it would be great, if you forwarded your mail to the d...@myfaces list, so we can see what happens to it. CC to the original list would be good Afaik the spec doesn't say anything about the view state issue apart from the JS docs (does anybody know any other places that talks about the id of the hidden view state inputs?). The Javascript shouldn't work based on the hidden inputs ids, but based In trinidad we render no ID b/c of that ... on the hidden inputs names. Here's a proposal on how to change the JS docs. If you agree, I'll post it to jsr-314-comme...@jcp.org. +1 and a CC to this list? That would be great Thx Matthias Correct the jsdoc for static jsf.ajax.*response*(request, context) like this: If an |update| element is found in the response with the identifier | javax.faces.ViewState|: |update id=javax.faces.ViewState ![CDATA[...]] /update| Include this |state| in the document as follows: * Extract this |update| element's |CDATA| contents from the response. (remove thes following lines) * If the document contains an element with the identifier |javax.faces.ViewState| replace its contents with the |CDATA| contents. * For each |form| element in the document: o If the |form| element contains an |input| element with the identifier |javax.faces.ViewState|, replace the |input| element contents with the |update| element's |CDATA| contents. o If the |form| element does not contain an element with the identifier |javax.faces.ViewState|, create an |input| element of the type |hidden|, with the identifier |javax.faces.ViewState|, set its contents to the |update| element's |CDATA| contents, and add the |input| element as a child to the |form| element. === (add the following lines) * Set the value of all elements within the document with the name |javax.faces.ViewState |to the CDATA contents * For each |form| element in the document: o If the |form| element does not contain an element with the name |javax.faces.ViewState|, create an |input| element of the type |hidden|, with the name |javax.faces.ViewState|, set its value to the |update| element's |CDATA| contents, and add the |input| element as a child to the |form| element. Best Regards, Ganesh
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Hi, in the past we did it in this way that we looking for the element only in the affected form. So in the form there is only one element with the id javax.faces.ViewState. It is also necessary that every form contains a hidden field with this id. So for JSF ok but it breaks the w3c standard and you can't use document.getElementById. We've got a appropriate code snippet in the j4fry code. 2009/4/19 Ganesh gan...@j4fry.org Hi Werner, 2 elements with the same id truely brake the HTML standard. And it's true, with Mojarra 2.0 and 2 forms on a page I get 2 identical input id=javax.faces.ViewState type=hidden value=j_id1:j_id2 name=javax.faces.ViewState/ elements! Still, I'm not able to find this in the specs, can you please point me to the section you are referring to? The spec says that an element with the identifier javax.faces.ViewState has to be added to every form if it does not exist within the update phase if viewState itself is responded! Best Regards, Ganesh -- Mit freundlichen Grüßen / Kind regards Alexander Bell J4Fry OpenSource Community Internet: http://www.j4fry.org E-Mail: alexander.b...@j4fry.org Webprofil: http://www.j4fry.org/alexanderbell.shtml
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Hi Werner, 2 elements with the same id truely brake the HTML standard. And it's true, with Mojarra 2.0 and 2 forms on a page I get 2 identical input id=javax.faces.ViewState type=hidden value=j_id1:j_id2 name=javax.faces.ViewState/ elements! Still, I'm not able to find this in the specs, can you please point me to the section you are referring to? The spec says that an element with the identifier javax.faces.ViewState has to be added to every form if it does not exist within the update phase if viewState itself is responded! Best Regards, Ganesh
Re: MyFaces 2.0 Ajax - Also question to the JSF2 EG Members!
Ok Ganesh most of the response cycle now works as expected I did not manage in time however to fix up the code for the update for a full body or head replacement to use beforeNode or afterNode to auto trigger embedded scripts! You might work that in instead of me. Another thing wich came to my mind if anyone from the EG is reading this. There is a weird issue regarding the viewState handling in the spec! The spec says that an element with the identifier javax.faces.ViewState has to be added to every form if it does not exist within the update phase if viewState itself is responded! The funny thing is, that normally no two elements with the same identifiers are allowed within the dom tree. The API clearly supports this by limiting the getter function within the dom by getElementById! Well the browsers mostly support this, one way or the other but this causes sideeffects by the browsers if you do direct dom access! So is this really as it should be or do the viewState elements just have the name javax.faces.ViewState and have a different id like formId:javax.faces.ViewState Does anyone have any idea? I did not code this part yet because this was rather unclear to me! Werner Werner Punz schrieb: Ganesh schrieb: Hi Werner, There are some corners within the ajax response XML format that doesn't make much sense for me in respect to JSF. Especially for the insert, delete and attributes sections of the update element I cannot see how to trigger them from the existing jsf.ajax.request interface. Still they must be implemented because they make part of the spec and I'm thankful that you are taking on these hard-to-test tasks. Actually I have to recheck the entire java part especially the JavaDocs (have in mind the about half of the specs functionality is documented in the javadocs instead of the PDF) if there are cases where the deletes and inserts can be triggered from within the components automatically. My personal guess is that this stuff is a handful of shortcuts for the component writers so that they can gain some additional functionality easily which would be hard to deal without. After all within the context of a classical response writer api the inserts and deletes are hard to process but sometimes you need them. I´d rather have a protocol which is more extensive in this area than having a few missing parts which then cannot really be added! But I haven´t been too much concerned with the java side of the jsf spec for now because I usually focus on one area before going into the next! So I am not sure if I have missed something there! The jira task on the extensions (MYFACES-2174) is NOT for the visual part. The visual part (disable components and show loading bar during request) would truely make a good extension, but I've set this aside until the core is fully functional. The jira is for the addional attributes for the xhr core: pps, queuesize and errorlevel. Ok thanks for the clarification. Werner