not in MyFaces with JSP. In MyFaces, the uniqueId counter for dynamic
component generation is stored in between requests, and the ids for
components stem from a different counter. I wonder if Facelets uses
the same approach.

regards,

Martin

On 1/16/08, Volker Weber <[EMAIL PROTECTED]> wrote:
> Bernd,
>
> i don't know how facelets component creation, rerendering works, but
> to my experience the assigning of viewRoot.createUniqueId() ids to
> componets created by application wil result in dublicateIdException on
> rerendering.
>
>
> Regards,
>     Volker
>
> 2008/1/15, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> > Author: bommel
> > Date: Tue Jan 15 14:21:33 2008
> > New Revision: 612250
> >
> > URL: http://svn.apache.org/viewvc?rev=612250&view=rev
> > Log:
> > (TOBAGO-596) Duplicate component Id exception with tc:date and tx:date
> with facelets
> >
> > Modified:
> >
> myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
> >
> myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
> >
> > Modified:
> myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
> > URL:
> http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java?rev=612250&r1=612249&r2=612250&view=diff
> >
> ==============================================================================
> > ---
> myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
> (original)
> > +++
> myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
> Tue Jan 15 14:21:33 2008
> > @@ -135,13 +135,15 @@
> >      UIHiddenInput hidden =
> >          (UIHiddenInput) ComponentUtil.createComponent(facesContext,
> >              UIHiddenInput.COMPONENT_TYPE, RENDERER_TYPE_HIDDEN);
> > +    hidden.setId(facesContext.getViewRoot().createUniqueId());
> >      link.getChildren().add(hidden);
> >
> >      // create popup
> >      final UIPopup popup =
> >          (UIPopup) ComponentUtil.createComponent(facesContext,
> UIPopup.COMPONENT_TYPE,
> >              RENDERER_TYPE_POPUP);
> > -    //popup.setId(link.getId() + "popup");
> > +
> > +    popup.setId(facesContext.getViewRoot().createUniqueId());
> >      link.getFacets().put(FACET_PICKER_POPUP, popup);
> >
> >      popup.setRendered(false);
> > @@ -234,6 +236,7 @@
> >      UIGraphic image = (UIGraphic) ComponentUtil.createComponent(
> >          facesContext, UIGraphic.COMPONENT_TYPE, RENDERER_TYPE_IMAGE);
> >      image.setRendered(true);
> > +    image.setId(facesContext.getViewRoot().createUniqueId());
> >      image.setValue("image/date.gif");
> >      image.getAttributes().put(ATTR_ALT, ""); //TODO: i18n
> >
> StyleClasses.ensureStyleClasses(image).addFullQualifiedClass("tobago-input-picker");
> // XXX not a standard name
> >
> > Modified:
> myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
> > URL:
> http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java?rev=612250&r1=612249&r2=612250&view=diff
> >
> ==============================================================================
> > ---
> myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
> (original)
> > +++
> myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
> Tue Jan 15 14:21:33 2008
> > @@ -70,20 +70,18 @@
> >          link.setDisabled(dateInput.isReadonly() ||
> dateInput.isDisabled());
> >        }
> >      }
> > -    String idPrefix = dateInput.getId() + "_picker";
> >      Map<String, Object>  attributes = link.getAttributes();
> >      link.setActionListener(datePickerController);
> >      attributes.put(ATTR_LAYOUT_WIDTH, getConfiguredValue(facesContext,
> component, "pickerWidth"));
> >      UIComponent hidden = (UIComponent) link.getChildren().get(0);
> > -    hidden.setId(idPrefix + "Dimension");
> > +    UIPopup popup = (UIPopup) link.getFacets().get(FACET_PICKER_POPUP);
> > +
> >      attributes.put(ATTR_ACTION_ONCLICK, "Tobago.openPickerPopup(event, '"
> >          + link.getClientId(facesContext) + "', '"
> > -        + hidden.getClientId(facesContext) + "')");
> > -
> > -    UIPopup popup = (UIPopup) link.getFacets().get(FACET_PICKER_POPUP);
> > +        + hidden.getClientId(facesContext) + "', '"
> > +        + popup.getClientId(facesContext) +"')");
> >
> >      attributes = popup.getAttributes();
> > -    popup.setId(idPrefix + "popup");
> >
> >      attributes.put(ATTR_WIDTH, String.valueOf(
> >             ThemeConfig.getValue(facesContext, link,
> "CalendarPopupWidth")));
> > @@ -113,8 +111,6 @@
> >
> >      applyConverterPattern(popup, converterPattern);
> >
> > -    UIComponent image = (UIComponent) link.getChildren().get(1);
> > -    image.setId(idPrefix + "image");
> >      if (popup != null) {
> >        UIPage page = ComponentUtil.findPage(facesContext, link);
> >        page.getPopups().add(popup);
> >
> >
> >
>
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13      | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX:  +49 441 4082 355 | www.inexso.de
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to