Re: ATOM display in wicket?
Hi, I'm using it with wicket 1.4.18. Not sure if it works or exists for 1.5 For 1.4 this intro was useful (with my comment there): http://it-essence.xs4all.nl/roller/technology/entry/rss_feeds_with_wicket_and Regards, Peter. Is wicketstuff-rome still a usable package with recent Wicket versions, or does anyone have an alternative simple way to display an ATOM or RSS feed on a wicket page? Thanks! Boris -- http://jetsli.de news reader for geeks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to attach treelink to pages
See the source of this application: http://www.wicket-library.com/wicket-examples/navomatic/ On Thu, Oct 13, 2011 at 4:33 AM, pen praveen...@yahoo.com wrote: Hi all, I am building a tree component, with the list of pages, root -Page1 -page2 -page3 onclick it should navigate to respective page accordingly. some thing like this, add(new BookmarkablePageLinkVoid(page1, UserList.class)); add(new BookmarkablePageLinkVoid(page2, RoleList.class)); How to get this in tree component and set the responsepage ? tree = new LinkTree(tree, createTreeModel()){ @Override protected void onNodeLinkClicked(Object node, BaseTree tree, AjaxRequestTarget target) { super.onNodeLinkClicked(node, tree, target); final DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; final IModel model = (IModel) treeNode.getUserObject(); setResponsePage( ? ); } Thanks. Pen -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-attach-treelink-to-pages-tp3900319p3900319.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Detect Connection speed with Wicket or something similar
I think you need to do download of a file to get this measure. E.g. onDomReady you fire an ajax request back to the server to a predefined mount path which will init the download of relatively big file. When the ajax request ends you need to send a second one with the time needed to do the first ajax request. The rest is pure maths to calculate the speed. On Wed, Oct 12, 2011 at 11:19 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: For our wicket applications, we want to detect the browser connection speed, do you know of a library or approach for detecting the browser speed. There is a thing in wicket called AjaxTimerBehavior that I could use but it is a little flaky and not built for the purpose of detetching browser speed. Do you have any ideas how to check this? I thought about using jQuery also, but wouldn't know how? -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: missing page
Wicket 1.5: org.apache.wicket.session.ISessionStore.getAttribute(Request, String) On Wed, Oct 12, 2011 at 8:51 PM, Miroslav F. mir...@seznam.cz wrote: Thanks Martin, finaly my java code is: public PageNotFound(PageParameters params) { ServletWebRequest servletWebRequest = (ServletWebRequest) this.getRequest(); HttpServletRequest request = servletWebRequest.getHttpServletRequest(); this.add(new Label(missingPage, (String) request.getAttribute(javax.servlet.error.request_uri))); } and corresponding markup: Page span wicket:id=missingPage[missing page name]/span which you were looking for is not here. Works. Supplement question is: do I need raw servlet request to make lookup for atributes or there is more wicket way to do it? -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: 12. October 2011 10:55 To: users@wicket.apache.org Subject: Re: missing page javax.servlet.error.request_uri google this for more information On Wed, Oct 12, 2011 at 11:18 AM, Martin Funk mafulaf...@googlemail.com wrote: is RequestCycle.get().getRequest().getUrl() what you are looking for? mf 2011/10/11 Miroslav F. mir...@seznam.cz Hi guys, I need a help - have my custom class PageNotFound based on this help: https://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.htm l In my PageNotFound class I have: this.add(new Label(missingPage, _put_pagename_which_was_not_found)); but I have no idea how to find-out pagename. I just know that somehow system must know this pagename. Any ideas please? Miro - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow, IFrame and source
This is improved in 1.5.x. You are recommended to upgrade. On Wed, Oct 12, 2011 at 8:52 PM, Nelson Segura nsegu...@gmail.com wrote: Hello everyone: Looking back at issue: https://issues.apache.org/jira/browse/WICKET-2207 I noticed that the fix was done against certain version of IE. In other cases, like firefox, a request to http://:/ is still performed. I have got some complains from users that their proxies are blocking that particular call as invalid/suspicious, causing a blocked content page to show instead of the modal window. I cannot reproduce this myself, by have seen it in at least one of our QA machines. My question is, is there a reason why this was not changed other than certain versions of IE? Having the src of the iframe for modal windows be //: still causes random problem for us in other browsers. -Nelson Segura - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
job
searching for someone who is familiar with Wicket for a 4+ month contract in San Antonio, Texas. If you or anyone you know is interested please message me or email me at ro...@millgroupusa.com. -- Cdt Moèz
Re: jqWicket or wiQuery
Martin Grigorov-4 wrote: Both Wiquery and jqWicket provide integration with JQuery UI, not plain JQuery. Wicket core may provide some abstractions to make integrations with JQuery UI at some later point. JQWicket provides much more than only JQuery UI integration. It delivers a collection of pre-implemented 3d-party jquery / jquery ui plugins and exposes almost the entire jQuery API (see e.g. IJQStatement, Selector Builder API: http://code.google.com/p/jqwicket/wiki/FAQ) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/jqWicket-or-wiQuery-tp3895432p3900865.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: Recommended way for wicket:for and markupIDs
wicket:for works as IComponentResolver, i.e. while rendering the final markup Wicket will see a ComponentTag with the special 'wicket:for' attribute and will transform it to label for= Wicket can set automatically the this flag for and actually it does it: if (!component.getOutputMarkupId()) { component.setOutputMarkupId(true); // HERE if (!component.hasBeenRendered()) // BUG ?! { logger.warn( Component: {} is referenced via a wicket:for attribute but does not have its outputMarkupId property set to true, component.toString(false)); } } But it could be too late if your markup looks like: input id=id1/ label for=id1.../label, i.e. the label will be rendered AFTER the related form component and setting the flag will be too late. @Igor: is it a bug the line with 'hasBeenRendered()' ? I think the negation shouldn't be there. On Thu, Oct 13, 2011 at 8:36 AM, Matthias Keller matthias.kel...@ergon.ch wrote: Hi I really like the wicket:for feature; makes writing the HTML pages much less tedious -- except that it appears I have to use setOutputMarkupId() on each and every referenced Component - is this how it is expected to work? I expected that those IDs should be set automatically without a warning in the log every time? The wicket XHTML-Page also doesn't mention anything about that. We're using Wicket 1.5.1 We will also have to access certain input fields by javascript methods, what's the recommended way to do this since we cannot determine the IDs beforehand? Thank you very much Matt -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unit Testing Application with custom HttpServletResponse
I found out solution for this by overriding createRequestCycle() in WicketTester. @Override public WebRequestCycle createRequestCycle() { final WebRequestCycle mockCycle = super.createRequestCycle(); final MockHttpServletRequest mockRequest = new MockHttpServletRequest(getApplication(), // getServletSession(), getApplication().getServletContext()); final MockHttpServletResponse mockResponse = new MockHttpServletResponse(mockRequest); final WebRequest request = new ServletWebRequest(mockRequest); final WebResponse response = new WebResponse(mockResponse); mockCycle.setRequest(request); mockCycle.setResponse(response); return mockCycle; } On 10/03/2011 01:16 PM, Jan Ferko wrote: Hi everyone, We use proxy around HttpServletResponse in our application. I would like to test components/pages using WicketTester, but when WicketTester tries to startPage it throws following exception: java.lang.ClassCastException: myPackage.HttpServletResponseProxy cannot be cast to org.apache.wicket.protocol.http.MockHttpServletResponse at org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:555) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:507) at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:319) This is of course correct because our proxy implementation is not MockHttpServletResponse. Is there any workaround this problem? Thanks for help. Jan
Only the first TextField in a repetition gets correct OnChangeAjaxBehavior with 1.5.1
Hi, Upgrading to wicket 1.5.1 from 1.4.18 my ajax updates stopped working. I have a page with a form. Inside the form there is a repetition (ListView) that among other things creates a text field for each item (ListItem). Each of those text fields has an OnChangeAjaxBehavior set that should update a label. The label should continously display the total sum of the numbers in the text fields. With wicket 1.4.18 (and previous versions) this worked fine. With 1.5.1 only the first text field in the repetition gets the correct ajax behavior - it works the way I want it, and the way it worked with 1.4.*. The other text fields are dead, except for focus set/removed. While typing in any of the other text fields nothing is updated (the ajax debug window shows no activity). When focus is removed I get a NullPointerException regardless of what I've changed. Is this a (known) bug, or is there a difference between 1.4 and 1.5 that I've missed? /Anders - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Only the first TextField in a repetition gets correct OnChangeAjaxBehavior with 1.5.1
Hi, can you attach the code you use to initialize ListView? Hi, Upgrading to wicket 1.5.1 from 1.4.18 my ajax updates stopped working. I have a page with a form. Inside the form there is a repetition (ListView) that among other things creates a text field for each item (ListItem). Each of those text fields has an OnChangeAjaxBehavior set that should update a label. The label should continously display the total sum of the numbers in the text fields. With wicket 1.4.18 (and previous versions) this worked fine. With 1.5.1 only the first text field in the repetition gets the correct ajax behavior - it works the way I want it, and the way it worked with 1.4.*. The other text fields are dead, except for focus set/removed. While typing in any of the other text fields nothing is updated (the ajax debug window shows no activity). When focus is removed I get a NullPointerException regardless of what I've changed. Is this a (known) bug, or is there a difference between 1.4 and 1.5 that I've missed? /Anders - 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: Detect Connection speed with Wicket or something similar
Do you have a little bit more pseudocode. And I want this to be transparent as part of the application, E.g. I want the user to visit the home page and then we calculate the speed and log it. MyHomePage extends Page { public String onDomReady() { return wicketAjaxGet('/theFile'); // or jquery? } } theFile MountPoint extends Page { } -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Thursday, October 13, 2011 3:06 AM To: users@wicket.apache.org Subject: Re: Detect Connection speed with Wicket or something similar I think you need to do download of a file to get this measure. E.g. onDomReady you fire an ajax request back to the server to a predefined mount path which will init the download of relatively big file. When the ajax request ends you need to send a second one with the time needed to do the first ajax request. The rest is pure maths to calculate the speed. On Wed, Oct 12, 2011 at 11:19 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: For our wicket applications, we want to detect the browser connection speed, do you know of a library or approach for detecting the browser speed. There is a thing in wicket called AjaxTimerBehavior that I could use but it is a little flaky and not built for the purpose of detetching browser speed. Do you have any ideas how to check this? I thought about using jQuery also, but wouldn't know how? -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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: Only the first TextField in a repetition gets correct OnChangeAjaxBehavior with 1.5.1
Here the (simplified) code that creates the ListViev, TextFields and Label. /Anders final MyPageForm tmpForm = new MyPageForm(ID.FORM); this.add(tmpForm); final ContextLabelNumber tmpTotalWeightsLabel = new ContextLabelNumber(ID.TOTAL_WEIGHTS, new PropertyModelNumber(this.getPortfolio(), ID.TOTAL_WEIGHTS), StandardType.PERCENT); tmpTotalWeightsLabel.setOutputMarkupId(true); final ListViewBLMarketInstrument tmpMarketInstrumentListView = new ListViewBLMarketInstrument(ID.INSTRUMENTS, this.getPortfolio().getMarketInstruments()) { @Override public void populateItem(final ListItemBLMarketInstrument aListItem) { final BLMarketInstrument tmpMarketInstrument = aListItem.getModelObject(); final ContextTextFieldNumber tmpMarketWeightTextField = new ContextTextFieldNumber(ID.MARKET_WEIGHT, tmpMarketInstrument, StandardType.PERCENT); aListItem.add(tmpMarketWeightTextField); tmpMarketWeightTextField.add(new OnChangeAjaxBehavior() { @Override protected void onUpdate(final AjaxRequestTarget someTarget) { someTarget.add(tmpTotalWeightsLabel); } }); } }; tmpMarketInstrumentListView.setReuseItems(true); tmpForm.add(tmpMarketInstrumentListView); tmpForm.add(tmpTotalWeightsLabel); On 13 okt 2011, at 12:40, Anders Peterson wrote: Hi, Upgrading to wicket 1.5.1 from 1.4.18 my ajax updates stopped working. I have a page with a form. Inside the form there is a repetition (ListView) that among other things creates a text field for each item (ListItem). Each of those text fields has an OnChangeAjaxBehavior set that should update a label. The label should continously display the total sum of the numbers in the text fields. With wicket 1.4.18 (and previous versions) this worked fine. With 1.5.1 only the first text field in the repetition gets the correct ajax behavior - it works the way I want it, and the way it worked with 1.4.*. The other text fields are dead, except for focus set/removed. While typing in any of the other text fields nothing is updated (the ajax debug window shows no activity). When focus is removed I get a NullPointerException regardless of what I've changed. Is this a (known) bug, or is there a difference between 1.4 and 1.5 that I've missed? /Anders - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Forwarding in 1.5 not working like in 1.4 [Fixed - was using older 1.5 jars]
After creating a QuickStart and not being able to reproduce the problem I discovered that my original app was linking with an earlier 1.5 snapshot. Once I linked with the latest snapshot jars it magically worked - yeehah! -Original Message- From: Chris Colman [mailto:chr...@stepaheadsoftware.com] Sent: Monday, 10 October 2011 9:57 AM To: users@wicket.apache.org Subject: RE: Forwarding in 1.5 not working like in 1.4 Will do. Chris -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Sunday, 9 October 2011 6:07 PM To: users@wicket.apache.org Subject: Re: Forwarding in 1.5 not working like in 1.4 Can you create a quickstart ? It looks like either javax.servlet.forward.url is not set as attribute in the HttpServletRequest or Wicket doesn't use it. I think it is the latter. On Sat, Oct 8, 2011 at 11:56 PM, Chris Colman chr...@stepaheadsoftware.com wrote: Looks like the redirect is due to the PRG strategy implementation so it's set to REDIRECT_TO_BUFFER. (From my, possibly naïve, understanding I thought you only needed PRG when a form submission was involved but it looks like it's applied to every page request). I probably should keep using the redirect strategy option otherwise I will encounter the double submit problem with forms. I just need to know how I can get wicket to allow me to do a forward of www.mysite.com to a URL of the style www.mysite.com/content/home/o/123 without performing a redirect that changes the user's browser address field. -Original Message- From: Chris Colman [mailto:chr...@stepaheadsoftware.com] Sent: Saturday, 8 October 2011 10:52 PM To: users@wicket.apache.org Subject: RE: Forwarding in 1.5 not working like in 1.4 Could it be that Wicket sees the original URL as being / (i.e. home page) and so performs a redirect to the home page? Possibly it should be looking at the 'forward' request URL which is not / but content/home/o/76429 and should be handled directly without a redirect. -Original Message- From: Chris Colman [mailto:chr...@stepaheadsoftware.com] Sent: Saturday, 8 October 2011 10:28 PM To: users@wicket.apache.org Subject: RE: Forwarding in 1.5 not working like in 1.4 I have found that the method below appears to return the wrong result for relativeUrl: WebPageRender.java protected void redirectTo(Url url, RequestCycle requestCycle) { WebResponse response = (WebResponse)requestCycle.getResponse(); String relativeUrl = requestCycle.getUrlRenderer().renderUrl(url); response.sendRedirect(relativeUrl); } On input to the renderUrl method url = content/home/o/76429?6 On return relativeUrl = 76429?6 Possibly the problem is in UrlRenderer.renderRelativeUrl(Url url) Given that the UrlRender has it's baseUrl as content/home/o/76429 then, according to my naïve understanding of how the Wicket internals work, the relative URL it returns should be ?6 not 76429?6 Does this make sense? I'm not quite sure why it is appearing to perform a redirect in the first place. If I point the browser to www.mysite.com/content/home/o/76429 It works fine but if I point it to www.mysite.com http://www.mysite.com/ my separate redirector filter will identify this as a URL that needs forwarding and so it performs a forward via the dispatcher to www.mysite.com/content/home/o/76429. content/home/o/76429 is indeed the servlet path in the request that the Wicket filter receives but yet it feels the need to do a redirect to the incorrect URL it derives above then attempts to service that incorrect redirect request which fails as it is not in the correct format. From: Chris Colman [mailto:chr...@stepaheadsoftware.com] Sent: Friday, 7 October 2011 6:15 PM To: users@wicket.apache.org Subject: Forwarding in 1.5 not working like in 1.4 We have a separate filter set up to catch parameter-less domain name requests ( /* ) like: www.myurl.com http://www.myurl.com/ and forward them to a bookmarkable home page like: www.myurl.com/content/home/o/123 The extra o/123 is an organization discriminator name/value pair and is read in by the home page as a parameter. The use of a forward means that the address in the user's browser remains as www.myurl.com http://www.myurl.com/ but the actual page rendered is www.myurl.com/content/home/o/123 The page mount looks like: pageParametersEncoder = new UrlPathPageParametersEncoder(); mount(new MountedMapper(/content/home, HomePage.class, pageParametersEncoder)); The code used for the forward inside our separate redirector filter is: RequestDispatcher rd = req.getRequestDispatcher(/content/home/o/123); rd.forward(req, res); This filter then does not chain to the next filter so that the servlet engine can re-request with the forwarded URL. In 1.4 the wicket filter then services this forward
Re: Only the first TextField in a repetition gets correct OnChangeAjaxBehavior with 1.5.1
I've tried to reproduce your condition in a quickstart. The Java code is the following: ListString itemList = Arrays.asList(new String[]{red, blue, green, yellow}); final Label label; add(label = new Label(label, )); label.setOutputMarkupId(true); ListViewString colors = new ListViewString(colors, itemList){ @Override protected void populateItem(ListItemString item) { String value = item.getModelObject(); final TextField text; item.add(text = new TextField(value, Model.of())); text.add(new OnChangeAjaxBehavior(){ @Override protected void onUpdate(AjaxRequestTarget target) { target.add(label.setDefaultModelObject(text.getModelObject())); } }); } }; colors.setOutputMarkupId(true); colors.setReuseItems(true); add(colors); and the markup is body div id=hd div id=logo img src=logo.png width=50px height=50px alt=Wicket Logo / h1Apache Wicket/h1 /div /div span wicket:id=label/span div wicket:id=colors input type=text wicket:id=value/ /div /body However I didn't notice any problem, it works as expected. Maybe the problem is inside one of your custom components (ContextLabel, ContextTextField, ...) Here the (simplified) code that creates the ListViev, TextFields and Label. /Anders On 13 okt 2011, at 12:40, Anders Peterson wrote: Hi, Upgrading to wicket 1.5.1 from 1.4.18 my ajax updates stopped working. I have a page with a form. Inside the form there is a repetition (ListView) that among other things creates a text field for each item (ListItem). Each of those text fields has an OnChangeAjaxBehavior set that should update a label. The label should continously display the total sum of the numbers in the text fields. With wicket 1.4.18 (and previous versions) this worked fine. With 1.5.1 only the first text field in the repetition gets the correct ajax behavior - it works the way I want it, and the way it worked with 1.4.*. The other text fields are dead, except for focus set/removed. While typing in any of the other text fields nothing is updated (the ajax debug window shows no activity). When focus is removed I get a NullPointerException regardless of what I've changed. Is this a (known) bug, or is there a difference between 1.4 and 1.5 that I've missed? /Anders - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to attach treelink to pages
thanks Martin for quick response, my question is how to do the same thing in the nested tree component, I have looked at the wicket examples but none of them have what I am looking. They have basic nested tree component hyperlink, but on clicking the page link, it should navigate to respective page. `Pen -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-attach-treelink-to-pages-tp3900319p3901894.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: Recommended way for wicket:for and markupIDs
On Thu, Oct 13, 2011 at 2:08 AM, Martin Grigorov mgrigo...@apache.org wrote: wicket:for works as IComponentResolver, i.e. while rendering the final markup Wicket will see a ComponentTag with the special 'wicket:for' attribute and will transform it to label for= Wicket can set automatically the this flag for and actually it does it: if (!component.getOutputMarkupId()) { component.setOutputMarkupId(true); // HERE if (!component.hasBeenRendered()) // BUG ?! { logger.warn( Component: {} is referenced via a wicket:for attribute but does not have its outputMarkupId property set to true, component.toString(false)); } } But it could be too late if your markup looks like: input id=id1/ label for=id1.../label, i.e. the label will be rendered AFTER the related form component and setting the flag will be too late. @Igor: is it a bug the line with 'hasBeenRendered()' ? I think the negation shouldn't be there. indeed looks like a bug, fixing -igor On Thu, Oct 13, 2011 at 8:36 AM, Matthias Keller matthias.kel...@ergon.ch wrote: Hi I really like the wicket:for feature; makes writing the HTML pages much less tedious -- except that it appears I have to use setOutputMarkupId() on each and every referenced Component - is this how it is expected to work? I expected that those IDs should be set automatically without a warning in the log every time? The wicket XHTML-Page also doesn't mention anything about that. We're using Wicket 1.5.1 We will also have to access certain input fields by javascript methods, what's the recommended way to do this since we cannot determine the IDs beforehand? Thank you very much Matt -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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: Recommended way for wicket:for and markupIDs
On 2011-10-13 17:52, Igor Vaynberg wrote: On Thu, Oct 13, 2011 at 2:08 AM, Martin Grigorovmgrigo...@apache.org wrote: wicket:for works as IComponentResolver, i.e. while rendering the final markup Wicket will see a ComponentTag with the special 'wicket:for' attribute and will transform it tolabel for= Wicket can set automatically the this flag for and actually it does it: if (!component.getOutputMarkupId()) { component.setOutputMarkupId(true); // HERE if (!component.hasBeenRendered()) // BUG ?! { logger.warn( Component: {} is referenced via a wicket:for attribute but does not have its outputMarkupId property set to true, component.toString(false)); } } But it could be too late if your markup looks like:input id=id1/ label for=id1.../label, i.e. the label will be rendered AFTER the related form component and setting the flag will be too late. @Igor: is it a bug the line with 'hasBeenRendered()' ? I think the negation shouldn't be there. indeed looks like a bug, fixing Thanks a lot! That would explain why I'm seeing a lot of those messages even though we always have the label before the input field.. Now to my other question: What is the best way to combine wicket:for with JS that needs access to certain input fields? Wicket generates an ID so the JS somehow needs to know about it - is there an easy way to achieve that? Thanks Matt smime.p7s Description: S/MIME Cryptographic Signature
Re: Recommended way for wicket:for and markupIDs
Wicket will automatically use your id if you specify one in the markup. So if you have id=xyz in the markup, wicket will not overwrite it. In other words: specify whatever ID you need so you can access the correct tag from javascript. Op 13-10-2011 21:34, schreef Matthias Keller: On 2011-10-13 17:52, Igor Vaynberg wrote: On Thu, Oct 13, 2011 at 2:08 AM, Martin Grigorovmgrigo...@apache.org wrote: wicket:for works as IComponentResolver, i.e. while rendering the final markup Wicket will see a ComponentTag with the special 'wicket:for' attribute and will transform it tolabel for= Wicket can set automatically the this flag for and actually it does it: if (!component.getOutputMarkupId()) { component.setOutputMarkupId(true); // HERE if (!component.hasBeenRendered()) // BUG ?! { logger.warn( Component: {} is referenced via a wicket:for attribute but does not have its outputMarkupId property set to true, component.toString(false)); } } But it could be too late if your markup looks like:input id=id1/ label for=id1.../label, i.e. the label will be rendered AFTER the related form component and setting the flag will be too late. @Igor: is it a bug the line with 'hasBeenRendered()' ? I think the negation shouldn't be there. indeed looks like a bug, fixing Thanks a lot! That would explain why I'm seeing a lot of those messages even though we always have the label before the input field.. Now to my other question: What is the best way to combine wicket:for with JS that needs access to certain input fields? Wicket generates an ID so the JS somehow needs to know about it - is there an easy way to achieve that? Thanks Matt
Re: ModalWindow, IFrame and source
Hey, thanks. I am planning to upgrade to 1.5.x in our .next release. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org