Actually i was talking about the index the repeater uses for all its
items. But maybe i am not getting something about those repeaters,
like i said i am not entirely sure we are talking about the same thing
here.
I am talking about RepeatingView and its subclasses.
So if you have a component who's getMarkupId is defined as return
getId(); Then all you have to do in the populate method is new
yourComponent("aName"+item.getId(),someModel);

Maurice


On 7/21/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> so you are talking about some static counter you keep in the class and
> assign to the instance? that really is the only way to guarantee the id be
> unique
>
>
> class Component {
> staic int counter=0;
>
> int idcounter=counter++;
>
> String getMarkupId() {
>    return
> getClass().getName().replaceAll(".","")+idcounter;
> }
>
> something like that might work i guess
>
>
> -Igor
>
>
>
> On 7/21/06, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> > I think Igor is talking about custom third party components here.
> >
> > I am not sure what you mean by repeater but i assume you mean
> > RepeatingView and those alike. anyway you still have to give a wicket
> > id to those components right? so why not include the index in the
> > wicket id and override getMarkupId to return just the id instead op
> > the full path. Besides if the vendor does not support it, the user
> > could always override getMarkupId again.
> >
> > And just to be sure, i am not talking about changing the behaviour of
> > getMarkupId in the core, just as something people could do to make the
> > whole javascript id easier.
> >
> > Maurice
> >
> > On 7/21/06, Johan Compagner <[EMAIL PROTECTED] > wrote:
> > > You can override getMarkupId()
> > > We (servoy) do that all the time with everything. Because we know the
> page
> > > and we know how to be sure that it is unqiue.
> > >
> > > still if we know that we are in a repeater we do append the index in
> front
> > > of it.
> > >
> > > johan
> > >
> > >
> > >
> > > On 7/21/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > >
> > > > and what if someone takes a component like that and puts it into a
> > > repeater? the component doesnt know its in a repeater so it will return
> the
> > > same id for all iterations. the path is the only way to insure the id is
> > > unique.
> > > >
> > > >
> > > > -Igor
> > > >
> > > >
> > > >
> > > >
> > > > On 7/21/06, Maurice Marrink < [EMAIL PROTECTED]> wrote:
> > > > > Just as another thought:
> > > > > Would it not be better for someone to override getMarkupId() and
> > > > > return whatever id he pleases. Surely you don't want to have to go
> > > > > through the html or javascript files when you add another
> > > > > WebMarkupContainer or Panel to your component hierarchy, as would be
> > > > > the case if you used the default implementation of getMarkupId().
> > > > >
> > > > > The only thing to remember is that all the id's have to be unique,
> > > > > which should not be such a big problem because you only have to
> > > > > overwrite getMarkupId for those components you reference through
> > > > > javascript. Even for list items this should be feasible by using
> there
> > > > > index.
> > > > >
> > > > > Just my 2 cents.
> > > > >
> > > > > Maurice
> > > > >
> > > > > On 7/21/06, Al Maw < [EMAIL PROTECTED]> wrote:
> > > > > > I don't think periods will work in IDs, surely?
> > > > > > They'd interfere with CSS syntax - would:
> > > > > >
> > > > > > #foo.bar { }
> > > > > >
> > > > > > ...refer to an element with id=" foo.bar" or an element with
> id="foo"
> > > and
> > > > > > class="bar" ?
> > > > > >
> > > > > > Hyphens probably aren't usable either. You can't use hyphens in
> your
> > > > > > class/field names, but I guess people might be using them in their
> > > > > > wicket:ids already.
> > > > > >
> > > > > > So how about using multiple chars for the separator? "-_-" or
> > > something,
> > > > > > and String#split() on that?
> > > > > >
> > > > > > Al
> > > > > >
> > > > > > Eelco Hillenius wrote:
> > > > > > > Yes, and also about a year ago we switched to _ for outputting
> as we
> > > > > > > had actual experience with javascript troubles. : is not a
> useable
> > > for
> > > > > > > external purposes.
> > > > > >
> > > > > > > On 7/21/06, Martijn Dashorst < [EMAIL PROTECTED]>
> wrote:
> > > > > > >> ID and NAME tokens must begin with a letter ([A-Za-z]) and may
> be
> > > > > > >> followed by any number of letters, digits ([0-9]), hyphens
> ("-"),
> > > > > > >> underscores ("_"), colons (":"), and periods (".").
> > > > > >
> > > > > > >> On 7/21/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
> > > > > > >>> is there a better seperator that can be used then?
> > > > > >
> > > > > >
> > > > > >
> > >
> -------------------------------------------------------------------------
> > > > > > Take Surveys. Earn Cash. Influence the Future of IT
> > > > > > Join SourceForge.net's Techsay panel and you'll get the chance to
> > > share your
> > > > > > opinions on IT & business topics through brief surveys -- and earn
> > > cash
> > > > > >
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > > > > _______________________________________________
> > > > > > Wicket-develop mailing list
> > > > > > Wicket-develop@lists.sourceforge.net
> > > > > >
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > >
> > > > >
> > > > >
> > >
> -------------------------------------------------------------------------
> > > > > Take Surveys. Earn Cash. Influence the Future of IT
> > > > > Join SourceForge.net's Techsay panel and you'll get the chance to
> share
> > > your
> > > > > opinions on IT & business topics through brief surveys -- and earn
> cash
> > > > >
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > > > _______________________________________________
> > > > > Wicket-develop mailing list
> > > > > Wicket-develop@lists.sourceforge.net
> > > > >
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > >
> > > >
> > > >
> > > >
> > >
> -------------------------------------------------------------------------
> > > > Take Surveys. Earn Cash. Influence the Future of IT
> > > > Join SourceForge.net's Techsay panel and you'll get the chance to
> share
> > > your
> > > > opinions on IT & business topics through brief surveys -- and earn
> cash
> > > >
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > >
> > > > _______________________________________________
> > > > Wicket-develop mailing list
> > > > Wicket-develop@lists.sourceforge.net
> > > >
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > >
> > > >
> > > >
> > >
> > >
> > >
> -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > > opinions on IT & business topics through brief surveys -- and earn cash
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > >
> > > _______________________________________________
> > > Wicket-develop mailing list
> > > Wicket-develop@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > >
> > >
> > >
> >
> >
> -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > opinions on IT & business topics through brief surveys -- and earn cash
> >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Wicket-develop mailing list
> > Wicket-develop@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Wicket-develop mailing list
> Wicket-develop@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to