You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Marcus Beyer (JIRA)" <de...@myfaces.apache.org> on 2007/08/08 15:54:59 UTC

[jira] Created: (MYFACES-1700) each generated an with same id="javax.faces.ViewState"

each <h:form> generated an <input> with same id="javax.faces.ViewState" 
------------------------------------------------------------------------

                 Key: MYFACES-1700
                 URL: https://issues.apache.org/jira/browse/MYFACES-1700
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 1.1.5
         Environment: I am using Tomcat 5.5. inside of JBoss 4.0.2.
            Reporter: Marcus Beyer


On pages with more than one <h:form>, each one generates an element which has always the same id, which is invalid HTML. 

Looks like this:

...</script><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="..." /></form>

I tried to put it inside <f:subview> as a workaround, but that did not work either (the ids did not change).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Resolved: (MYFACES-1700) each generated an with same id="javax.faces.ViewState"

Posted by xtof83 <ga...@gmail.com>.
You're right, I get the code, and I compile it... now it work perfectly.
Thx


Manfred Geiler wrote:
> 
> It's fixed for 1.1.6-SNAPSHOT and 1.2.1-SNAPSHOT.
> It's NOT fixed for 1.2.0 that was released months ago, of course.
> ;-)
> 
> --Manfred
> 
> 
> On Nov 29, 2007 9:11 PM, xtof83 <ga...@gmail.com> wrote:
>>
>> Hi guys,
>>
>> I sorry I test all the cases written on this page, but still dont work
>> for
>> me. Ids are still displayed several times.
>> MyFaces version :
>> <!-- myfaces -->
>>     <dependency>
>>       <groupId>org.apache.myfaces.core</groupId>
>>       <artifactId>myfaces-api</artifactId>
>>       <version>1.2.0</version>
>>     </dependency>
>>     <dependency>
>>       <groupId>org.apache.myfaces.core</groupId>
>>       <artifactId>myfaces-impl</artifactId>
>>       <version>1.2.0</version>
>>     </dependency>
>>
>> What could be the problem ?
>> Thx
>>
>>
>>
>> Manfred Geiler wrote:
>> >
>> > no, it exactly says what it does:
>> >
>> > org.apache.myfaces.RENDER_VIEWSTATE_ID=true is the default and renders
>> > the hidden input id attribute.
>> >
>> > Setting it to false solves the xhtml problem by NOT rendering the id.
>> >
>> > Sorry, my original jira comment was wrong and misleading - I fixed
>> that.
>> >
>> > --Manfred
>> >
>> >
>> >
>> > On Nov 19, 2007 5:40 PM, Sochor Zdeněk <zd...@ataco.cz> wrote:
>> >> Hi,
>> >>
>> >>
>> >> Manfred Geiler (JIRA) napsal(a):
>> >> > Therefore I added a (MyFaces specific) config parameter:
>> >> >   org.apache.myfaces.RENDER_VIEWSTATE_ID
>> >> > The default value is false for backwards compatibility.
>> >> >
>> >> >
>> >> I think this name is misleading - when set to false it IS rendering id
>> >> and when true it's NOT.
>> >> Something similar to VIEWSTATE_NO_ID would work better (defaulting to
>> >> false).
>> >>
>> >> Best regards,
>> >>
>> >> Zdenek
>> >>
>> >
>> >
>> >
>> > --
>> > http://www.irian.at
>> > Your JSF powerhouse - JSF Consulting,
>> > Development and Courses in English and
>> > German
>> >
>> > Professional Support for Apache MyFaces
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-jira--Created%3A-%28MYFACES-1700%29-each-%3Ch%3Aform%3E-generated-an-%3Cinput%3E-with-same-id%3D%22javax.faces.ViewState%22-tf4236530.html#a14033821
>> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> http://www.irian.at
> Your JSF powerhouse - JSF Consulting,
> Development and Courses in English and
> German
> 
> Professional Support for Apache MyFaces
> 
> 

-- 
View this message in context: http://www.nabble.com/-jira--Created%3A-%28MYFACES-1700%29-each-%3Ch%3Aform%3E-generated-an-%3Cinput%3E-with-same-id%3D%22javax.faces.ViewState%22-tf4236530.html#a14035946
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: [jira] Resolved: (MYFACES-1700) each generated an with same id="javax.faces.ViewState"

Posted by Manfred Geiler <ma...@gmail.com>.
It's fixed for 1.1.6-SNAPSHOT and 1.2.1-SNAPSHOT.
It's NOT fixed for 1.2.0 that was released months ago, of course.
;-)

--Manfred


