Ok, you have apoint there. Although you could insert a header contribution which makes the size of listview available to the javascript Or you could locate every html component who's id starts with a certain string.
> my suggesting would be to make that method final. No please don't make getMarkupId final (or atleast provide a setter), because although it might not be perfect in combination with repeaters. It is a livesafer in other situations. For instance i have this grid of textfields who have a top to bottom, left to right tab order. I also have to be able to navigate these textfields using the arrow keys. By including the x y coordinate in the html id this is easy. I could not have done that if i could not override the markup id, because not all of these components have the same component tree. Maurice On 7/22/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > and then in > > public void populateItem(Item item){ > > item.add(new MyLabel("label"+item.getIndex()); > > } > > > this wont work because then how do you reference the id in the markup?? > > > > The point is whoever builds the component might want to make it easier > > for user to use there component in repeaters but ultimatly it is up to > > the user who puts the component in the repeater to make sure it has a > > unique id for javascript. > > And lets not forget that not every component needs to have a javascript > id. > > > i think the point is that as the framework implementors we take care of this > plumbing detail for the user because we hve access to the most context. so > my suggesting would be to make that method final. > > -Igor > > > > > > > On 7/22/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > here is an example > > > > > > class MyLabel extends Label { > > > .... > > > > > > String getOutputMarkupId() { return "mylabelid"; } > > > } > > > > > > now if you put this label inside a listview you are screwed > > > > > > -Igor > > > > > > > > > > > > On 7/22/06, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > > > > > > 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 > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > 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