Would this solution work better for you? <body> <wicket:extend> <div id="projects-panel"> <div wicket:id="projects-panel"></div> </div> <div id="agents-panel"> <div wicket:id="agents-panel"></div> </div> <div id="builds-panel"> <div wicket:id="builds-panel" /> <div> </wicket:extend> </body>
Xavier Hanin wrote: > > On 5/10/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: >> >> On 5/10/07, Bernatet Mathieu <[EMAIL PROTECTED]> wrote: >> > >> > 2007/5/10, Matej Knopp <[EMAIL PROTECTED]>: >> > > Right now, when you set outputmarkupid on component wicket doesn't >> > > honor the id specified in markup. One of the reasons is that when you >> > > use the component twice, the id is no longer unique. >> > >> > I understand that if the id is specified in the panel markup >> > (ViewPanel.html) , but it is not the case here. >> >> >> it might not be the case, but how is wicket supposed to know that? also >> what if you put that component into a repeater? it will also have non >> unique >> ids. i think there are so many different ways to break this that i always >> advocated of never honoring markup's id attr if setoutputmarkupid is >> called. >> but thats just me. >> > > So what is the recommended best practice: ask web designers to use class > instead of ids on dynamic components (maybe not always possible), or > encapsulate a dynamic component in a static one with an id under control > of > the web designer? > > Xavier > > -igor >> >> >> > In you case I >> > > suggest you use css class instead of id to assign stylesheet to your >> > > elements. >> > >> > ok, I didn't use a class attribute for my div so I can use it now. >> > Thanks >> > >> > Mathieu >> > >> > > -Matej >> > > >> > > On 5/10/07, Bernatet Mathieu < [EMAIL PROTECTED]> wrote: >> > > > Hi, >> > > > >> > > > I try to apply css style on several div but wicket changes their id >> > > > attributes defined in the html file. >> > > > I have 3 custom panels that contain a DataView and I want to >> refresh >> > >> > > > them with ajax, so I make a call to setOutputMarkupId() method. >> This >> > > > call changes the id defined in html file. >> > > > I add an AttributeModifier to force the use of the defined id, that >> > > > works but now ajax refresh don't work. >> > > > What I'm doing wrong? >> > > > >> > > > code: >> > > > >> > > > dashboard.html: >> > > > >> > > > ... >> > > > <body> >> > > > <wicket:extend> >> > > > <div wicket:id="projects-panel" id="projects-panel" >> > /> >> > > > <div wicket:id="agents-panel" id="agents-panel" /> >> > > > <div wicket:id="builds-panel" id="builds-panel" /> >> > > > </wicket:extend> >> > > > </body> >> > > > --------------------------- >> > > > >> > > > viewPanel.html: >> > > > >> > > > <wicket:panel> >> > > > <wicket:child /> >> > > > > class="navigator">[agents navigator] >> > > > </wicket:panel> >> > > > ---------------------------- >> > > > >> > > > ViewPanel.java: >> > > > >> > > > public class ViewPanel extends Panel { >> > > > private static final long serialVersionUID = 1L; >> > > > >> > > > public ViewPanel(String id, DataView dataView, int >> > itemsPerPage) { >> > > > super(id); >> > > > setOutputMarkupId(true); >> > > > add(dataView); >> > > > dataView.setItemsPerPage(itemsPerPage); >> > > > add(new AttributeModifier("id", true, new >> > Model(id))); >> > > > add(new FancyPagingNavigator("navigator", >> > dataView)); >> > > > } >> > > > } >> > > > ------------------------- >> > > > >> > > > Dashboard.java : >> > > > >> > > > public class Dashboard extends WebPage { >> > > > public Dashboard() { >> > > > ... >> > > > add(new ProjectsPanel("projects-panel", projects, >> > 5)); >> > > > add(new AgentsPanel("agents-panel", scheduler, 5)); >> > > > add(new QueuePanel("builds-panel", scheduler, 5)); >> > > > } >> > > > } >> > > > >> > > > Mathieu >> > > > >> > > > >> > >> ------------------------------------------------------------------------- >> > > > This SF.net email is sponsored by DB2 Express >> > > > Download DB2 Express C - the FREE version of DB2 express and take >> > > > control of your XML. No limits. Just data. Click to get it now. >> > > > http://sourceforge.net/powerbar/db2/ >> > > > _______________________________________________ >> > > > Wicket-user mailing list >> > > > Wicket-user@lists.sourceforge.net >> > > > https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > > >> > > >> > > >> > >> ------------------------------------------------------------------------- >> > > This SF.net email is sponsored by DB2 Express >> > > Download DB2 Express C - the FREE version of DB2 express and take >> > > control of your XML. No limits. Just data. Click to get it now. >> > > http://sourceforge.net/powerbar/db2/ >> > > _______________________________________________ >> > > Wicket-user mailing list >> > > Wicket-user@lists.sourceforge.net >> > > https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > >> > >> > >> > >> ------------------------------------------------------------------------- >> > This SF.net email is sponsored by DB2 Express >> > Download DB2 Express C - the FREE version of DB2 express and take >> > control of your XML. No limits. Just data. Click to get it now. >> > http://sourceforge.net/powerbar/db2/ >> > _______________________________________________ >> > Wicket-user mailing list >> > Wicket-user@lists.sourceforge.net >> > https://lists.sourceforge.net/lists/listinfo/wicket-user >> > >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Wicket-user mailing list >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> >> > > > -- > Xavier Hanin - Independent Java Consultant > Manage your dependencies with Ivy! > http://incubator.apache.org/ivy/ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/div-id-problem-tf3721572.html#a10419767 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user