You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sujal Nagarkar <su...@persistent.co.in> on 2009/04/07 10:37:45 UTC

Suffix added to component id when including files

Hi,

 

While using jsp:include in a jsf page, the included page control ids are
modified. Pc1 is added to end of each control.

If anyone has a solution for this, please do reply.

 

With regards,

 

Sujal Nagarkar | Software Engineer - Development | Persistent Systems
Limited

sujal_nagarkar@persistent.co.in | Cell: +91 97300 - 35026| Tel: +91 (20)
3023 -  5995

Persistent Systems - Innovation in software product design, development and
delivery - www.persistentsys.com <http://www.persistentsys.com/> 

 


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

RE: Suffix added to component id when including files

Posted by Sujal Nagarkar <su...@persistent.co.in>.
Hi Simon,

I am using these included ids for javascript based functionality
(document.getElementById).
As the suffixed ids are not unique enough, I would get issues even if I try
and assume one pattern.

Is there any other alternative or assumption I can make do make it work in
this scenario?

With regards,
   Sujal
Sujal Nagarkar | Software Engineer - Development | Persistent Systems
Limited
sujal_nagarkar@persistent.co.in | Cell: +91 97300 - 35026| Tel: +91 (20)
3023 -  5995
Persistent Systems - Innovation in software product design, development and
delivery - www.persistentsys.com
 
-----Original Message-----
From: Simon Kitching [mailto:skitching@apache.org] 
Sent: Tuesday, April 07, 2009 3:27 PM
To: MyFaces Discussion
Subject: Re: Suffix added to component id when including files

Sujal Nagarkar schrieb:
> Hi,
> 
>  
> 
> While using jsp:include in a jsf page, the included page control ids are
> modified. Pc1 is added to end of each control.
> 
> If anyone has a solution for this, please do reply.

This is intentional; it allows jsp:include to be used inside a foreach
loop without causing duplicate JSF component ids, and various other
cases. Sun's Mojarra JSF implementation does the same.

Why does this matter to you? Your applications generally should not care
what id is assigned to components by the JSF framework.

Having said that, I would personally be happy to see a configuration
switch in myfaces to allow this id-munging to be disabled. It helps only
in some odd corner cases that most people never encounter, and does make
the ids ugly. If someone were to write a patch to add such a config
option, it would get my +1 vote (or does such a config option exist
already?).

Regards, Simon


-- 
-- Emails in "mixed" posting style will be ignored
-- (http://en.wikipedia.org/wiki/Posting_style)


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Re: Suffix added to component id when including files

Posted by Simon Kitching <sk...@apache.org>.
Sujal Nagarkar schrieb:
> Hi,
> 
>  
> 
> While using jsp:include in a jsf page, the included page control ids are
> modified. Pc1 is added to end of each control.
> 
> If anyone has a solution for this, please do reply.

This is intentional; it allows jsp:include to be used inside a foreach
loop without causing duplicate JSF component ids, and various other
cases. Sun's Mojarra JSF implementation does the same.

Why does this matter to you? Your applications generally should not care
what id is assigned to components by the JSF framework.

Having said that, I would personally be happy to see a configuration
switch in myfaces to allow this id-munging to be disabled. It helps only
in some odd corner cases that most people never encounter, and does make
the ids ugly. If someone were to write a patch to add such a config
option, it would get my +1 vote (or does such a config option exist
already?).

Regards, Simon


-- 
-- Emails in "mixed" posting style will be ignored
-- (http://en.wikipedia.org/wiki/Posting_style)