I think I may have narrowed down the problem.
In org.apache.shale.clay.component.chain.CreateComponentCommand
String id = null;
if ((id = displayElement.getId()) == null)
id = facesContext.getViewRoot().createUniqueId();
UIComponent child = null;
if (displayElement.getFacetName() != null)
child = parent.getFacet(displayElement.getFacetName());
else
child = parent.findComponent(id);
if (child == null) {
// create child
}
probably needs to take into account that id may have a mnemonic associated
with it.
so,
String id = null;
id = hasMnemonic(displayElement.getId()) ?
getMnemoic(displayElement.getId()): displayElement.getId();
if (id == null)
id = facesContext.getViewRoot().createUniqueId();
...
Then a duplicate component will not be created in the render cycle.
Ryan Wynn/Vienna/[EMAIL PROTECTED]
10/27/2005 04:04 PM
Please respond to
"Struts Users Mailing List"
To
[email protected]
cc
[EMAIL PROTECTED]
Subject
[Shale] new Clay replacement symbols
I noticed the new code for the replacement symbols. Gary, I like how
you've opened it up to any attribute that is not defined. Great job on
this.
It seems that the ClayViewHandler will now have to change to accomodate
this. I noticed the following problem today.
If I have
<component jsfid="myInput" extends="inputText">
<attributes>
<set name="id" value="@myId"/>
<set name="value" value="#{myBean.bar}"/>
</attributes>
</component>
then in the html
<span jsfid="myInput" myId="foo"/>
What happens it that the first time the page is rendered, everything works
properly. I get an input field with in id of 'foo'. Then the next time
the page is rendered I get a Duplicate Id in the Faces Tree error for
'foo'. I debugged this a little bit and I noticed that the second time
the page is rendered 2 HtmlInputText components exist in the Faces Tree
for 'foo'. So I am guessing that Clay is doing the replacement on the
symbol later than it needs to for id. In which case it would look for a
component with id @myId instead of foo when deciding whether or not a
component needs to be created.
Ryan