On Nov 29, 2007 9:11 PM, xtof83 <ga...@gmail.com> wrote:
>
> Hi guys,
>
> I sorry I test all the cases written on this page, but still dont work for
> me. Ids are still displayed several times.
> MyFaces version :
> <!-- myfaces -->
>     <dependency>
>       <groupId>org.apache.myfaces.core</groupId>
>       <artifactId>myfaces-api</artifactId>
>       <version>1.2.0</version>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.myfaces.core</groupId>
>       <artifactId>myfaces-impl</artifactId>
>       <version>1.2.0</version>
>     </dependency>
>
> What could be the problem ?
> Thx
>
>
>
> Manfred Geiler wrote:
> >
> > no, it exactly says what it does:
> >
> > org.apache.myfaces.RENDER_VIEWSTATE_ID=true is the default and renders
> > the hidden input id attribute.
> >
> > Setting it to false solves the xhtml problem by NOT rendering the id.
> >
> > Sorry, my original jira comment was wrong and misleading - I fixed that.
> >
> > --Manfred
> >
> >
> >
> > On Nov 19, 2007 5:40 PM, Sochor Zdeněk <zd...@ataco.cz> wrote:
> >> Hi,
> >>
> >>
> >> Manfred Geiler (JIRA) napsal(a):
> >> > Therefore I added a (MyFaces specific) config parameter:
> >> >   org.apache.myfaces.RENDER_VIEWSTATE_ID
> >> > The default value is false for backwards compatibility.
> >> >
> >> >
> >> I think this name is misleading - when set to false it IS rendering id
> >> and when true it's NOT.
> >> Something similar to VIEWSTATE_NO_ID would work better (defaulting to
> >> false).
> >>
> >> Best regards,
> >>
> >> Zdenek
> >>
> >
> >
> >
> > --
> > http://www.irian.at
> > Your JSF powerhouse - JSF Consulting,
> > Development and Courses in English and
> > German
> >
> > Professional Support for Apache MyFaces
> >
> >
>
> --
> View this message in context: http://www.nabble.com/-jira--Created%3A-%28MYFACES-1700%29-each-%3Ch%3Aform%3E-generated-an-%3Cinput%3E-with-same-id%3D%22javax.faces.ViewState%22-tf4236530.html#a14033821
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>



-- 
http://www.irian.at
Your JSF powerhouse - JSF Consulting,
Development and Courses in English and
German

Professional Support for Apache MyFaces

Re: [jira] Resolved: (MYFACES-1700) each generated an with same id="javax.faces.ViewState"

Posted by xtof83 <ga...@gmail.com>.
Hi guys,

I sorry I test all the cases written on this page, but still dont work for
me. Ids are still displayed several times.
MyFaces version :
<!-- myfaces -->
    <dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-api</artifactId>
      <version>1.2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-impl</artifactId>
      <version>1.2.0</version>
    </dependency>

What could be the problem ?
Thx


Manfred Geiler wrote:
> 
> no, it exactly says what it does:
> 
> org.apache.myfaces.RENDER_VIEWSTATE_ID=true is the default and renders
> the hidden input id attribute.
> 
> Setting it to false solves the xhtml problem by NOT rendering the id.
> 
> Sorry, my original jira comment was wrong and misleading - I fixed that.
> 
> --Manfred
> 
> 
> 
> On Nov 19, 2007 5:40 PM, Sochor Zdeněk <zd...@ataco.cz> wrote:
>> Hi,
>>
>>
>> Manfred Geiler (JIRA) napsal(a):
>> > Therefore I added a (MyFaces specific) config parameter:
>> >   org.apache.myfaces.RENDER_VIEWSTATE_ID
>> > The default value is false for backwards compatibility.
>> >
>> >
>> I think this name is misleading - when set to false it IS rendering id
>> and when true it's NOT.
>> Something similar to VIEWSTATE_NO_ID would work better (defaulting to
>> false).
>>
>> Best regards,
>>
>> Zdenek
>>
> 
> 
> 
> -- 
> http://www.irian.at
> Your JSF powerhouse - JSF Consulting,
> Development and Courses in English and
> German
> 
> Professional Support for Apache MyFaces
> 
> 

-- 
View this message in context: http://www.nabble.com/-jira--Created%3A-%28MYFACES-1700%29-each-%3Ch%3Aform%3E-generated-an-%3Cinput%3E-with-same-id%3D%22javax.faces.ViewState%22-tf4236530.html#a14033821
Sent from the My Faces - Dev mailing list archive at Nabble.com.


[jira] Issue Comment Edited: (MYFACES-1700) each generated an with same id="javax.faces.ViewState"

Posted by "Manfred Geiler (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12543599 ] 

manolito edited comment on MYFACES-1700 at 11/19/07 8:43 AM:
-------------------------------------------------------------------

This is a spec bug in JSF 1.2:
http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/render/ResponseStateManager.html#VIEW_STATE_PARAM

However, the id is actually not needed (in MyFaces) unless some special (AJAX) components wanna do some Javascript magic.

Therefore I added a (MyFaces specific) config parameter:
  org.apache.myfaces.RENDER_VIEWSTATE_ID
The default value is true for backwards compatibility.

So, adding
    <context-param>
        <description>
            Do not render the "javax.jsf.ViewState" id attribute for
            view state hidden inputs. Necessary for valid XHTML on multiple forms on one page.
        </description>
        <param-name>org.apache.myfaces.RENDER_VIEWSTATE_ID</param-name>
        <param-value>false</param-value>
    </context-param>
to your web.xml makes multiple form jsf pages XHTML valid.

--Manfred


      was (Author: manolito):
    This is a spec bug in JSF 1.2:
