atom feed35 messages in net.java.dev.ajax.devRe: component.getClientId only unique...
FromSent OnAttachments
Gregory MurrayApr 10, 2007 10:44 pm 
Norbert TruchsessApr 11, 2007 12:03 am 
Norbert TruchsessApr 11, 2007 12:05 am 
Gregory MurrayApr 11, 2007 12:26 am 
Gregory MurrayApr 11, 2007 12:48 am 
Craig McClanahanApr 11, 2007 12:58 am 
Craig McClanahanApr 11, 2007 1:19 am 
Ed BurnsApr 11, 2007 6:32 pm 
Ed BurnsApr 11, 2007 7:52 pm 
Craig McClanahanApr 11, 2007 7:53 pm 
Ed BurnsApr 11, 2007 8:28 pm 
Craig McClanahanApr 11, 2007 9:41 pm 
Craig McClanahanApr 11, 2007 9:44 pm 
Craig McClanahanApr 11, 2007 9:51 pm 
Norbert TruchsessApr 11, 2007 10:08 pm 
Norbert TruchsessApr 11, 2007 10:15 pm 
Craig McClanahanApr 12, 2007 12:19 am 
Norbert TruchsessApr 12, 2007 1:19 pm 
Norbert TruchsessApr 12, 2007 2:54 pm 
Norbert TruchsessApr 12, 2007 3:43 pm 
Gregory MurrayApr 14, 2007 4:56 pm 
Gregory MurrayApr 14, 2007 5:03 pm 
Craig McClanahanApr 14, 2007 5:06 pm 
Ed BurnsApr 16, 2007 8:18 am 
Gregory MurrayApr 16, 2007 8:32 am 
Ed BurnsApr 16, 2007 8:55 am 
Gregory MurrayApr 16, 2007 9:09 am 
Norb...@t-online.deApr 16, 2007 9:21 am 
Ed BurnsApr 17, 2007 9:59 am 
Craig McClanahanApr 17, 2007 10:23 am 
Norbert TruchsessApr 17, 2007 1:05 pm 
Craig McClanahanApr 17, 2007 3:30 pm 
Gregory MurrayApr 18, 2007 1:54 am 
Norb...@t-online.deApr 18, 2007 4:44 am 
Norbert TruchsessApr 19, 2007 1:40 pm 
Subject:Re: component.getClientId only unique to a given page.
From:Craig McClanahan (Crai@Sun.COM)
Date:Apr 11, 2007 1:19:27 am
List:net.java.dev.ajax.dev

Norbert Truchsess wrote:

Craig McClanahan schrieb:

Gregory Murray wrote:

Hi all,

I noticed with jMaki that the uuids that are rendered using the component.getClientId(context) are unique to a given page and thus caused conflicts when I do JavaScript based DOM injection in a page that is composed of more than 1 JSF page. The first place I saw this was in the Tabbed View components.

While I have a jMaki specific way of working with this for now would there be any chance in a future version of JSF to have all component ids for a given session unique?

I will look at this, but I have a problem accepting your basic assertion that session scoped component ids should exist at all. Component ids are a view tier thing (i.e. request scope in a web paradigm), while session scope objects are normally model tier.

totally agree :-)

Also if you all have a better idea on how this might be done I'm all ears. The solution in place works for now.

Matt : you had mentioned possibly having a uuid on the page : Is this something available today?

Are you going to address the fact that your changes on resource resolution totally trashed the widget wrapper components? It appears that your post-package-rename changes totally broke resource resolution from a JAR file. See my earlier posts for more details.

Although it was not me doing these changes, I'm currently working on getting this done. I guess Greg not really available for this today ;-)

There is that :-). Congrats Greg!

Craig

-Greg

Craig

- Norbert

Begin forwarded message:

*From: *gmur@dev.java.net <mailto:gmur@dev.java.net> *Date: *April 10, 2007 10:39:23 PM PDT *To: *cv@ajax.dev.java.net <mailto:cv@ajax.dev.java.net> *Subject: **CVS update: /ajax/ws/jmaki/shared/src/java/jmaki/runtime/jsf/AjaxWrapperRenderer.java*

*Reply-To: *cv@ajax.dev.java.net <mailto:cv@ajax.dev.java.net>

User: gmurray71 Date: 2007-04-11 05:39:23+0000 Log: Using a custom uuid genrerator that will create unique ids that are unique application wide. The default ids genrated by JSF are unique to a page and not to across pages meaning that if we inject content from one page into another the same widget can be given the same id and breaking the widgets. This was seen with the tabbed view that use the injector under the covers.

File Changes:

Directory: /ajax/ws/jmaki/shared/src/java/jmaki/runtime/jsf/ ============================================================

File [changed]: AjaxWrapperRenderer.java Url: https://ajax.dev.java.net/source/browse/ajax/ws/jmaki/shared/src/java/jmaki/runtime/jsf/AjaxWrapperRenderer.java?r1=1.2&r2=1.3 <https://ajax.dev.java.net/source/browse/ajax/ws/jmaki/shared/src/java/jmaki/runtime/jsf/AjaxWrapperRenderer.java?r1=1.2&r2=1.3>

Delta lines: +11 -2

-------------------- --- AjaxWrapperRenderer.java 2007-04-10 06:25:23+0000 1.2 +++ AjaxWrapperRenderer.java 2007-04-11 05:39:21+0000 1.3 @@ -51,7 +51,7 @@

private static Logger logger;

-// private static int nextId = 0; + private static int nextId = 0; // /** Creates a new instance of AjaxDynamicLabelRenderer */ public AjaxWrapperRenderer() { @@ -82,6 +82,10 @@

public void encodeEnd(FacesContext context, UIComponent component) throws IOException { Map headers = context.getExternalContext().getRequestHeaderMap(); + //gmuray71 : Rest the uuid after 50000 + if (nextId > 50000) { + nextId = 0; + } String renderHeader = (String) headers.get("com.sun.faces.avatar.partial");

// If this is an AJAX request, just encode our value @@ -104,7 +108,12 @@ AjaxCommonRenderer ajaxCommon = new AjaxCommonRenderer(ajx);

ajaxCommon.setName(wrapper.getName()); - ajaxCommon.setUuid(wrapper.getClientId(context)); + // gmurray71 + // unique ids are unique to a page and not to an session meaning that if we inject + // content from one page into another the same widget can be given the same id thus + // the same id appears 2x in the same page. + ajaxCommon.setUuid(wrapper.getName().replace('.', '_') + "_" + nextId++); + //ajaxCommon.setUuid(wrapper.getClientId(context)); ajaxCommon.setTemplate(wrapper.getTemplate()); ajaxCommon.setArgs(wrapper.getArgs());