help with drag and drop (wicket-dnd)
I would like to use drag and drop functions in my wicket application. Into my pom.xml I add: wicket-dnd (http://code.google.com/p/wicket-dnd/) But my code do not work. Could you help me, please? I have got table. In the first cell ("td") is "span" element. I want this "span" drag and drop into another cell ("td") in the table. Thanks for help. WebMarkupContainer container = new WebMarkupContainer("container"); Model model = Model.of(new String("AAA")); container.add(new DragSource(Operation.values()) { public void onAfterDrop(AjaxRequestTarget target, Transfer transfer) { System.out.println("A"); } }.drag("span")); container.add(new DropTarget(Operation.values()) { public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location) { // add transfer data System.out.println(""); } }.dropCenter("td")); Label label = new Label("aaa", model); label.setOutputMarkupId(true); container.add(label); add(container); and HTML: www aaa aaa -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422338.html Sent from the Users forum 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
Re: help with drag and drop (wicket-dnd)
Thanks for answer. Yes, in the first "td" is "span" but in this forum it was formatted and span was not visible. The first td should be: < span wicket:id="aaa" class="aaa">www -- But I make little modification and html is: < span wicket:id="aaa" class="aaa">aaa < span wicket:id="bbb" class="bbb">bbb < span wicket:id="ccc" class="ccc">ccc And in java class was added: Label bbb = new Label("bbb", "bbb"); Label ccc = new Label("ccc", "ccc"); bbb.setOutputMarkupId(true); ccc.setOutputMarkupId(true); container.add(bbb); container.add(ccc); But in the methods is transfer.getData() allways NULL. What should be in transfer? The target element? Is there any way how to know what element was targeted (drop)? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422742.html Sent from the Users forum 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
Re: help with drag and drop (wicket-dnd)
yes it is valid and the html is: < span wicket:id="aaa" class="aaa">aaa< /span> < span wicket:id="bbb" class="bbb">bbb< /span> < span wicket:id="ccc" class="ccc">ccc< /span> -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4422835.html Sent from the Users forum 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
Re: help with drag and drop (wicket-dnd)
Thanks. So what should be in method DragSource#onBeforeDrop()? I should set there transfer data: transfer.setData(drag); ? I have Wicket 1.5.4 and wicket-dnd 0.5.0. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4423719.html Sent from the Users forum 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
Re: help with drag and drop (wicket-dnd)
Thank you. I look at example of ExampleLabel. But it do not help so much Now, I can drag element, I see that it was dragged and I can drop it on element, that is allowed by "}.dropCenter("span"));" Methods "onDrop" (in DropTarget) and "onAfterDrop" (in DragSource) are called. I use there code, that is in ExampleLabel. But the dragged element is not moved and it stay on original place. What I have to do for moving dragged element? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4425523.html Sent from the Users forum 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
Re: help with drag and drop (wicket-dnd)
So I cannot modify html? Make html from this (it is without attributes): < table>< tr> < td>< span>AAA< /span>< /td> < td>< /td> < /tr>< /table> to this (span from first "td" was moved to second "td"): < table>< tr> < td>< /td> < td>< span>AAA< /span>< /td> < /tr>< /table> But, when i want to move content of first td to second td, I have to do something like this: < table>< tr> < td>< span>AAA< /span>< /td> < td>< span>< /span>< /td> < /tr>< /table> And in onDrop method change model of first span and second span element? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4425713.html Sent from the Users forum 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
more html templates for one java class
Hello, is it possible to have more than one HTML template for java class, that have got extend Page? I would like to have two variants of HTML. - one with TABLE, in which are putted data - second with DIVs, in which are data Is it possible to set which HTML page have to be used? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/more-html-templates-for-one-java-class-tp4430757p4430757.html Sent from the Users forum 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
Re: more html templates for one java class
Thanks. I have: MyPanel.java (this class extends Panel), MyPanel.html and MyPanel_test.html. I try in MyPanel.java add method: @Override public String getVariation() { return "test"; } It is good, is not it? But it do not work. Is not there in wicket 1.5.4 same kind of bug with getVariation: https://issues.apache.org/jira/browse/WICKET-4361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#issue-tabs -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-more-html-templates-for-one-java-class-tp4430757p4431001.html Sent from the Users forum 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
Re: more html templates for one java class
Thanks. But it still seems that getVariable do not work. But getSession().setStyle("test"); in constructor works. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-more-html-templates-for-one-java-class-tp4430757p4431115.html Sent from the Users forum 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
wicket - check if user is logged (call method in every access to server)
Hello, is there any way how to check if user is logged? I can put into constructor of the class that have got "extends Page" something like this: if (new LogginControl().isUserLogged(user)) { ... } But this code I have to put into methods, that are called by ajax. So, is there any better way? How to call same code and check if user is logged in every access to server? And then redirect to homepage if user is not logged. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-check-if-user-is-logged-call-method-in-every-access-to-server-tp4431837p4431837.html Sent from the Users forum 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
Re: wicket - check if user is logged (call method in every access to server)
Thanks for help. I try it and I create annotations for classes, that can reject access for user without permissions and user is redirected to LoginPage. But I do not know if it is possible create annotation for methods. If I click on ajax link, same ajax method is called. It is possible to create annotation for the method? To reject access to method and method do not be executed and user will be redirected to LoginPage? How can create it? How it will be register in my application? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-check-if-user-is-logged-call-method-in-every-access-to-server-tp4431837p4435542.html Sent from the Users forum 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
refresh component
Hello, I have got span element () with text and I would like to refresh this span when I click on ajaxlink. It is possible? How can refresh only this span element. The ajaxlink is not connect with this span element. These are two different elements in page. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/refresh-component-tp4480640p4480640.html Sent from the Users forum 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
mouseover in wicket
Hello, is possible to create mouseover and show tooltip (wicket panel with html) when I move cursor over html element/text/link. Is there any way how to do it in wicket? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/mouseover-in-wicket-tp4501543p4501543.html Sent from the Users forum 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
Re: mouseover in wicket
Thanks. I try "jwicket-tooltip", but it seems that it do not work with wicket 1.5.4. Visural wicket works, but I can not use ajax. When I move cursor over same element, I would like to call same method, that create tooltip. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/mouseover-in-wicket-tp4501543p4502804.html Sent from the Users forum 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
radiobuttons in DataView column
Hello, I have got DataView and in one column are readiobuttons. I create list with items and one of them have got boolean=true. But in DataView on the page I cannot see checked radiobutton. Can you help me, hot to use radiobuttons in DataView? Thanks. A have got list: and RadioGroup and DataView: and HTML: -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/radiobuttons-in-DataView-column-tp4650018.html Sent from the Users forum 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
Re: radiobuttons in DataView column
Thanks. I look at this, I try my code little chage, but it still doesn't work and I cannot see what is wrong in my code. When I come to page, one of radiobuttons should be selected. But no one is selected. I suppose, it could take value for radiobutton from model. But it does not take... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/radiobuttons-in-DataView-column-tp4650018p4650020.html Sent from the Users forum 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
Re: radiobuttons in DataView column
Thanks for help. It works :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/radiobuttons-in-DataView-column-tp4650018p4650043.html Sent from the Users forum 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
onSelectionChanged without refreshing page
Hello, is possible to execute some code when I change selected item in DropDownChoice without refreshing page? In onSelectionChanged method I would like to save information that new item was selected and value of new selected item. But when I use code below, it refresh page. It is possible without refreshing page? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onSelectionChanged-without-refreshing-page-tp4650044.html Sent from the Users forum 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
modify Date in model from 3 inputs?
Hi, I have got 3 html elements: day, month, year. In model class I have got attribute "java.util.Date sameDate;". This date should be created from elements day, month, year. I would like to ask, if there is possible: when I change input or select, I want to change Date in model. Is it possible? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/modify-Date-in-model-from-3-inputs-tp4650220.html Sent from the Users forum 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
how to connect elements - label and input (checkbox)
Hi, is there any easy way, how can I connect label and input(checkbox) in repeater? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-connect-elements-label-and-input-checkbox-tp4650304.html Sent from the Users forum 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
Re: modify Date in model from 3 inputs?
Hi, I look at TimeField. But there is only override one method (convertInput). So, I try it, but it do not help. How can I display in TextField only day? And When I change this number how to change day in Date? How to create model and how to create TextField? Can you help me. Or is there any example of similar problem? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/modify-Date-in-model-from-3-inputs-tp4650220p4650305.html Sent from the Users forum 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
Re: how to connect elements - label and input (checkbox)
Hi, when I click on text in element, it select or unselect checkbox. But I need to set attribute "for" in label and attribute "id" in checkbox input. I use it in repeater. So I have to generate random text for this attributes. Is there any better way how to do it? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-connect-elements-label-and-input-checkbox-tp4650304p4650308.html Sent from the Users forum 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
set html for Panel
Hi, is possible to set html file for Panel? When I have MyPanel.java, it render MyPanel.html and I would like to render sometimes MyPanel.html and sometimes MyPanel2.html. Is it possible? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/set-html-for-Panel-tp4650316.html Sent from the Users forum 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
chekbox - allow only 5 selected
Hi, I have CheckGroup group = new CheckGroup("usersGroup", list); and in repeater I add checkbox: item.add(new Check("checkboxUser", group)); I have got 20 checkboxes, but I want to allow only 5 checkboxes select. When will be selected more than 5 checkboxes, it shows error (in feedback). I want to check this when the checkbox is selected (not after submitting form). Could help me, how can I do it? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/chekbox-allow-only-5-selected-tp4650340.html Sent from the Users forum 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
wicket and using @SpringBean annotation
Hi, could you help me, what I need for using @SpringBean annnotation? In pom.xml I have got: And in WicketApplication class: But I cannot run the application: [ERROR] FATAL ERROR [INFO] [INFO] org/springframework/web/context/ConfigurableWebApplicationContext org.springframework.web.context.ConfigurableWebApplicationContext [INFO] [INFO] Trace java.lang.NoClassDefFoundError: org/springframework/web/context/ConfigurableWebApplicationContext at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404) at java.lang.Class.getConstructor0(Class.java:2714) at java.lang.Class.newInstance0(Class.java:343) What else I need to do? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-and-using-SpringBean-annotation-tp4650375.html Sent from the Users forum 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
Re: wicket and using @SpringBean annotation
Thanks. I had not spring-web in classpath, so I add it into pom.xml and now it works. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-and-using-SpringBean-annotation-tp4650375p4650377.html Sent from the Users forum 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
redirectToInterceptPage and string
Hi, is possible to redirect page like this: redirectToInterceptPage("myPage.html") ? I can do it: redirectToInterceptPage(new MyPage()); But I know only "myPage.html" and I do not know what Page class it is. So is it any way how to use string and redirectToInterceptPage? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/redirectToInterceptPage-and-string-tp4651417.html Sent from the Users forum 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