http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/render/ResponseStateManager.html#VIEW_STATE_PARAM

However, the id is actually not needed (in MyFaces) unless some special (AJAX) components wanna do some Javascript magic.

Therefore I added a (MyFaces specific) config parameter:
  org.apache.myfaces.RENDER_VIEWSTATE_ID
The default value is false for backwards compatibility.

So, adding
    <context-param>
        <description>
            Do not render the "javax.jsf.ViewState" id attribute for
            view state hidden inputs. Necessary for valid XHTML on multiple forms on one page.
        </description>
        <param-name>org.apache.myfaces.RENDER_VIEWSTATE_ID</param-name>
        <param-value>false</param-value>
    </context-param>
to your web.xml makes multiple form jsf pages XHTML valid.

--Manfred

  
> each <h:form> generated an <input> with same id="javax.faces.ViewState" 
> ------------------------------------------------------------------------
>
>                 Key: MYFACES-1700
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1700
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.5
>         Environment: I am using Tomcat 5.5. inside of JBoss 4.0.2.
>            Reporter: Marcus Beyer
>            Assignee: Manfred Geiler
>             Fix For:  1.1.6-SNAPSHOT
>
>
> On pages with more than one <h:form>, each one generates an element which has always the same id, which is invalid HTML. 
> Looks like this:
> ...</script><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="..." /></form>
> I tried to put it inside <f:subview> as a workaround, but that did not work either (the ids did not change).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Resolved: (MYFACES-1700) each generated an with same id="javax.faces.ViewState"

Posted by Manfred Geiler <ma...@gmail.com>.
no, it exactly says what it does:

org.apache.myfaces.RENDER_VIEWSTATE_ID=true is the default and renders
the hidden input id attribute.

Setting it to false solves the xhtml problem by NOT rendering the id.

Sorry, my original jira comment was wrong and misleading - I fixed that.

--Manfred



On Nov 19, 2007 5:40 PM, Sochor Zdeněk <zd...@ataco.cz> wrote:
> Hi,
>
>
> Manfred Geiler (JIRA) napsal(a):
> > Therefore I added a (MyFaces specific) config parameter:
> >   org.apache.myfaces.RENDER_VIEWSTATE_ID
> > The default value is false for backwards compatibility.
> >
> >
> I think this name is misleading - when set to false it IS rendering id
> and when true it's NOT.
> Something similar to VIEWSTATE_NO_ID would work better (defaulting to
> false).
>
> Best regards,
>
> Zdenek
>



-- 
http://www.irian.at
Your JSF powerhouse - JSF Consulting,
Development and Courses in English and
German

Professional Support for Apache MyFaces

Re: [jira] Resolved: (MYFACES-1700) each generated an with same id="javax.faces.ViewState"

Posted by Sochor Zdeněk <zd...@ataco.cz>.
Hi,


Manfred Geiler (JIRA) napsal(a):
> Therefore I added a (MyFaces specific) config parameter:
>   org.apache.myfaces.RENDER_VIEWSTATE_ID
> The default value is false for backwards compatibility.
>
>   
I think this name is misleading - when set to false it IS rendering id 
and when true it's NOT.
Something similar to VIEWSTATE_NO_ID would work better (defaulting to 
false).

Best regards,

Zdenek

[jira] Resolved: (MYFACES-1700) each generated an with same id="javax.faces.ViewState"

Posted by "Manfred Geiler (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-1700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Manfred Geiler resolved MYFACES-1700.
-------------------------------------

       Resolution: Fixed
    Fix Version/s:  1.1.6-SNAPSHOT
         Assignee: Manfred Geiler

This is a spec bug in JSF 1.2:
http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/render/ResponseStateManager.html#VIEW_STATE_PARAM

However, the id is actually not needed (in MyFaces) unless some special (AJAX) components wanna do some Javascript magic.

Therefore I added a (MyFaces specific) config parameter:
  org.apache.myfaces.RENDER_VIEWSTATE_ID
The default value is false for backwards compatibility.

So, adding
    <context-param>
        <description>
            Do not render the "javax.jsf.ViewState" id attribute for
            view state hidden inputs. Necessary for valid XHTML on multiple forms on one page.
        </description>
        <param-name>org.apache.myfaces.RENDER_VIEWSTATE_ID</param-name>
        <param-value>false</param-value>
    </context-param>
to your web.xml makes multiple form jsf pages XHTML valid.

--Manfred


> each <h:form> generated an <input> with same id="javax.faces.ViewState" 
> ------------------------------------------------------------------------
>
>                 Key: MYFACES-1700
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1700
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.5
>         Environment: I am using Tomcat 5.5. inside of JBoss 4.0.2.
>            Reporter: Marcus Beyer
>            Assignee: Manfred Geiler
>             Fix For:  1.1.6-SNAPSHOT
>
>
> On pages with more than one <h:form>, each one generates an element which has always the same id, which is invalid HTML. 
> Looks like this:
> ...</script><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="..." /></form>
> I tried to put it inside <f:subview> as a workaround, but that did not work either (the ids did not change).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.