Re: Overriding wicket-ajax-jquery.js
What's happening now is the custom js is being loaded first hence i am getting reference error. Is there a way that the ajax js gets loaded after wicket's jquery and event js? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672080.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: Overriding wicket-ajax-jquery.js
We don't have time to upgrade and do a full cycle of testing of the entire application again :( -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672062.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: Overriding wicket-ajax-jquery.js
not working. I added alerts inside the method to see if it gets called, but in vein. I hope my changes are correct, here's what i changed: Wicket.Event.add(window, "unload", function() { var WTH = Wicket.TimerHandles; if (WTH) { for (var th in WTH) { if (WTH.hasOwnProperty(th)) { window.clearTimeout(WTH[th]); delete WTH[th]; } } } }); Only changes is the event from beforeunload to unload. I hope i am doing it correctly. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672060.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: Overriding wicket-ajax-jquery.js
so, call timer.stop() before download finishes? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672071.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: Overriding wicket-ajax-jquery.js
The counter doesn't stop now, but i can see javascript errors in firebug: ReferenceError: Wicket is not defined Wicket.Class = { , TypeError: Wicket.Throttler is not a constructor throttler: new Wicket.Throttler(true), & TypeError: Wicket.Ajax.DebugWindow is undefined Wicket.Ajax.DebugWindow.enabled=true; Here's my HTML from view page source: I have included as well because it didn't work without it (counter doesn't increment & i get same javascript errors in firebug). -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672073.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: Overriding wicket-ajax-jquery.js
I dont see setWicketJQueryReference, but there is setJQueryReference. I hope you meant setJQueryReference only :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672070.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: Overriding wicket-ajax-jquery.js
This is what i get from view page source. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672067.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: Overriding wicket-ajax-jquery.js
The problem is we have to deliver tomorrow and the application is BIG, so testing it wont be possible and we wont get a go ahead. is there any alternative apart from upgrade (even a dirty one would do for time being). -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672064.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: Overriding wicket-ajax-jquery.js
or may be if there is a way to discard wicket-ajax-jquery.js used by wicket and use a duplicate (with the unload event)? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672066.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
Overriding wicket-ajax-jquery.js
Hi, I am using AjaxSelfUpdatingTimerBehavior in my application which is for session timeout kinda functionality. Also i have a Download functionality using DownloadLink. The AjaxSelfUpdatingTimerBehavior doesnt work after i download a file. I saw a JIRA created for similar issue: https://issues.apache.org/jira/browse/WICKET-5822 I am using wicket 6.19.0 I saw the changelog and there was some change from changing the event from beforeunload to unload. Now, can i just make this change in the wicket-ajax-jquery.js and use it somehow for my project? I am in the middle of a release and cannot upgrade to wicket7 at the moment. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051.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: Overriding wicket-ajax-jquery.js
I am not too good with Javascript. What i did is made a duplicate file locally for wicket-ajax-jquery.js and modified "beforeunload" to "unload". Imported this duplicate file at the end (just before the Head tag closes). But it doesn't work. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-wicket-ajax-jquery-js-tp4672051p4672056.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
Adding Document title in the titlebar instead of filename
I would like to know whether its possible to use the document title in the titlebar when the PDF is opened instead of the filename appearing in it? If yes, then how to achieve it? Here's the code i tried & it shows list.pdf in the titlebar of the PDF reader (Adobe) instead of the document's title. import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import com.itextpdf.text.Chunk; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Font; import com.itextpdf.text.FontFactory; import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.BaseFont; import com.itextpdf.text.pdf.ICC_Profile; import com.itextpdf.text.pdf.PdfAConformanceLevel; import com.itextpdf.text.pdf.PdfAWriter; import com.itextpdf.text.pdf.PdfAction; import com.itextpdf.text.pdf.PdfAnnotation; import com.itextpdf.text.pdf.PdfBorderDictionary; import com.itextpdf.text.pdf.PdfName; import com.itextpdf.text.xml.xmp.DublinCoreProperties; import com.itextpdf.text.xml.xmp.PdfProperties; import com.itextpdf.text.xml.xmp.XmpWriter; import com.itextpdf.xmp.XMPException; public class TitleTest { public static void main(String[] args) throws IOException, DocumentException, XMPException { Document document = new Document(); PdfAWriter writer = PdfAWriter.getInstance(document, new FileOutputStream("list.pdf"), PdfAConformanceLevel.PDF_A_1A); writer.setViewerPreferences(PdfAWriter.PageModeUseOutlines); writer.setRunDirection(PdfAWriter.RUN_DIRECTION_LTR); writer.setTagged(PdfAWriter.markAll); writer.createXmpMetadata(); XmpWriter xmp = writer.getXmpWriter(); DublinCoreProperties.addSubject(xmp.getXmpMeta(), "Subject"); DublinCoreProperties.setTitle(xmp.getXmpMeta(), "Title", "en_US", "en_US"); DublinCoreProperties.setDescription(xmp.getXmpMeta(), "Description", "en_US", "en_US"); PdfProperties.setKeywords(xmp.getXmpMeta(), "Keywords"); PdfProperties.setVersion(xmp.getXmpMeta(), "1.4"); document.addTitle("Title"); document.addLanguage("en_US"); document.open(); Font font1 = FontFactory.getFont("ROsanswebtextregular.ttf", BaseFont.WINANSI, BaseFont.EMBEDDED, 12); ICC_Profile icc = ICC_Profile.getInstance(new FileInputStream("sRGB Color Space Profile.icm")); writer.setOutputIntents("Custom", "", "http://www.color.org;, "sRGB IEC61966-2.1", icc); Chunk c = new Chunk("Google", font1); PdfAction action = new PdfAction("https://google.com;); PdfAnnotation annotation = PdfAnnotation.createLink( writer, new Rectangle(0 ,0), PdfName.HIGHLIGHT, action); annotation.put(PdfName.CONTENTS, PdfName.TEXT); annotation.setBorderStyle(new PdfBorderDictionary(0, PdfBorderDictionary.STYLE_BEVELED)); c.setAnnotation(annotation); document.add(c); document.close(); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-Document-title-in-the-titlebar-instead-of-filename-tp4671906.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: Adding Document title in the titlebar instead of filename
Extremely Sorry. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-Document-title-in-the-titlebar-instead-of-filename-tp4671906p4671908.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: onBeforeRender getting called twice
Yes, It is getting called twice. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onBeforeRender-getting-called-twice-tp4671575p4671577.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
onBeforeRender getting called twice
Hi, I am experiencing a weird scenario wherein the onBeforeRender method gets called twice (request is coming as a HTTP request via a standalone API through webService). I am using a Wizard. Same code is used in regular application as well which works without a problem. What could be a possible issue here? I've checked in firebug and i dont see multiple calls to server from browser. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onBeforeRender-getting-called-twice-tp4671575.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: onBeforeRender getting called twice
Is there a way to check why it is being called twice? Or from where the second call is being made? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onBeforeRender-getting-called-twice-tp4671575p4671579.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: Change state of component after page rendering
Tried it...but did not work. It still didn't load the javascript file. Can you give an example if you have of such an implementation? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-state-of-component-after-page-rendering-tp4670900p4670964.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: Change state of component after page rendering
Ernesto, I have a javascript file which is not loaded if the component is not visible. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-state-of-component-after-page-rendering-tp4670900p4670904.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: Change state of component after page rendering
Its a div that i am toggling, so i dont feel it'll break the application behavior. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-state-of-component-after-page-rendering-tp4670900p4670905.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: Change state of component after page rendering
Hi Ernesto, Cant i toggle the visibility after page load? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-state-of-component-after-page-rendering-tp4670900p4670908.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
Change state of component after page rendering
Hi, Is it possible to change the visibility of a component after page is rendered? Like when the page is loaded. I tried with: @Override public void onAfterRender(){ super.onAfterRender(); this.myComponent.setVisible(false); this.add(this.myComponent); } but i get an error: org.apache.wicket.WicketRuntimeException: Cannot modify component hierarchy after render phase has started (page version cant change then anymore) any workaround? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-state-of-component-after-page-rendering-tp4670900.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: Change state of component after page rendering
I have to show the datepicker inside a modal window. The modal window is hidden by default unless someone clicks on the link which makes the modal window visible. Because of the initial invisibility the javascript file doesnt load and that in turn makes the datepicker functionality to not work. There is some code written inside the javascript file that adds few html divs in the parent html structure for datepicker icon etc. The only solution i can think of is to refresh the page after the modal window becomes visible (which i feel is not the correct thing to do, but it works, after the refresh the datepicker javascript gets loaded and the functionality works as expected). Is there a work around for achieving something like this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-state-of-component-after-page-rendering-tp4670900p4670913.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: Change state of component after page rendering
I am not using Wicket's ModalWindow implementaion. I have written a custom div based implementation. You can find the here: http://apache-wicket.1842946.n4.nabble.com/Loading-Javascript-for-wicket-component-tp4670871p4670875.html -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-state-of-component-after-page-rendering-tp4670900p4670916.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: Change state of component after page rendering
Hi Ernesto, http://apache-wicket.1842946.n4.nabble.com/Loading-Javascript-for-wicket-component-td4670871.html Please have a look at this issue. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Change-state-of-component-after-page-rendering-tp4670900p4670911.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
Loading Javascript for wicket component
Hi, I am using a custom .js file as a datepicker. the datepicket is visible when i click on the edit button. what happens is the datepicker icon doesnt show up after clicking on edit button. but if i refresh the page the icon shows up. What could possibly the issue and resolution for such behavior? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Loading-Javascript-for-wicket-component-tp4670871.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: Loading Javascript for wicket component
Modal Window Java code: package com.mycompany; import java.text.SimpleDateFormat; import org.apache.wicket.ajax.AjaxEventBehavior; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.form.RadioChoice; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.Model; public class DateChangeModalWindow extends Panel{ private static final long serialVersionUID = 1L; private final AjaxFallbackLink cancel; private final AjaxFallbackLink confirm; private TextField fromDate; private TextField toDate; private RadioChoiceString endDateOption; private RadioChoiceString untilFurtherNotice; private WebMarkupContainer untilFurtherNoticeTD; private final SimpleDateFormat dateFormatter = new SimpleDateFormat(dd-MM-); public DateChangeModalWindow(final String id) { super(id); this.setOutputMarkupPlaceholderTag(true); this.setVisible(false); this.fromDate = new TextField(fromDate, Model.of()); this.toDate = new TextField(toDate, Model.of()); this.fromDate.setOutputMarkupPlaceholderTag(true); this.toDate.setOutputMarkupPlaceholderTag(true); this.endDateOption = new RadioChoiceString(endDateOption); this.untilFurtherNotice = new RadioChoiceString(untilFurtherNotice); this.endDateOption.setOutputMarkupPlaceholderTag(true); this.untilFurtherNotice.setOutputMarkupPlaceholderTag(true); this.untilFurtherNoticeTD = new WebMarkupContainer(untilFurtherNoticeTD); this.untilFurtherNoticeTD.setOutputMarkupPlaceholderTag(true); this.cancel = new AjaxFallbackLink(cancel) { @Override public void onClick(AjaxRequestTarget target) { this.getParent().setVisible(false); if(target != null){ target.add(this.getParent()); } } }; this.confirm = new AjaxFallbackLink(confirm) { @Override public void onClick(AjaxRequestTarget target) { //do something once confirmed } }; this.add(this.cancel); this.add(this.confirm); this.add(this.fromDate); this.add(this.toDate); this.add(this.endDateOption); this.untilFurtherNoticeTD.add(this.untilFurtherNotice); this.add(this.untilFurtherNoticeTD); } public void setModelObject(final ModelObject modelObject){ this.fromDate.setDefaultModelObject(dateFormatter.format(modelObject.getBegindatum())); if(modelObject.getEinddatum() != null){ this.toDate.setDefaultModelObject(dateFormatter.format(modelObject.getEinddatum())); } if(modelObject.getBegindatum().before(DateUtil.getNow())){ fromDate.setEnabled(false); }else{ fromDate.setEnabled(true); } this.untilFurtherNotice.add(new AjaxEventBehavior(onClick){ @Override protected void onEvent(AjaxRequestTarget target) { toDate.setDefaultModelObject(); toDate.setEnabled(false); target.add(toDate); } }); if(modelObject.getEinddatum() != null){ this.endDateOption.setVisible(false); this.untilFurtherNoticeTD.setVisible(false); }else{ this.endDateOption.setVisible(true); this.untilFurtherNoticeTD.setVisible(true); } this.endDateOption.add(new AjaxEventBehavior(onClick){ @Override protected void onEvent(AjaxRequestTarget target) { toDate.setEnabled(true); target.add(toDate); } }); } } Modal Window HTML Code: Call for Modal Window: final DateChangeModalWindow dateChangeModalWindow = new DateChangeModalWindow(dateChangeModalWindow, this); add(dateChangeModalWindow); add(new AjaxFallbackLink(modalWindow) { @Override
Re: Loading Javascript for wicket component
The entire code written in javascript and it works. If i just keep the HTML pages then it loads the datepicker at startup but in my case the datpicker.js is not being picked up when the modal window opens...if i refresh the page then it gets loaded and everything works fine after that. So, is there a way to ensure that the javascript file gets loaded when the modal window opens? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Loading-Javascript-for-wicket-component-tp4670871p4670879.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: Loading Javascript for wicket component
Martin, i get your point. But would this work if my .js file is not being loaded unless i refresh? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Loading-Javascript-for-wicket-component-tp4670871p4670881.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: Loading Javascript for wicket component
file uploaded. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Loading-Javascript-for-wicket-component-tp4670871p4670883.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: Loading Javascript for wicket component
DatePicker javascript this is what i have. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Loading-Javascript-for-wicket-component-tp4670871p4670885.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: anchor tag for a dynamic text
i did something like this: Message in the properties file -- 123= Here's the link!! //get message from properties file String someTextMessage = getMessage(123); Lable message = new Lable(messageLable, someTextMessage); message.setEscapeModelStrings(true); Link printLink = new Link(printLink) { @Override public void onClick() { System.out.println(inside onClick); } }; this.add(printLink); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190p4670196.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: anchor tag for a dynamic text
Actual text message is something like this: -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190p4670199.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
anchor tag for a dynamic text
Hi, i would like to know if its possible to have a clickable link for a dynamic text. I have tried by using the anchor tag with some wicket id and adding an onclick behavior to it, i could see the text with link on my screen but the onclick call of t he link was never triggered. What could possibly be the issue? i did something like this: Message in the properties file -- 123= Here's the link!! i used this wicket id and added it to the page and attached an onclick behavior to this. I have checked t he firebug console but there was no onclick call made for the link's click. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190.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: Issues with multiple FeedbackPanels
Thsnk. That worked. Now have a different problem. I have an AjaxLink on its click based on some conditioned i have to show same message using feedbackMessage. if(session.getMyList().size() == 0){ myListView.getFeedbackMessages().clear(); myListView.info(funcMeldingen.getMessage(2584)); } I am doing this in my code but the message doesnt show up on the screen. call goes inside the if condition. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Issues-with-multiple-FeedbackPanels-tp4670087p4670104.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
Issues with multiple FeedbackPanels
Hi, I have 2 FeedbackPanels on my screen and whenever i try to set error it gets added to both the FeedbackPanels. final FeedbackPanel panel1 = new FeedbackPanel(panel1); final FeedbackPanel panel2 = new FeedbackPanel(panel2); //vdp gdp are some dataproviders i have if (vdp.hasError()){ toonMeer.setVisible(false); vertegenwoordigdeMelding.error(this.funcMeldingen.getMessage(vdp.getErrorcode())); vertegenwoordigdeMelding.add(new AttributeModifier(style, color:red)); vertegenwoordigdeMelding.setVisible(true); }else if((int)vdp.size() == 0){ vertegenwoordigdeMelding.info(U bent door niemand vertegenwoordigde); vertegenwoordigdeMelding.add(new AttributeModifier(style, )); vertegenwoordigdeMelding.setVisible(true); } if (gdp.hasError()){ toonMeer2.setVisible(false); gemachtigdeMelding.error(this.funcMeldingen.getMessage(gdp.getErrorcode())); gemachtigdeMelding.add(new AttributeModifier(style, color:red)); gemachtigdeMelding.setVisible(true); }else if((int)gdp.size() == 0){ gemachtigdeMelding.info(U bent door niemand gemachtigd); gemachtigdeMelding.add(new AttributeModifier(style, )); gemachtigdeMelding.setVisible(true); } I have a listView as well which sets the error in certain scenarios: if(this.panel.equalsIgnoreCase(panel1)){ this.getParent().getParent().get(panel1).error(some message); this.getParent().getParent().get(panel1).setVisible(true); }else{ this.getParent().getParent().get(panel2).error(some message); this.getParent().getParent().get(panel2).setVisible(true); } The code works but the messages are displayed in both the FeedbackPanels. Could you please guide me in right direction? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Issues-with-multiple-FeedbackPanels-tp4670087.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
Adding new data to existing ListView
Is it possible to add data to an existing ListView for which data is already loaded? Basically what i want is if say i have 10 records already present then add 10 more records to the existing ListView, so we get 20 records. I tried but the ListView gets refreshed if i try to set the new list to it. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-new-data-to-existing-ListView-tp4669967.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: Accordion folding unfolding smoothly
This is what i have tried so far: --HomePage class--- package com.proj.wicket.ui; import java.util.ArrayList; import java.util.List; import org.apache.wicket.Component; import org.apache.wicket.ajax.AjaxEventBehavior; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; import org.apache.wicket.ajax.attributes.AjaxRequestAttributes.EventPropagation; import org.apache.wicket.behavior.AttributeAppender; import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.JavaScriptHeaderItem; import org.apache.wicket.markup.head.PriorityHeaderItem; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Radio; import org.apache.wicket.markup.html.form.RadioGroup; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.model.Model; @SuppressWarnings(unused) public class HomePage extends WebPage { public HomePage() { final WebMarkupContainer mainContainer = new WebMarkupContainer(mainContainer); final WebMarkupContainer accordionContainer = new WebMarkupContainer(accordion); final ListServiceView persons = new ArrayListServiceView(); ServiceView view1 = new ServiceView(); ServiceView view2 = new ServiceView(); ServiceView view3 = new ServiceView(); ServiceView view4 = new ServiceView(); ServiceView view5 = new ServiceView(); ServiceView view6 = new ServiceView(); ServiceView view7 = new ServiceView(); view1.setName(David,ngog 2013); view1.setDate(31-1-2015); view1.setDesc(This is a Demo Desc!!!); view1.setCode(6KH9K); view1.setStatus(Active); view2.setName(David,ngog 2014); view2.setDate(31-1-2015); view2.setDesc(This is a Demo Desc!!!); view2.setCode(6KH9K); view2.setStatus(Active); view3.setName(David,ngog 2015); view3.setDate(31-1-2015); view3.setDesc(This is a Demo Desc!!!); view3.setCode(6KH9K); view3.setStatus(Inactive); view4.setName(David,ngog 2016); view4.setDate(31-1-2015); view4.setDesc(This is a Demo Desc!!!); view4.setCode(6KH9K); view4.setStatus(Active); view5.setName(David,ngog 2017); view5.setDate(31-1-2015); view5.setDesc(This is a Demo Desc!!!); view5.setCode(6KH9K); view5.setStatus(Inactive); view6.setName(David,ngog 2018); view6.setDate(31-1-2015); view6.setDesc(This is a Demo Desc!!!); view6.setCode(6KH9K); view6.setStatus(Inactive); view7.setName(David,ngog 2019); view7.setDate(31-1-2015); view7.setDesc(This is a Demo Desc!!!); view7.setCode(6KH9K); view7.setStatus(Active); persons.add(view1); persons.add(view2); persons.add(view3); persons.add(view4); persons.add(view5); persons.add(view6); persons.add(view7); final ListViewServiceView listRepeat = new ListViewServiceView(listRepeat) { @Override protected void populateItem(final ListItemServiceView item) { final WebMarkupContainer listContainer = new WebMarkupContainer(listContainer); final Label name = new Label(name, item.getModelObject().getName()); final Label date = new Label(date, item.getModelObject().getDate()); final Label status = new Label(status, item.getModelObject().getStatus()); final WebMarkupContainer descriptionContainer = new WebMarkupContainer(descriptionContainer); final Label desc = new Label(desc, item.getModelObject().getDesc()); final Label code = new Label(code, item.getModelObject().getCode()); descriptionContainer.add(desc); descriptionContainer.add(code);
Re: Accordion folding unfolding smoothly
I have checked that already. but i am not allowed to use it. Hence had write the entire code for accordion. Is it possible to just add the toggle effect? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Accordion-folding-unfolding-smoothly-tp4669851p4669903.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: Accordion folding unfolding smoothly
Not allowed to have dependency. :/ -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Accordion-folding-unfolding-smoothly-tp4669851p4669905.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: Accordion folding unfolding smoothly
any workaround possible? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Accordion-folding-unfolding-smoothly-tp4669851p4669891.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: adding component Dynamically
I've checked browser console and the onclick call never gets triggered when i click on the more link. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/adding-component-Dynamically-tp4669838p4669892.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
adding component Dynamically
Hi, I want to add a link to my html dynamically via wicket. I have written code for that which works as far as displaying the link is concerned. But the onclick of the link doesnt work. final WebMarkupContainer more = new WebMarkupContainer(more); final String toelichtingText = item.getModelObject().getToelichting(); String less; if(item.getModelObject().getToelichting().length() 20 javaScript){ if(toelichtingText.indexOf( , 20) != -1){ less = toelichtingText.substring(0, toelichtingText.indexOf( , 20))+ ...more ; }else{ less = toelichtingText; more.setVisible(false); } }else{ less = toelichtingText; more.setVisible(false); } final ModelString strMdl = Model.of(less); final WebMarkupContainer toelichtingContainer = new WebMarkupContainer(toelichtingContainer); final Label lessToelichting = new Label(toelichting, strMdl); lessToelichting.setOutputMarkupPlaceholderTag(true); lessToelichting.setEscapeModelStrings(false); more.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { strMdl.setObject(toelichtingText); more.setVisible(false); target.add(lessToelichting); target.add(more); } @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.setEventPropagation(EventPropagation.STOP); } }); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/adding-component-Dynamically-tp4669838.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: Radio button select not selecting
Tried that as well but did not change in behavior. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Radio-button-select-not-selecting-tp4669792p4669803.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: Radio button select not selecting
Yes, accordion is adding listView to target. Tried using AjaxFormChoiceComponentUpdatingBehavior but it is throwing following exception at runtime: org.apache.wicket.WicketRuntimeException: Behavior {className} can only be added to an instance of a FormComponent code: selectable.add(new AjaxFormChoiceComponentUpdatingBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { System.out.println(inside onclick); accordion(target, dienstsContainer, descriptionContainer, dienstContainer); } }); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Radio-button-select-not-selecting-tp4669792p4669800.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
Radio button select not selecting
Hi here is my code: JAVA: final RadioGroup radioGroup = new RadioGroup(radioGroup); final Radio selectable = new Radio(selectable, new Model(Boolean.FALSE)); selectable.setOutputMarkupPlaceholderTag(true); selectable.add(new AttributeAppender(onclick, new Model(if (event.stopPropagation) { + event.stopPropagation();+ } else { + event.cancelBubble = true; +}), ;)); selectable.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(inside onclick); accordion(target, mainContainer, descriptionContainer, baseContainer); } @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.setAllowDefault(true); } }); radioGroup.add(selectable); radioGroup.setOutputMarkupPlaceholderTag(true); baseContainer.add(radioGroup); The above code is a part of a list view code. HTML: div wicket:id=listOfValues input wicket:id=selectable type=radio My problem is the onClick event of the radio button click gets fired but the radio button is never selected. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Radio-button-select-not-selecting-tp4669792.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: Radio button select not selecting
changed java code to: final Radio selectable = new Radio(selectable, new Model(Boolean.FALSE)); selectable.setOutputMarkupPlaceholderTag(true); /*selectable.add(new AttributeAppender(onclick, new Model(if (event.stopPropagation) { + event.stopPropagation();+ } else { + event.cancelBubble = true; +}), ;));*/ selectable.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(inside onclick); accordion(target, dienstsContainer, descriptionContainer, dienstContainer); } @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.setAllowDefault(true); attributes.setEventPropagation(EventPropagation.STOP); } }); Still not working. I can see the dot inside the radio when i click but then it goes away immediately. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Radio-button-select-not-selecting-tp4669792p4669794.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
Detecting if javascript is disabled
Is there a way in which i can check if the JavaScript of the browser is disabled or not and take appropriate action? I have a requirement wherein i need to show all the data which i'll be hiding by default in case the JavaScript is enabled. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Detecting-if-javascript-is-disabled-tp4669761.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: Dropdown choice with wicket 6.19.0
Ahh...got it working. There was a problem with Form.java that we were using, i had forgotten to update that file. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dropdown-choice-with-wicket-6-19-0-tp4669757p4669760.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
Dropdown choice with wicket 6.19.0
Code: private DropDownChoiceSomeModel reportsChoice; final ChoiceRendererString renderer = new ChoiceRendererString(value, key); ListReport reports = getAllReports(); final RapportChoices reportsChoices = new RapportChoices(reports); this.reportsChoice = new DropDownChoiceSomeModel(rapportChoice, reportsChoices, renderer); @SuppressWarnings(unchecked) @Override protected void onSubmit() { String reportName= this.reportsChoice.getDefaultModelObjectAsString(); //reportName value comes as empty string. It used to work with Wicket 6.13 now that i have upgraded to 6.19.0 it is giving problem. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dropdown-choice-with-wicket-6-19-0-tp4669757.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: Jquery methods issue with wicket 6.13
i used this: @Override public void renderHead(IHeaderResponse response) { // add jQuery library response.render(CssHeaderItem.forUrl(//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css)); response.render(JavaScriptHeaderItem.forUrl(//code.jquery.com/jquery-1.10.2.js)); response.render(JavaScriptHeaderItem.forUrl(//code.jquery.com/ui/1.11.3/jquery-ui.js)); response.render(JavaScriptHeaderItem.forScript($('#accordion').accordion();,onready-master)); } but still no effect. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-methods-issue-with-wicket-6-13-tp4669599p4669603.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: Jquery methods issue with wicket 6.13
Hi Martin, Did the changes as you had said. getting the following error: TypeError: $(...).accordion is not a function $('#accordion').accordion(); @Override public void renderHead(IHeaderResponse response) { // add jQuery library response.render(CssHeaderItem.forUrl(https://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css;)); response.render(JavaScriptHeaderItem.forUrl(https://code.jquery.com/jquery-1.11.2.js;)); response.render(JavaScriptHeaderItem.forUrl(https://code.jquery.com/ui/1.11.3/jquery-ui.js;)); response.render(OnDomReadyHeaderItem.forScript($('#accordion').accordion())); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-methods-issue-with-wicket-6-13-tp4669599p4669609.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: Jquery methods issue with wicket 6.13
Used firebug. I get the following error: ReferenceError: $ is not defined @Override public void renderHead(IHeaderResponse response) { // add jQuery library response.render(CssHeaderItem.forUrl(https://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css;)); response.render(JavaScriptHeaderItem.forUrl(https://code.jquery.com/jquery-1.10.2.js;)); response.render(JavaScriptHeaderItem.forUrl(https://code.jquery.com/ui/1.11.3/jquery-ui.js;)); response.render(JavaScriptHeaderItem.forScript($('#accordion').accordion();,onready-master)); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-methods-issue-with-wicket-6-13-tp4669599p4669608.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
Jquery methods issue with wicket 6.13
My Java code: @Override public void renderHead(IHeaderResponse response) { // add jQuery library response.render(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())); // set focus to the username on load - check that the field exists response.render(JavaScriptHeaderItem.forScript($('#accordion').accordion();,onready-master)); } My HTML: html xmlns:wicket=http://wicket.apache.org; wicket:head/wicket:head body div id=accordion Section 1 div p Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate. /p /div Section 2 div p Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. /p /div Section 3 div p Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. /p ul liList item one/li liList item two/li liList item three/li /ul /div Section 4 div p Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. /p p Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. /p /div /div /body /html When i try to run the above code i get javascript error saying: Object doesn't support this property or method. for line 8 (the Jquery code for accordion) Rendered HTML: html xmlns:wicket=http://wicket.apache.org; head /head body div id=accordion Section 1 div p Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate. /p /div Section 2 div p Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. /p /div Section 3 div p Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. /p ul liList item one/li liList item two/li liList item three/li /ul /div
Re: Wicket 6 onmouseover and onclick event misbehavior
@Sven Meier I didnt get the Why don't you use a :hover pseudo class? Also, i had one more question regarding the onmouseover event, it gets called up the whole time i have the cursor over that component. Is there a way to use it properly so that it doesnt get called everytime...as in it should be called only once (i.e initially). -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-6-onmouseover-and-onclick-event-misbehavior-tp4669442p4669450.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 6 onmouseover and onclick event misbehavior
Hi, I am having a component with both onmouseover and onclick behavior. onmouseover behavior works but the onclick event never gets triggered. If i just keep the onclick event then it works. Code: firstContainer2.add(new AjaxEventBehavior(onclick) { @SuppressWarnings({ unchecked, rawtypes }) @Override protected void onEvent(final AjaxRequestTarget target) { for(Component acc: (ListViewString)mainContainer.get(list2)){ final Component accord = (Component) acc.get(descriptionContainer2); if(accord.isVisible()){ accord.setVisible(false); target.add(accord); } Component firstCont2 = acc.get(firstContainer2); firstCont2.add(new AttributeModifier(class, )); Component lArrow2 = firstCont2.get(leftArrow2); lArrow2.add(new AttributeModifier(class, tableIconArrowLeft)); target.add(firstCont2); } descriptionContainer2.setVisible(true); firstContainer2.add(new AttributeModifier(class, info table-hover)); leftArrow2.add(new AttributeModifier(class, tableIconArrowDown)); target.add(firstContainer2); target.add(descriptionContainer2); } }); firstContainer2.add(new AjaxEventBehavior(mouseover){ @Override protected void onEvent(AjaxRequestTarget target) { if(firstContainer2.getStyle() == null || !firstContainer2.getStyle().equalsIgnoreCase(ex)){ firstContainer2.add(new AttributeModifier(class, ex)); target.add(firstContainer2); } } }); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-6-onmouseover-and-onclick-event-misbehavior-tp4669442.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
Accordion using jquery and wicket 6
Hi, i am using wicket 6.13.0 and i am trying to implement the accordion functionality using jquery. Java Code: package com.digid.wicket.usability; import org.apache.wicket.markup.head.CssReferenceHeaderItem; import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem; import org.apache.wicket.markup.head.OnDomReadyHeaderItem; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.request.Url; import org.apache.wicket.request.resource.UrlResourceReference; public class AccordionJquery extends WebPage { public AccordionJquery() { WebMarkupContainer wmc = new WebMarkupContainer(accordion-2); wmc.setOutputMarkupPlaceholderTag(true); add(wmc); } @Override public void renderHead(IHeaderResponse response){ //response.render(JavaScriptReferenceHeaderItem.forReference(new UrlResourceReference(Url.parse(http://code.jquery.com/ui/1.10.4/jquery-ui.js;; //response.render(JavaScriptReferenceHeaderItem.forReference(new UrlResourceReference(Url.parse(http://code.jquery.com/jquery-1.10.2.js;; //response.render(CssReferenceHeaderItem.forReference(new UrlResourceReference(Url.parse(http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css;; response.render(OnDomReadyHeaderItem.forScript($('#accordion_21').accordion())); } } HTML Code: !doctype html html lang=en xmlns:wicket=http://wicket.apache.org; head meta charset=utf-8 titlejQuery UI Accordion Example /title /head body div wicket:id=accordion-2 Tab 1 div p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. /p /div Tab 2 div p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. /p /div Tab 3 div p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. /p ul liList item one/li liList item two/li liList item three/li /ul /div /div /body /html Generated HTML: !doctype html html lang=en xmlns:wicket=http://wicket.apache.org; head meta charset=utf-8 titlejQuery UI Accordion Example /title /head body div wicket:id=accordion-2 id=accordion_21 Tab 1 div p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. /p /div Tab 2 div p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. /p /div Tab 3 div p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. /p ul liList item one/li liList item two/li liList item three/li /ul /div /div /body /html I get a javascript error saying: `Object doesn't support this property or method` on line 15 of the generated HTML. I tried with jquery library which is commented in the code. Once with keeping
Re: Wicket 6.13 link onclick behavior not working with ajax onclick row select
Thanks. Worked for me :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-6-13-link-onclick-behavior-not-working-with-ajax-onclick-row-select-tp4668995p4669001.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 6.13 link onclick behavior not working with ajax onclick row select
Hi, I have recently upgraded to Wicket 6.13 from Wicket 1.5.11 After the upgrade i am facing an issue with onclick behavior of a link. We have a clickable row which contains few columns (one of which is a link to new page). now, if we click on the link then we are taken to new page and we click on the row (apart from the link) the row get selected (using Ajax call). This was working fine with Wicket 1.5.11, i am facing issues with Wicket 6.13 Link class: public class MyLink extends Link { private static final long serialVersionUID = 5808539933400105591L; private MyRow myRow; public MyLink(String id, MyRow myRow) { super(id); this.myRow = myRow; } /** {@inheritDoc} */ @Override public void onClick() { //sets the response page where this needs to be redirected. this.setResponsePage(new ResponseReadPage(this.myRow)); } } Populate method: @Override protected void populateItem(final ListItem item) { final MyRow myRow = (MyRow) item.getModelObject(); item.add(new Label(naam, myRow.getName())); item.add(new Label(id, myRow.getCode())); MyLink myLink = new MyLink(myLink, myRow); item.add(myLink); final MyRow selectedRow = this.session.getSelectedRow(); if (selectedRow != null selectedRow.equals(myRow)) { this.session.selectedRow(myRow); item.add(new AttributeModifier(class, activeRow)); this.selecteditem = item; //some business logic } item.add(new AjaxEventBehavior(onclick) { /** {@inheritDoc} */ @SuppressWarnings({ unchecked, rawtypes }) @Override protected void onEvent(final AjaxRequestTarget target) { final WebMarkupContainer container = (WebMarkupContainer) MyListView.this.getParent() .getParent().get(myContainer); MyListView.this.session.setSelectedRow(myRow); if (MyListView.this.currentActiveItem != null) { MyListView.this.previousActiveItem = MyListView.this.currentActiveItem; MyListView.this.previousActiveItem.add(new AttributeModifier(class, )); } item.add(new AttributeModifier(class, activeRow)); MyListView.this.currentActiveItem = item; if (MyListView.this.previousActiveItem != null) { target.add(MyListView.this.previousActiveItem); } if (MyListView.this.selecteditem != null !MyView.this.selecteditem.equals(item)) { MyListView.this.selecteditem.add(new AttributeModifier(class, )); target.add(MyListView.this.selecteditem); } target.add(item); target.add(container); } }); } When i try to click on the LINK instead of onClick method of the link, the onclick event of AjaxBehavior of row gets called. When i right click on the link and open it in another tab the call to onClick method of link happens successfully as expected. Can anyone point me in the correct direction to get this sorted? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-6-13-link-onclick-behavior-not-working-with-ajax-onclick-row-select-tp4668995.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