Re: java wickets menu on image button
Hi, I'd suggest the following: - produce a normal with ExternalLink - add a special CSS class to all links you need to manipulate, e.g. class="toVerify" - in renderHead() do: response.render(OnDomReadyHeaderItem.forScript("$('.toVerify').each(checkLink)")) This will call checkLink(link) function for each one of those links Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Oct 13, 2016 at 11:13 AM, ASHU_JAVA <ashu@gmail.com> wrote: > Hi Martin, > > I tried adding following Javascript in HTML file like below:- > > > And modify the code in corresponding JAVA file:- > > > > > But I'm unable to get Javascript function trigger when the link is clicked. > > Can you please propose some suggestions. > Thanks in advance > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675754.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: java wickets menu on image button
Hi Martin, I tried adding following Javascript in HTML file like below:- And modify the code in corresponding JAVA file:- But I'm unable to get Javascript function trigger when the link is clicked. Can you please propose some suggestions. Thanks in advance -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675754.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: java wickets menu on image button
Hi, For this you will need to use Javascript. E.g. you can use jQuery#ajax() to make a HEAD request to the url. If it returns an error, then remove the "target" attribute and apply some JS to show a popover when the link is clicked. This is not Wicket related so you will have to use Google for more information. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Oct 11, 2016 at 7:56 PM, ASHU_JAVA <ashu@gmail.com> wrote: > Hi Martin, > > I've implemented the External Links as shown in below code > > > Can you please suggest how to provide a Pop-up if the External link doesn't > work i.e. if a link is clicked and the link is an invalid URL, it should > open a pop-up with error message instead of a new tab? > > Thanks in advance. > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675739.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: java wickets menu on image button
Hi Martin, I've implemented the External Links as shown in below code Can you please suggest how to provide a Pop-up if the External link doesn't work i.e. if a link is clicked and the link is an invalid URL, it should open a pop-up with error message instead of a new tab? Thanks in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675739.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: java wickets menu on image button
Hi, Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Sun, Oct 2, 2016 at 4:31 PM, ASHU_JAVA <ashu@gmail.com> wrote: > Hi Martin, > > Thanks a lot for your suggestion. > > My requirement is nearly complete, the only issue I'm facing right now is > *how to open the List link in new tab ?*. > Please find below my current code: > > /SamplePage.Java/ > add(new LinkPanel("navBar")); > > /SamplePage.html/ > > > /LinkPanel.Java/ > > > > /LinkPanel.html/ > > > > /style.css/ > > > > The output looks like below image: > <http://apache-wicket.1842946.n4.nabble.com/file/n4675620/Wicket_2.png> > > So, when I click on link it open in the same window. > > I tried to change the *"LinkPanel.java" *code as below:- > > The output now looks like below image: > <http://apache-wicket.1842946.n4.nabble.com/file/n4675620/Wicket_1.png> > > I'm able to now open the links in different tabs but the appearance is now > not in the list. > > I think if the LinkPanel.Java code can generate an HTML like below it will > become perfect according to my requirement:- > > > Kindly suggest inputs on how to achieve it in my current code. > Thanks in advance. > > > > > You need to add the dropdown to the element. > In the blog article you mentioned in your first email this is: class="dropdown" wicket:id="itemContainer"> > > The blog uses: > > <#> > ** > > > > > > > You need to remove * and use instead of . > In the Java code replace: > > itemContainer.add(new Label("label", currentMenuItem.getLabel())); > > with > > itemContainer.add(new ContextImage("img", ...)); > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675620.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: java wickets menu on image button
Hi Martin, Thanks a lot for your suggestion. My requirement is nearly complete, the only issue I'm facing right now is *how to open the List link in new tab ?*. Please find below my current code: /SamplePage.Java/ add(new LinkPanel("navBar")); /SamplePage.html/ /LinkPanel.Java/ /LinkPanel.html/ /style.css/ The output looks like below image: <http://apache-wicket.1842946.n4.nabble.com/file/n4675620/Wicket_2.png> So, when I click on link it open in the same window. I tried to change the *"LinkPanel.java" *code as below:- The output now looks like below image: <http://apache-wicket.1842946.n4.nabble.com/file/n4675620/Wicket_1.png> I'm able to now open the links in different tabs but the appearance is now not in the list. I think if the LinkPanel.Java code can generate an HTML like below it will become perfect according to my requirement:- Kindly suggest inputs on how to achieve it in my current code. Thanks in advance. You need to add the dropdown to the element. In the blog article you mentioned in your first email this is: The blog uses: <#> ** You need to remove * and use instead of . In the Java code replace: itemContainer.add(new Label("label", currentMenuItem.getLabel())); with itemContainer.add(new ContextImage("img", ...)); Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675620.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: java wickets menu on image button
You need to add the dropdown to the element. In the blog article you mentioned in your first email this is: The blog uses: You need to remove and use instead of . In the Java code replace: itemContainer.add(new Label("label", currentMenuItem.getLabel())); with itemContainer.add(new ContextImage("img", ...)); Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Sep 29, 2016 at 12:00 PM, ASHU_JAVA <ashu@gmail.com> wrote: > Hi Martin, > > Thanks for your response. > Please find below the JSFiddle URL of what I want to achieve in Java > Wickets. > JSFiddle Example <https://jsfiddle.net/ashu_mdu/xeg58nyo/> > > Kindly suggest solution to achieve this requirement. > Thanks in advance. > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675607.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: java wickets menu on image button
Hi Martin, Thanks for your response. Please find below the JSFiddle URL of what I want to achieve in Java Wickets. JSFiddle Example <https://jsfiddle.net/ashu_mdu/xeg58nyo/> Kindly suggest solution to achieve this requirement. Thanks in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675607.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: java wickets menu on image button
Hi, This is an image, not HTML. Wicket generates HTML, not images. I cannot help you unless you give me the HTML snippet you need to generate. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Sep 29, 2016 at 10:28 AM, ASHU_JAVA <ashu@gmail.com> wrote: > Hi Martin, > > Thanks for your response. I need to create the following kind of image > button. > > <http://apache-wicket.1842946.n4.nabble.com/file/n4675605/ > Image_Button_DropDown_Menu.png> > > On clicking this Image button, a dropdown should appear containing External > Links to other web applications. > > Kindly suggest solutions for this issue. > Thanks in advance. > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675605.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: java wickets menu on image button
Hi Martin, Thanks for your response. I need to create the following kind of image button. <http://apache-wicket.1842946.n4.nabble.com/file/n4675605/Image_Button_DropDown_Menu.png> On clicking this Image button, a dropdown should appear containing External Links to other web applications. Kindly suggest solutions for this issue. Thanks in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675605.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: java wickets menu on image button
Hi, I guess the problem you face is that ContextImage has no #add() method ? This is because cannot have children HTML elements. What is the HTML output you need to produce? Please create the plain HTML example at JSFiddle (https://jsfiddle.net/) and give us a link. I guess you need to add the dropdown to the link, not to the image. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Sep 29, 2016 at 8:23 AM, ASHU_JAVA <ashu@gmail.com> wrote: > I'm trying to create a image button. When this button clicked, a drop down > menu should appear with External Links to other websites. > > Till now, I've managed to create drop down menu with External links but on > navigation bar as provided in example: > http://tomaszdziurko.pl/2012/03/wicket-and-twitter-bootstrap-navbar/. > > HTML: > > Code: > public Builder withMenuItemAsDropdown(MenuItemEnum menuItem, String > pageToLink, String label) { > //BookmarkablePageLink link = new > BookmarkablePageLink("link", pageToLink); >ExternalLink linkExternal = new ExternalLink("link", pageToLink, > label); >linkExternal.setBody(new Model(label)); >linksMap2.put(menuItem, linkExternal); > > return this; > } > > And then in Base JAVA class: > add(new TwitterBootstrapNavBarPanel.Builder("navBar", HomePage.class, > "Example Web App", getActiveMenu()) > .withMenuItem(MenuItemEnum.CLIENTS, ClientsPage.class) > .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2, "Sample_URL", "Product > 1") > .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2, "Sample_URL", > "Product 2") > .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2, "Sample_URL", > "Product 3") >.build()); > > > Now to add a Image, I've added the code:- > > final ContextImage image=new ContextImage("image","IMAGE.png"); > ExternalLink link = new ExternalLink("link", "SAMPLE_URL"); > //Image image = new Image("img", new > SharedResourceReference(BasePage.class, > "/wicket-bootstrap/img/QuestionMark_2.png")); > link.add(image); > add(link); > > But I'm unable to add the drop down menu to this Image button. Kindly > suggest some inputs. > > Thanks in advance. > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/java-wickets-menu-on-image-button-tp4675602.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 > >
java wickets menu on image button
I'm trying to create a image button. When this button clicked, a drop down menu should appear with External Links to other websites. Till now, I've managed to create drop down menu with External links but on navigation bar as provided in example: http://tomaszdziurko.pl/2012/03/wicket-and-twitter-bootstrap-navbar/. HTML: Code: public Builder withMenuItemAsDropdown(MenuItemEnum menuItem, String pageToLink, String label) { //BookmarkablePageLink link = new BookmarkablePageLink("link", pageToLink); ExternalLink linkExternal = new ExternalLink("link", pageToLink, label); linkExternal.setBody(new Model(label)); linksMap2.put(menuItem, linkExternal); return this; } And then in Base JAVA class: add(new TwitterBootstrapNavBarPanel.Builder("navBar", HomePage.class, "Example Web App", getActiveMenu()) .withMenuItem(MenuItemEnum.CLIENTS, ClientsPage.class) .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2, "Sample_URL", "Product 1") .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2, "Sample_URL", "Product 2") .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2, "Sample_URL", "Product 3") .build()); Now to add a Image, I've added the code:- final ContextImage image=new ContextImage("image","IMAGE.png"); ExternalLink link = new ExternalLink("link", "SAMPLE_URL"); //Image image = new Image("img", new SharedResourceReference(BasePage.class, "/wicket-bootstrap/img/QuestionMark_2.png")); link.add(image); add(link); But I'm unable to add the drop down menu to this Image button. Kindly suggest some inputs. Thanks in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602.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