This is because the 'ajax' ID (the id Wicket uses in rendering) has to
be known before it knows the markup tag. This is a limitation of 1.2
that we have solved in 2.0 with the constructor change.

Simply put: in order to generate a unique identifier, a component
needs its parent. During construction using the add method, the parent
is typically not know. JavaScript for header contributions and other
things typically get rendered before the component in question. Wicket
doesn't know about the component's tag, so it can't retrieve the
markup id. Markup id generation overwrites the assigned ID because
other components and markup pieces can depend on it.

As said previously, this particular problem is solved in 2.0, as the
component's parent is know at construction time. This doesn't mean
Wicket won't overwrite your markup ID in 2.0 (I don't know that yet),
but it makes the need for generating the ID's a lot smaller. Typically
you will still need to generate the markup id, even in 2.0, to create
valid markup (markup ID's need to be unique across the document).

Martijn

On 7/3/06, Alex Objelean <[EMAIL PROTECTED]> wrote:
>
> Indeed, it seems that the old value is overriden with the generated value...
> In this case, why the markupId do not care about the old value? Wouldn't it
> be much better if it would be the same as the original id?
>
>
> Alex Objelean wrote:
> >
> > In this case, the designer efforts will be disabled anytime I use an
> > ajaxified component, isn't it?
> > For instance I have :
> >
> > <div wicket:id="idForWicket" id="idForDesigner"></div>
> >
> > in CSS:
> >
> > div#idForDesigner {
> >   float: left;
> >   border: solid red 1px;
> > }
> >
> > in JAVA:
> >
> > Component component = new MyComponent("idForWicket");
> > component.setOutputMarkupId(true);
> >
> > As the result, the idForDesigner will be overriden with a new generated
> > value? Did I understood it right?
> >
> >
> >
> --
> View this message in context: 
> http://www.nabble.com/Question-about-OutputMarkupId-tf1883868.html#a5150652
> Sent from the Wicket - User forum at Nabble.com.
>
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-- 
Download Wicket 1.2 now! Write Ajax applications without touching JavaScript!
-- http://wicketframework.org

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to