Problem to replace panel
Hi, I have one wicket page containing two different panel. Based on the same event, these panels should be changed with new instances of the same panels. The methods that performs change of these panels are called after the same event. However, first panel is changed without a problem, but the second panel is created but it is not changed. I used the same approach to change both panels. Here is the code: public T extends UsedResourcesPanel void updateUsedResourcesPanel(ClassT clazz, AjaxRequestTarget target){ usedResourcesDiv=new WebMarkupContainer(urDIV); usedResourcesDiv.setOutputMarkupId(true); try { UsedResourcesPanel tempUsedResourcesPanel=UsedResourcesPanel.class.getConstructor(String.class,URI.class,String.class,TargetCompetence.class).newInstance(urPANEL,this.currGoalUri,this.currGoalType,this.currTargCompetence); tempUsedResourcesPanel.setOutputMarkupId(true); tempUsedResourcesPanel.setCompetenceTitle(currTargCompetence.getCompetence().getTitle()); usedResourcesPanel.replaceWith(tempUsedResourcesPanel); usedResourcesPanel=tempUsedResourcesPanel; target.addComponent(usedResourcesPanel); } catch (Exception e) { logger.error(e.getMessage(), e); throw new RestartResponseException(PLKMBasePage.class); } } Do you have any idea what is the problem here? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-to-replace-panel-tp2333462p2333462.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
PagingNavigator plain page numbers in links
Hi all, Looking for a way to render the page links in a PagingNavigator without any surrounding tags... Seems like the populateItem in the Loop that creates the page links always wants to insert a Label of some kind there ... Is there a way to get the markup to end up as 1 2 etc ... ?? Thanks! -Dennis -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PagingNavigator-plain-page-numbers-in-links-tp2333471p2333471.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
setRenderBodyOnly with ListView and attributes
hi, I want to have Wicket to generate the following HTML precisely: div class=products div class=product./div div class=product./div div class=product./div div class=product./div /div But with my code, I don't get further than: div div class=product./div div class=product./div div class=product./div div class=product./div /div so the class attribute is missing in the outer div. My Wicket HTML is: div class=products wicket:id=productsView div class=product wicket:id=productPanel./div /div My code: ListView productsView = new ListView(productsView, products) { protected void populateItem(ListItem item) { item.setRenderBodyOnly(true); item.add(new ProductPanel(productPanel, item.getModelObject())); } }; add(productsView); What is the Wicket way of achieving this? (A solution is to use the wicket:container tag, but that's a bit ugly, right?) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: setRenderBodyOnly with ListView and attributes
AttributeAppender class will help you to acheive that. -fmu - Original Message - From: J bluecar...@gmx.com To: users@wicket.apache.org Sent: Saturday, August 21, 2010 2:24 PM Subject: setRenderBodyOnly with ListView and attributes hi, I want to have Wicket to generate the following HTML precisely: div class=products div class=product./div div class=product./div div class=product./div div class=product./div /div But with my code, I don't get further than: div div class=product./div div class=product./div div class=product./div div class=product./div /div so the class attribute is missing in the outer div. My Wicket HTML is: div class=products wicket:id=productsView div class=product wicket:id=productPanel./div /div My code: ListView productsView = new ListView(productsView, products) { protected void populateItem(ListItem item) { item.setRenderBodyOnly(true); item.add(new ProductPanel(productPanel, item.getModelObject())); } }; add(productsView); What is the Wicket way of achieving this? (A solution is to use the wicket:container tag, but that's a bit ugly, right?) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: setRenderBodyOnly with ListView and attributes
Here is the complete (test) code SOLUTION 1 : wicket:container = TestPage.html html body div class=products wicket:container wicket:id=products div wicket:id=product class=product/div /wicket:container /div /body /html TestPage.java import java.util.Arrays; import java.util.List; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; public class TestPage extends WebPage { public TestPage() { List products = Arrays.asList(productA, productB, productC); ListView productsView = new ListView(products, products) { protected void populateItem(ListItem item) { String product = (String) item.getModelObject(); item.add(new Label(product, product)); } }; add(productsView); } } == SOLUTION 2 : extra div in WicketHTML == TestPage.html html body div class=products div wicket:id=products div wicket:id=product class=product/div /div /div /body /html TestPage.java import java.util.Arrays; import java.util.List; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; public class TestPage extends WebPage { public TestPage() { List products = Arrays.asList(productA, productB, productC); ListView productsView = new ListView(products, products) { protected void populateItem(ListItem item) { String product = (String) item.getModelObject(); item.add(new Label(product, product)); item.setRenderBodyOnly(true); } }; add(productsView); } } Wanted/Required and generated output of solution1 2 === html body div class=products div class=productproductA/div div class=productproductB/div div class=productproductC/div /div /body /html == For this common scenario: -solution 1 violates Wickets Just HTML philosophy in that the wicket:container tag is used. -solution 2 violates Wickets Just HTML philosophy in that an extra unwanted div is required in WicketHTML (although not visible in the generated HTML). No other solutions have been found/discussed yet. - Original Message - From: Fatih Mehmet UCAR Sent: 08/21/10 05:02 PM To: users@wicket.apache.org Subject: Re: setRenderBodyOnly with ListView and attributes send your html and java code, there may be other ways of doing this. - Original Message - From: J bluecar...@gmx.com To: users@wicket.apache.org Sent: Saturday, August 21, 2010 3:29 PM Subject: Re: setRenderBodyOnly with ListView and attributes I made a mistake in my first post. The output of wasn't: div div class=product./div div class=product./div div class=product./div div class=product./div /div but it was: div class=product./div div class=product./div div class=product./div div class=product./div So the outer div is missing. Which is caused by item.setRenderBodyOnly(true). But if I disable (set to false) this (the default), I get: div class=productsdiv class=product./div/div div class=productsdiv class=product./div/div div class=productsdiv class=product./div/div div class=productsdiv class=product./div/div which is even worse. A solution (the only?) to this double div problem and at the same time the missing attribute problem, is using wicket:container tags. (see http://apache-wicket.1842946.n4.nabble.com/Panel-in-List-remove-extra-div-td1877053.html ) This leads to this solution: div class=products wicket:container wicket:id=products div class=product wicket:id=productPanel./div /wicket:container /div Wicket:container tags make it ugly imo, because it violates wickts just HTML philosophy, even though my problem is a very common scenario. - Original Message - From: Fatih Mehmet UCAR Sent: 08/21/10 04:05 PM To: users@wicket.apache.org Subject: Re: setRenderBodyOnly with ListView and attributes Add another html div with css class you want around the below list div ; div class=products wicket:id=productsView and for the productsViev in the java code setRenderBodyOnly to true. -fmu - Original Message - From: J bluecar...@gmx.com To: users@wicket.apache.org Sent: Saturday, August 21, 2010 2:49 PM Subject: Re: setRenderBodyOnly with ListView and attributes It somehow feels bad/wrong to move CSS from WicketHTML to JavaCode, where it shouldn't belong, for such a common scenario. It defeats the purpose of having HTML in Wicket. But there probably is no other way. Anyway, thanks for your reply :) - Original Message - From: Fatih Mehmet UCAR Sent: 08/21/10
Re: Problem to replace panel
Can you see it in html with firebug? ** Martin 2010/8/21 zoran jeremy...@gmail.com: Wicket dialog first shows info about HTML code that indicates that this panel is created, than afterward, there is error line pointed out that setOutputMarkupId is not set to true. However, as you can see from my previous post, it is set to true. Here is the part of wicket debug message showing error: ERROR: Wicket.Ajax.Call.processComponent: Component with id [[usedResourcesPanel23]] a was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update. INFO: Channel busy - postponing... INFO: Response processed successfully. INFO: Invoking post-call handler(s)... INFO: Calling posponed function... INFO: INFO: Initiating Ajax GET request on ?wicket:interface=:0:contentDiv:contentPanel:competenceDiv:competencePanel::IActivePageBehaviorListener:2:-1wicket:ignoreIfNotActive=trueexpectedLevel=0random=0.0189175822560973 INFO: Invoking pre-call handler(s)... INFO: refocus last focused component not needed/allowed INFO: Received ajax response (69 characters) INFO: -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-to-replace-panel-tp2333462p2333598.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket + Eclipse + Tomcat
Hello, If you are ok with using Jetty then I think the jetty:run plugin is the best way. With the m2eclipse plugin (http://m2eclipse.sonatype.org/installing-m2eclipse.html) you are able to launch war artifacts directly in debug mode. Most dynamic stack replacements work and all that is needed typically is a page refresh (to instantiate the new class) versus having to redeploy the entire app. I've tried to get WTP to work with maven projects with little success but the m2eclipse and jetty:run has worked well for me for several years. If you have a project available with a pom.xml in it you can right click and 'enable maven dependency management' which will active the m2eclipse features for it. Regards, Mike Hi, the problem is that maven project layout is totally different as what Eclipse Web Project layout expect, therefore there are not compatible. If you want to use Wicket+Maven+Eclipse Debug , i suggest you to used the Wicket QuickStart as starting point or use the maven archetype:generate to select the wicket archetype. After doing so, do a mvn eclipse:eclipse and import it to your workspace, then look inside the src/test package a class name Start.java and do a Debug as that class that actually start an embedded jetty and you will be able to debug the application. if you want to use tomcat instead of jetty use the command mvn tomcat:run and set it up to listen for Remote Debugging. Check out this link for more detail: http://blog.kadirpekel.com/2009/11/09/debugging-through-maven-tomcat-plugin-by-eclipse/ On Sat, Aug 21, 2010 at 1:38 PM, Mike Dee [via Apache Wicket] ml-node+2333641-1697040112-65...@n4.nabble.comml-node%2b2333641-1697040112-65...@n4.nabble.com wrote: Get started with Wicket (again) and banging my head on Eclipse and Tomcat. What is a typical way to setup a project (in Eclipse) so that it is easy to test and develop (locally) in Tomcat? Here is what I've been trying. Install Eclipse with Tomcat integration. Works fine. I can build an Eclipse Dynamic Web App. Can write servlets and JSPs, and debugging and developing is easy via Eclipse's Run As Server command. Ideally, I'd like to manually setup an Eclipse project to work with Wicket. But, I don't know how to get the project structure right and have the class and HTML files copied into the resultant WAR. So, I use Maven to create a new web app: mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp and then generate Eclipse project files mvn eclipse:eclipse Then I import the project into Eclipse. Problem is that the project appears to be a Java project and not a webapp. There is no Run As Server command. Head hurts from the banging. What am I doing wrong? Mike -- View message @ http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2333641.html To unsubscribe from Apache Wicket, click herehttp://apache-wicket.1842946.n4.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem to replace panel
Can you make a wicket quickstart that repeats the problem? ** Martin 2010/8/21 zoran jeremy...@gmail.com: Yes. Everything looks fine. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-to-replace-panel-tp2333462p2333782.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org