Re: Just 1 hour to introduce Wicket (Friday)
I like these points. 1. All code is Java, which enables end-to-end refactoring and gives you clean html. And static typing gives you also good means to navigate your code. Use your IDE to find the uses, overrides, etc. Make unsupported (due to API breaks) methods final so that your clients break hard. Users of your components can use code completion and javadoc hoovers. All the good Java stuff. 2. Composition enables reuse. When I took a panel and moved it from a tab on a page to a modalwindow on the page by changing a couple of lines of code it made a big impact. Another thing that is good about composition is that it makes it easier to divide work. You don't have to work from page to page, but rather can pick an course to very fine components. 3. Components have session state. Hence the content of the session is determined by what components are on the page -- and further the session is cleaned out as components leave scope. (And if state is kept in url parameters then session is not used, in case anyone complains about session size. State must be somewhere, no?) In the new version of Wicket In Action's chapter one, I state this: Wicket bridges the impedance mismatch between the stateless Hypertext Transfer Protocol (HTTP) and stateful Java programming. I added this after Dhanji Prasanna asked me what I planned to say about that, which finally got that light-bulb fired: 'that's indeed the core-core problem that Wicket tries to solve'. Unfortunately, the new chapter wasn't included in the last MEAP download, but I'm sending it to Cemal directly. I hope I do a better job than before explaining the key points of Wicket. Another (potential) interesting point is that Wicket is secure by default. Here is an excerpt of chapter 12 (authentication and authorization): With Wicket, if you don't code using bookmarkable pages, you use session relative pages - Wicket's default way of coding web applications. Page instances are kept on the server and you ask Wicket (through your browser) for a certain page by providing the page number, version and the component that is the target of the request. This works in the opposite way of the REST architectural pattern, which states that servers should not keep state, but clients provide servers with the relevant state when they issue requests. As we saw in the first chapter, REST is great for scalability, but lousy for the programming model. And now we get to another problem with REST: the pattern is inherently unsafe, whereas Wicket's server state pattern is safe by default. For instance, if you implement the functionality of removing an object using a link like this: final MyObject myObject = … new Link(remove) { myDao.remove(myObject); } you never need to be worried about pimple faced fourteen year olds trying to 'hack' your web application. They would have to hijack the session, guess the - session relative - page ids and version numbers, and the relevant component paths. Very unlikely anyone ever will pull that off. And you can even make your Wicket application more secure by encrypting requests with for instance CryptedUrlWebRequestCodingStrategy. It simply doesn't get any safer. The REST variant of building your application would use bookmarkable pages like this: public DeleteMyObjectPage(PageParameters p) { super(p); Long id = p.getLong(id); myDao.remove(MyObject.class, id); } The latter example, which is similar to how you would use actions or commands with model 2 frameworks, is unsafe in two distinct ways. The location of DeleteMyObjectPage can be guessed, thus exposing that functionality to misuse. And even if users are authorized to access that page and access itself is not a problem, they might only be authorized to delete certain instances of MyObject. Without explicit protection, they could guess ids or even write a script to delete whole parts of the database. That means extra coding and potential security holes that can be overlooked, whereas the 'session relative way' doesn't require you to do anything extra in this respect. Personally, I think this is a great feature. Though in all fairness, session relative pages also makes testing harder. Eelco
SV: Setting up Wicket with Tomcat
I looked at that one, and for some reason my exact copy of the web.xml file wasn't exact enough. We're implementing wickets in another project, so setting up a new project wasn't practical. However good old copy-paste worked wonders. Thanks :) -Opprinnelig melding- Fra: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sendt: 30. oktober 2007 17:16 Til: users@wicket.apache.org Emne: Re: Setting up Wicket with Tomcat or just use the damn archetype to create a properly configured project in the first place, thats why we have it... :) http://wicket.apache.org/quickstart.html -igor On 10/30/07, Frank Bille [EMAIL PROTECTED] wrote: On 10/30/07, Alexander Landsnes Keül [EMAIL PROTECTED] wrote: ?xml version=1.0? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/TR/xmlschema-1/; xsi:schemaLocation= http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 display-nameAnsatt/display-name filter filter-nameWicketFilter/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter /filter-class init-param param-nameapplicationClassName/param-name param-value no.unique.ansatt.presentation.StartPage/param-value no.unique.ansatt.presentation.StartPage? Is this what you mean? Don't you mean something like: init-param param-nameapplicationClassName/param-name param-valueno.unique.ansatt.presentation.AnsattApplication /param-value /init-param I'm not entirely sure what you are asking about, but have Kent Tong has a free tutorial on setting up an environment with wicket, eclipse and tomcat: http://www.agileskills2.org/EWDW/index.html Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Just 1 hour to introduce Wicket (Friday)
One thing I always think is totally awesome is this: you develop your demo application, introduce some AJAX, etc. Just be sure to use stuff that has non-AJAX fallbacks. Then, at the end you can just turn off javascript and everything still just works. Dropped my jaw for sure;-) Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket Session Management?
- Also it looks like wicket requires code changes when more pages are added and each page needs to have separate handler and it can not be done in configuration file. This may become an issue when number of pages increase in future. what do you mean with this? You want to have the flow between pages in a xml file? Please explain to me how you want to do that exactly, i am always very curious why the web frameworks all really want this. How do you see that you can just drop in a new page. And then configure an xml file and that page is suddenly the response page of 5 other pages (actions) ? But what state does that new page get? Are all the pages that you show completely stateless they can construct themself from something and know what they must show and what there context is? So how do all the previous pages know exactly what context to set somewhere that the new page wants? Please if anybody could tell me how they can build an application with flow where all the pages don't really know anything of the next page of even what the next page really is. Is there 1 person on this list that made a struts or webflow application like this that they can randomly define flow and add pages without touching the existing code base? johan
wicket-contrib-datepicker
Hi, could it be possible to fix old DatePicker in 1.2 and 1.X? At least Scandinavian letters like ä and ö is replaced with rubbish like ö or ?. I can sen fixed Finnish and Swedish versions but I also need languages like Polish. This problem was fixed year ago but now it occurs again. - Juha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tabbed panels
I have two questions regarding tabbed panels. I've read the example, so I've been able to create a navigation with it but it's a bit limited. First thing, is it possible to nest tabbed panels? I tried to do so, but then all the wickets in the panels stopped working. Way I set it up was create a TabbedPanel where the different tabs referred to new TabbedPanels. Not really sure if this is doable, but if so how would I go about it, and is it possible to change the CSS style for the two tab panels? Second thing, I tried to make a helper class for adding tabs to a Tabbed Panel. It works fine, except for the getPanel() overloading. I tried to do it as follows: public void addTab( final String label, final Panel tabPanel ) { tabs.add( new AbstractTab( new Model( label )) { private static final long serialVersionUID = 1L; public Panel getPanel( String panelID ) { return tabpanel; } }); } Simply changing it to return new PersondataPanel( panelID ); works, but this would mean creating one addTab(..) for each possible panel. Is there an elegant way of solving this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Non-serializable objects and efficiency
For anyone who is interested (new users) the appropriate resource is here: http://cwiki.apache.org/WICKET/request-processing-overview.html WicketKeeper wrote: Thanks for prompt reply. Yes, I was thinking having 1 DataConn for every new request. So what i envision is: 1. User goes to home page (active window being the browser window) 2. On connection, a new DataConn object should be initialised. 3. User does data enquiry stuff from that page (lots of tabs, form inputs etc.) - components on the page are populated by making requests to DataConn. Otherwise I could have just 1 DataConn for the entire application but it might get a bit loaded if there are lots and lots of people connecting - plus it does user authentication via the contructor so there has to be 1 DataConn per user. Thanks for your help so far! WK Johan Compagner wrote: opening a DataConn everytime for every request isn't really what you want i guess? (else you could have a custom request cycle that does this) But what you could do is hold an transient field in your custom Wicket Session object and maybe besides that a id or description so that you can restore that transient field. And keep in in the session as long as possible. But it could be that the field (the dataconn) is sometimes null if the wicket sessions was serialized by the container. What do you mean active window? What is the active window? Do you want an datacon object per browser window? You could look if you can have 1 per pagemap then johan On 10/25/07, WicketKeeper [EMAIL PROTECTED] wrote: Hi Thanks... Then how do I get that object by it's id? (did you mean component id?) I guess what i'm asking is how to best structure things in Wicket when there is a resource that isn't serializable and is used by multiple components. So in my case I have a number of tabs, each with its own panel. Within the panel there's a bunch of fillable components, e.g. tables, which are populated by using DataConn. However for every person that visits the site there can only ever be one instance of DataConn (so there would be multiple instances in the application if more then one person is hitting the home page). Another question: DataConn should also be wrapped up so that GB can deal with it once a user closes the active window. Is there a way to do this? I keep coming back to the idea of Sessions here but I have a gap in my understanding of how wicket is deploying objects here. Any help, much appreciated. Thanks! WW. Johan Compagner wrote: you can't keep hard (must be transient) references to those resources so you always should be able to look it up again. by, for example, some id that isn't transient johan On 10/24/07, WicketKeeper [EMAIL PROTECTED] wrote: Hi I'm new to Wicket to this might be an ultra-dum question :) I'm creating a wicket application that gets its data from an online resource. The connection logic to that resource is in an external jar and most of those classes don't implement Serializable. Fore ease of explanation, let's call the entry class for the connection DataConn. So whenever I want to get specific data to, say, fill in an AutoCompleteTextField all i do is list=dataconn.getStuff(). Moreover, whenever someone comes to the application's homepage they shoult only ever have ONE instance of DataConn, i.e. 1 instance for each user. So my question is - what's the best way to go about doing this in Wicket? I am aware of Session and Models in wicket (though my understanding is poor) - could anyone direct me to the appropriate examples or suggestions please? Thanks WK. -- View this message in context: http://www.nabble.com/Non-serializable-objects-and-efficiency-tf4684047.html#a13384755 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Non-serializable-objects-and-efficiency-tf4684047.html#a13401731 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Non-serializable-objects-and-efficiency-tf4684047.html#a13507269 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamically changing CSS
works perfectly. tks a mill. On 10/31/07, Timo Rantalaiho [EMAIL PROTECTED] wrote: On Wed, 31 Oct 2007, Cristi Manole wrote: Tks a lot for your reply, but how do I do get wicket to change the style color of that speciffic row, exactly? that part I don't know... :( Something like final Component row = ... row.add(new AttribubuteModifier(class, true, new AbstractReadOnlyModel() { public Object getObjext() { if (isSelected(row)) { return trhighlight; } return trdefault; } }); or if you don't want to change the style attribute by default, you can only enable the attributemodifier as needed row.add(new AttribubuteModifier(class, true, new AbstractReadOnlyModel() { public Object getObjext() { return trhighlight; } } @Override public boolean isEnabled() { return isSelected(row); } }); Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Security message when using popup dialog
Martijn Dashorst wrote: look in the source of the page, and possibly try to capture the headers. This will help us in discovering what goes wrong. Haven't been able to find anything in the source referencing this bizarre address. Of course 'View Source' doesn't keep up with dynamic changes made to the HTML document. Here is the request header that I think is causing the problem: GET /dch-apps/mcir/wicket/://0 HTTP/1.1 Accept: */* Referer: https://localhost:7000/dch-apps/mcir/wicket/;jsessionid=cc1740a122b817d48694251b4c9ebfa7f4cb98e303e4?wicket:interface=modal-dialog-pagemap:0 Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322) Host: localhost:7000 Connection: Keep-Alive Cookie: PD-S-SESSION-ID=2_3Up0h124Sdjoiwp2xtcs6noIRVFNPvCGgyexh+nKYigzh-Xr; AMWEBJCT!%2Fsom!JSESSIONID=86sQ6Yf_BcJ3mqzjMZdxO1g:-1; PD_STATEFUL_e7b6e27e-0ebe-11dc-b6c7-cc17401eaa77=%2Fsom; IV_JCT=%2Fdch-apps; AMWEBJCT!%2Fdch-apps!JSESSIONID=cc1740a122b817d48694251b4c9ebfa7f4cb98e303e4 And here is the corresponding response: HTTP/1.1 404 Not Found content-type: text/html date: Wed, 31 Oct 2007 12:53:18 GMT p3p: CP=NON CUR OTPi OUR NOR UNI server: Oracle Containers for J2EE x-old-content-length: 148 transfer-encoding: chunked 94 HTMLHEADTITLE404 Not Found/TITLE/HEADBODYH1404 Not Found/H1Resource /dch-apps/mcir/wicket/:/0 not found on this server/BODY/HTML 0 Don't let the localhost:7000 throw you. That's just because I'm routing the request through a program which allows me to capture to request/response headers. It doesn't appear that this same request is being made in FF though. Martijn Dashorst wrote: And please check if you have images without a src attribute or an empty src attribute. That seems to cause problems too (though possibly not this one). No image tags to check in this case. Aside from the images used by the wicket popup, there's only one image on the page at all and it's added via css. We're not really allowed to use graphics in this app (boring). Thanks for the help. Joel -- View this message in context: http://www.nabble.com/Security-message-when-using-popup-dialog-tf4720449.html#a13509156 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: YUI vs Wicket AutoComplete
don't forget about the scriptaculous autocomplete component as well. It allows for ajax/dynamic autocomplete, or using a static list of results. http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+AutoCompleteBehavior On 10/30/07, Eelco Hillenius [EMAIL PROTECTED] wrote: I want to use an auto complete component on stateless pages and in theory there should not be a problem with this. Currently the wicket implementation uses the AJAX behaviour functionality which ... waiting for the next episode :-) Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with scriptaculous in wicket 1.3 beta3
Hi, i try to use the Effect class of the scriptaculous jar in a testApp. My Code: Java: import org.wicketstuff.scriptaculous.effect.Effect; ... final StaticImage stimg = new StaticImage(fehler); AjaxLink al = new AjaxLink(clickImg) { private static final long serialVersionUID = 0L; @Override public void onClick(AjaxRequestTarget target) { target.appendJavascript(new Effect.Fade(this).toJavascript()); } }; form.add(al); al.add(stimg); ... HTML: ... # div /pics/fehler_404_gross.jpeg /div The Wicket Ajax Debug Window shows: INFO: Response parsed. Now invoking steps... ERROR: Exception evaluating javascript: ReferenceError: Effect is not defined INFO: Response processed successfully. i´m using apache-wicket-1.3.0-beta3 and wicketstuff-scriptaculous-1.3-20070924.212110-2.jar. i tried also with wicket-contrib-scriptaculous-0.1.1.jar and wicketstuff-scriptaculous-1.3-20070911.130143-1.jar What am i doing wrong. Can anyone help? -- View this message in context: http://www.nabble.com/Problem-with-scriptaculous-in-wicket-1.3-beta3-tf4725430.html#a13510542 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ModalWindow windowClosedCallback and WicketTester
Hi everyone! I have a ModalWindow with a close button in it, the button's onclick calls modalWindow.close() via AJAX. My problem is that when I call the onclick via wicketTester.executeAjaxEvent(button, onclick) the modalWindow's windowClosedCallback doesn't fire.. Am I missing something? Or am I supposed to call it from the testcase? Many thanks for your time! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with scriptaculous in wicket 1.3 beta3
Probably your are missing a HeaderContributor adding the actual effects.js and prototype.js to your page? Just guessing... SantiagoA wrote: Hi, i try to use the Effect class of the scriptaculous jar in a testApp. My Code: Java: import org.wicketstuff.scriptaculous.effect.Effect; ... final StaticImage stimg = new StaticImage(fehler); AjaxLink al = new AjaxLink(clickImg) { private static final long serialVersionUID = 0L; @Override public void onClick(AjaxRequestTarget target) { target.appendJavascript(new Effect.Fade(this).toJavascript()); } }; form.add(al); al.add(stimg); ... HTML: ... # div /pics/fehler_404_gross.jpeg /div The Wicket Ajax Debug Window shows: INFO: Response parsed. Now invoking steps... ERROR: Exception evaluating javascript: ReferenceError: Effect is not defined INFO: Response processed successfully. i´m using apache-wicket-1.3.0-beta3 and wicketstuff-scriptaculous-1.3-20070924.212110-2.jar. i tried also with wicket-contrib-scriptaculous-0.1.1.jar and wicketstuff-scriptaculous-1.3-20070911.130143-1.jar What am i doing wrong. Can anyone help? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with scriptaculous in wicket 1.3 beta3
Yep, you need to also do: add(AbstractScriptaculousBehavior.newJavascriptBinding()); On 10/31/07, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: Probably your are missing a HeaderContributor adding the actual effects.js and prototype.js to your page? Just guessing... SantiagoA wrote: Hi, i try to use the Effect class of the scriptaculous jar in a testApp. My Code: Java: import org.wicketstuff.scriptaculous.effect.Effect; ... final StaticImage stimg = new StaticImage(fehler); AjaxLink al = new AjaxLink(clickImg) { private static final long serialVersionUID = 0L; @Override public void onClick(AjaxRequestTarget target) { target.appendJavascript(new Effect.Fade(this).toJavascript()); } }; form.add(al); al.add(stimg); ... HTML: ... # div /pics/fehler_404_gross.jpeg /div The Wicket Ajax Debug Window shows: INFO: Response parsed. Now invoking steps... ERROR: Exception evaluating javascript: ReferenceError: Effect is not defined INFO: Response processed successfully. i´m using apache-wicket-1.3.0-beta3 and wicketstuff-scriptaculous-1.3-20070924.212110-2.jar. i tried also with wicket-contrib-scriptaculous-0.1.1.jar and wicketstuff-scriptaculous-1.3-20070911.130143-1.jar What am i doing wrong. Can anyone help? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with scriptaculous in wicket 1.3 beta3
Excuse me the HTML should look like: ... lt;a href=# wicket:id=clickImggt; lt;divgt; lt;img wicket:id=fehler src=/pics/fehler_404_gross.jpeg border=none /gt; lt;/divgt; lt;/agt; -- View this message in context: http://www.nabble.com/Problem-with-scriptaculous-in-wicket-1.3-beta3-tf4725430.html#a13510547 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function(){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); // The following code seems useless, and then is commented out // get the elements to be added //var elements = new Array(); //for (var i = 0; i fragment.childNodes.length; ++i) //elements.push(fragment.childNodes[i]); // move additional subnodes to the correct place in the dom if (fragment.childNodes.length 1) { // the for clause intentionally starts from 1, // to fix only the wrongly hanging subnodes. for (var i = 1; i fragment.childNodes.length; ++i) { var otherNode = fragment.childNodes[i]; fragment.childNodes[0].childNodes[0].appendChild(otherNode); } } element.parentNode.replaceChild(fragment, element); } } } window.setTimeout(replaceWicketReplaceOuterHtml, 1000); // -- Forwarded message -- From: Francisco Diaz Trepat - gmail [EMAIL PROTECTED] Date: Oct 23, 2007 10:27 PM Subject: Re: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario) To: users@wicket.apache.org Thanks Matej, I will but further ahead. I'll try to see what is going on with more detail by using FIREBUG toolbar or something of the sort. If everything
Re: Problem with scriptaculous in wicket 1.3 beta3
Thanks a lot, that was the solution! -- View this message in context: http://www.nabble.com/Problem-with-scriptaculous-in-wicket-1.3-beta3-tf4725430.html#a13511725 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tabbed panels
On 10/31/07, Alexander Landsnes Keül [EMAIL PROTECTED] wrote: I have two questions regarding tabbed panels. I've read the example, so I've been able to create a navigation with it but it's a bit limited. First thing, is it possible to nest tabbed panels? I tried to do so, but then all the wickets in the panels stopped working. Way I set it up was create a TabbedPanel where the different tabs referred to new TabbedPanels. Not really sure if this is doable, but if so how would I go about it, and is it possible to change the CSS style for the two tab panels? yes it is possible, but i dont think it will help much returning a tabbedpanel as the tab directly. instead return a panel that contains a tabbedpanel inside. this is also how you would style the inner panel differently, by wrapping it in a div tag with a class eg div class=tab1div wicket:id=tabs//div and style your panel like: tab1 ul.first-tab {...} Second thing, I tried to make a helper class for adding tabs to a Tabbed Panel. It works fine, except for the getPanel() overloading. I tried to do it as follows: public void addTab( final String label, final Panel tabPanel ) { tabs.add( new AbstractTab( new Model( label )) { private static final long serialVersionUID = 1L; public Panel getPanel( String panelID ) { return tabpanel; } }); } Simply changing it to return new PersondataPanel( panelID ); works, but this would mean creating one addTab(..) for each possible panel. Is there an elegant way of solving this? what you are doing is creating panels for tabs eagerly during construction time, which isnt the best way to go about it. the whole idea of having getpanel abstract in abstracttab is that it gives you the hint that panels should be created lazily inside the callback. -igor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to use LinkTree in frame
I've given this approach a try and it didn't work for me. I just did an override on my derived LinkTree's newLink method and returned a bookmarkable link regardless of link type: @Override public MarkupContainer newLink(String id, final ILinkCallback callback) { return new BookmarkablePageLink(id, Pro_Nav.class); } Changing the link type prevents the tree from working: expanding no longer works, probably because I've subverted the handlers that handle the tree expand icon. I really need simple links like this: # tree node link text I'm fairly new to Wicket, and I'm trying a number of approaches suggested in the archives, but have yet to find a solution that doesn't involve rewriting much of the LinkTree. How do I get there from here? Devin igor.vaynberg wrote: you have to override the method that generates the link and replace it with a BookmarkablePageLink -igor On 10/15/07, Kevin Liu [EMAIL PROTECTED] wrote: The question may be how ajaxLink be bookmarkable: the code below absolutely does not work fine: pageLink = new AjaxLink(id){ private static final long serialVersionUID = 3332246227467032288L; public void onClick(AjaxRequestTarget target){ //.. setResponsePage(Destination.class); updateTree(target); } }; pageLink.add(new AttributeModifier(target,true,new Model(right))); Kevin Liu [EMAIL PROTECTED] wrote: Could someone tell me how to use LinkTree in the left frame and the target of the links in the tree is the right frame?? Thanks a lot~ -Kevin Liu - Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. -Kevin Liu - Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. -- View this message in context: http://www.nabble.com/how-to-use-LinkTree-in-frame-tf4631486.html#a13512564 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to remove 'choose one' from dropdownlist?
If it is just a matter of not wanting to see the phrase Choose One but that you are ok with a empty value, you could use the null property value to change the default text. There is also a null.valid property that you can define for the case where a null value is valid (used in conjuntion with setNullValid(true) method). To use those properties, make a file can {you panel/page name}.properties and add lines to it like: null=Some default text null.valid=Some other text Chuck raybristol wrote: Thanks everyone! igor.vaynberg wrote: put an option into your model, that way it will be selected... or override getdefaultchoice() and return -igor On 10/30/07, raybristol [EMAIL PROTECTED] wrote: how to remove 'choose one' from dropdownlist? I can use the dropdownlist alright, populate data etc. but wicket always put a 'choose one' option on the top, I wonder if I can get rid of it? Many thanks! -- View this message in context: http://www.nabble.com/how-to-remove-%27choose-one%27-from-dropdownlist--tf4719338.html#a13491271 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/how-to-remove-%27choose-one%27-from-dropdownlist--tf4719338.html#a13515621 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Browser back button and Wizard
Hi, it's me again, and I'm still struggling with the Wizard component. :) When pressing the browser's back button on the let's say third WizardStep of a Wizard, the browser returns to the first WizardStep instead of the previous (the second) one. This is a very unintuitive behavior, especially for unexperienced users. Is there a way to enable browser back button support for a Wizard? I'm using Wicket 1.3.0-beta4. Thanks again for your help! Cheers Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function(){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); // The following code seems useless, and then is commented out // get the elements to be added //var elements = new Array(); //for (var i = 0; i fragment.childNodes.length; ++i) //elements.push(fragment.childNodes[i]); // move additional subnodes to the correct place in the dom if (fragment.childNodes.length 1) { // the for clause intentionally starts from 1, // to fix only the wrongly hanging subnodes. for (var i = 1; i fragment.childNodes.length; ++i) { var otherNode = fragment.childNodes[i]; fragment.childNodes[0].childNodes[0].appendChild(otherNode); } } element.parentNode.replaceChild(fragment, element); } } } window.setTimeout(replaceWicketReplaceOuterHtml, 1000); //
Re: Dynamically Change css style of body tag
Tnx! Igor, it works! Jurjan igor.vaynberg wrote: hava you tried this? body wicket:id=foo... add(new webmarkupcontainer(body) { boolean istransparentresolver() { return true; } oncomponenttag(tag) { tag.put(class,green); }); -igor On 10/31/07, Jurjan [EMAIL PROTECTED] wrote: Hi, I'm trying to dynamically change the CSS class of the body tag depending on the context. body class=detailpage theme01 In my page class I'm using the BodyTagAttributeModifier to implement this behavior, but this is not currect. Obviously I'm mising something, but what? final Theme theme = outing.getMainTheme(); add(new BodyTagAttributeModifier(class, true, new AbstractReadOnlyModel(){ @Override public Object getObject() { return theme.getDisplaystyle(); } }, this)); Thanks in advance, Jurjan -- View this message in context: http://www.nabble.com/Dynamically-Change-css-style-of-body-tag-tf4723877.html#a13505908 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Dynamically-Change-css-style-of-body-tag-tf4723877.html#a13516764 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stateless page and Pragma no-cache
Override Page.configureResponse() and add the flags you want there. -Matej On 10/31/07, John Patterson [EMAIL PROTECTED] wrote: Hi, I notice that Pragma no-cache is set for every WebPage and I cannot see how I can turn it off for my bookmarkable stateless pages could would benefit from being cached. Cheers, John - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function(){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); // The following code seems useless, and then is commented out // get the elements to be added //var elements = new Array(); //for (var i = 0; i fragment.childNodes.length; ++i) //elements.push(fragment.childNodes[i]);
Re: Just 1 hour to introduce Wicket (Friday)
As always on this forum we have managed to come up with some really helpful information and ideas in double quick time! Thanks for all the input ... I will now merge everything in with my original thoughts and see what I can realistically expect to cover in 1 hour. I also hope this bag of ideas will be useful to others who want to see Wicket get the support it deserves and/or those who are trying to convince their PMs/teams that there really is a better way to develop web apps and how much sense it makes (in terms of $s, quality and job satisfaction, on top of all the technical stuff brought up in this thread). Any more thoughts are obviously more than welcome, but either way, I hope to post about how it goes soon (probably not until next week as Al and I are running the http://jweekend.co.uk/dev/JW703/ weekend Wicket course on Saturday and Sunday and then we have to prepare for the our http://jweekend.co.uk/dev/LWUGReg/ London Wicket Users Group event on Tuesday evening where I hope to talk about Trees in Wicket). Thanks again for all the high quality feedback. Regards - Cemal http://jWeekend.co.uk jWeekend.co.uk Jan Kriesten wrote: hi cemal, Not bad for an hour, but there are probably even more essentials that need to be mentioned at least. What have we missed? i find a key selling point to customers that you can easily run unit-tests on your projects - especially if the customers are in banking business. also, wicket's secure by default, so that might count, too. :-) when i did my presentation, it came out that presenting a more complex example showed the 'big picture' with wicket. so you might not want to implement a small ajax-component but show an integrated one and show how it's implemented and (re)used in the application, same for behaviours (e.g. JavascriptEventConfirmation in onclick). This saves you presentation time and you get a bigger 'ah!'. best regards, --- jan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Just-1-hour-to-introduce-Wicket-%28Friday%29-tf4721724.html#a13517074 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mvn netbeans:netbeans command for QuickStart Project
Hi I just downloaded the maven 2.0.7 and ran the *mvn archetype:create -DarchetypeGroupId=org.apache.wicket* then ran the *mvn netbeans:netbeans* inside the project to get a Netbeans project. And got an error. I am very new to maven and I was wondering if some one could help me out. I know there is a thing going on with the netbeans plugin but how may I solve it. When googled I got 3 result. f(t) *mvn netbeans:netbeans CONSOLE OUTPUT* $ mvn -e netbeans:netbeans + Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'netbeans'. [INFO] [ERROR] BUILD ERROR [INFO] [INFO] The plugin 'org.apache.maven.plugins:maven-netbeans-plugin' does not exist or no valid version could be found [INFO] [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: The plugin ' org.apache.maven.plugins:maven-netbeans-plugin' does not exist or no valid version could be found at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin( DefaultLifecycleExecutor.java:1286) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor( DefaultLifecycleExecutor.java:1522) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds (DefaultLifecycleExecuto r.java:386) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( DefaultLifecycleExecutor.java:138) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java :315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java :430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-ne tbeans-plugin' does not exist or no valid version could be found at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion (DefaultPluginVersionManager. java:228) at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion (DefaultPluginVersionManager. java:90) at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin( DefaultPluginManager.java:166) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin( DefaultLifecycleExecutor.java:1257) ... 14 more [INFO] [INFO] Total time: 1 second [INFO] Finished at: Wed Oct 31 16:37:20 GMT-03:00 2007 [INFO] Final Memory: 1M/4M [INFO] *mvn archetype:create -DarchetypeGroupId=org.apache.wicket CONSOLE OUTPUT* $ mvn archetype:create -DarchetypeGroupId=org.apache.wicket-DarchetypeArtifactId=wicket-archetype-quickstart -Darchety peVersion=1.3.0-beta4 -DgroupId=ch.logismata-DartifactId=GeckoEnginePanelReplacementBug_QS [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:create] (aggregator-style) [INFO] [INFO] Setting property: classpath.resource.loader.class = ' org.codehaus.plexus.velocity.ContextClassLoaderResourceLoad er'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] ** [INFO] Starting Jakarta Velocity v1.4 [INFO] RuntimeInstance initializing. [INFO] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl) [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader [INFO] ClasspathResourceLoader : initialization starting. [INFO] ClasspathResourceLoader : initialization complete. [INFO] ResourceCache : initialized. (class
Re: BUG: Ajax Panel Replacement Issue on Fireforx only (Kind of Complex Scenario)
Well, it's the last resort for you, but first resort for me :) Issues that are easily reproduce (quickstart) can expect to be resolved sooner, that's how it works. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Ok I wanted to leave the QuickStart the last resort. I'll get right on it. Jira + QuickStart. We must all contribute. :-) f(t) On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: So even better than html page would be a quickstart attched to jira issue that you create about this problem :-) Cheers, -Matej On 10/31/07, Matej Knopp [EMAIL PROTECTED] wrote: Hi, I got your point. But I need a complete html file to be able to reproduce it with as little effort as possible :) My time is quite limited lately :( I don't mind fixing this in wicket, but I need to make sure that this is the right fix and has no side-effect. -Matej On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi Matej. Have you read the the forwarded part of the last message? Because that is where I explained the behavior. Basically in Firefox if I replace a panel with two subpanels the second subpanel doesn't get replaced. Please check out the message bellow, the one I forwarded. If you see the org/apache/wicket/ajax/wicket-ajax.js in wicket-1.3.0-beta4.jar. You will see the code for the * Wicket.replaceOuterHtml* In there, I understand that there are two main things going on: 1) There is some code that it is not used and so, in our version we commented it. 2) And most important, we fixed a the issue for us by moving the nodes in the tree herarchy that appears wrongly in the get * range.createContextualFragment*() function from the Gecko (firefox) engine. If there are many subpanels, the range uncorrectly parses the content, resulting in a fragment that contains many childs instead of one. The HTML is explained bellow, if that explanation fails I'll try to send you a file. ok? Our function basically call the *Wicket.replaceOuterHtml=function(){ blah, blah* to replace the one in the framework with the fixed one. And we call the replacement on a window.setTimeOut() on the specific page in which we have the panel with subpanels. thanks, f(t) On 10/30/07, Matej Knopp [EMAIL PROTECTED] wrote: Sorry, I'm not sure I follow. there is some code in replaceOuterHtml that seems redundant so it could be like this: Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } } Still I'm not sure what the problem is that your code solves. Can you please provide me a html file where the replaceOuterHtml call fails? -Matej Francisco Diaz Trepat - gmail wrote / napísal(a): Hi a cowerker here might have found something here. We have fix the issue by replacing the *Wicket.replaceOuterHtml* function. Could this be a BUG? I have forwarded the initial message that explains the behavior. Here is the code that fixed our problem: f(t) // // Hack that demonstrates a possible fix for a problem with Gecko based browsers. // The problem happens in this line: //var fragment = range.createContextualFragment(text); // If there are many subpanels, the range uncorrectly parses the content, resulting // in a fragment that contains many childs instead of one. // The first child is the first subpanel, and the rest are the other subpanels, // which are incorrectly hang at the same level as the main panel, instead of being // childs of it. function replaceWicketReplaceOuterHtml() { Wicket.replaceOuterHtml = function(element, text) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange();
Re: enclosure and repeater
On Monday 29 October 2007 22:30:57 skatz wrote: Is there a way to get an enclosure to work with a repeater. Perhaps I am missing something, but I can't get: ... ul class=someclass wicket:enclosure child=item li wicket:id=repeater /li /wicket:enclosure /ul to work. What I get is an exception telling me there is no component matching item. Enclosure can switch visibility depending only on one component, but repeater can create a lot of items. It won't work this way. You can make enclosure use specific child component using something like wicket:enclosure child=repeater:markupContainer:item. Dima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mvn netbeans:netbeans command for QuickStart Project
Netbeans has a module for direct maven support. I think you can download it in the plugin manager (I tried it once and that worked great, but I still didn't like netbeans). Martijn On 10/31/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hi I just downloaded the maven 2.0.7 and ran the *mvn archetype:create -DarchetypeGroupId=org.apache.wicket* then ran the *mvn netbeans:netbeans* inside the project to get a Netbeans project. And got an error. I am very new to maven and I was wondering if some one could help me out. I know there is a thing going on with the netbeans plugin but how may I solve it. When googled I got 3 result. f(t) *mvn netbeans:netbeans CONSOLE OUTPUT* $ mvn -e netbeans:netbeans + Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'netbeans'. [INFO] [ERROR] BUILD ERROR [INFO] [INFO] The plugin 'org.apache.maven.plugins:maven-netbeans-plugin' does not exist or no valid version could be found [INFO] [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: The plugin ' org.apache.maven.plugins:maven-netbeans-plugin' does not exist or no valid version could be found at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin( DefaultLifecycleExecutor.java:1286) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor( DefaultLifecycleExecutor.java:1522) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds (DefaultLifecycleExecuto r.java:386) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( DefaultLifecycleExecutor.java:138) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java :315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java :430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-ne tbeans-plugin' does not exist or no valid version could be found at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion (DefaultPluginVersionManager. java:228) at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion (DefaultPluginVersionManager. java:90) at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin( DefaultPluginManager.java:166) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin( DefaultLifecycleExecutor.java:1257) ... 14 more [INFO] [INFO] Total time: 1 second [INFO] Finished at: Wed Oct 31 16:37:20 GMT-03:00 2007 [INFO] Final Memory: 1M/4M [INFO] *mvn archetype:create -DarchetypeGroupId=org.apache.wicket CONSOLE OUTPUT* $ mvn archetype:create -DarchetypeGroupId=org.apache.wicket-DarchetypeArtifactId=wicket-archetype-quickstart -Darchety peVersion=1.3.0-beta4 -DgroupId=ch.logismata-DartifactId=GeckoEnginePanelReplacementBug_QS [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:create] (aggregator-style) [INFO] [INFO] Setting property: classpath.resource.loader.class = ' org.codehaus.plexus.velocity.ContextClassLoaderResourceLoad er'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] ** [INFO] Starting Jakarta Velocity v1.4 [INFO] RuntimeInstance initializing. [INFO] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties [INFO]
wicket:enclosure and authorization
Hi, I have a main menu with an admin link which only renders when the user has the ADMIN role (MainMenu.java): final BookmarkablePageLink adminLink = new BookmarkablePageLink(adminLink, AdminHomePage.class); MetaDataRoleAuthorizationStrategy.authorize(adminLink, RENDER, ADMIN); add(adminLink); In my MainMenu.html I have: wicket:enclosure id=adminLink li a wicket:id=adminLinkAdministratie/a /li /wicket:enclosure I was hoping that when the admin link is not rendered due to the user not having the proper role, that the li/li would also not be rendered, however, it does not seem to work this way... Is this not the way I'm supposed to do this? Or should this work? Otherwise, what is the right way to go about this? Thanks in advance, Sebastiaan smime.p7s Description: S/MIME Cryptographic Signature
Re: wicket:enclosure and authorization
enclosures work on the visibility level, not render level. since your adminlink is visible, but its rendering is aborted the enclosure still shows the content. to do this you have to put the link into a webmarkupcontainer, and authorize that container instead of a link. -igor On 10/31/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Hi, I have a main menu with an admin link which only renders when the user has the ADMIN role (MainMenu.java): final BookmarkablePageLink adminLink = new BookmarkablePageLink(adminLink, AdminHomePage.class); MetaDataRoleAuthorizationStrategy.authorize(adminLink, RENDER, ADMIN); add(adminLink); In my MainMenu.html I have: wicket:enclosure id=adminLink li a wicket:id=adminLinkAdministratie/a /li /wicket:enclosure I was hoping that when the admin link is not rendered due to the user not having the proper role, that the li/li would also not be rendered, however, it does not seem to work this way... Is this not the way I'm supposed to do this? Or should this work? Otherwise, what is the right way to go about this? Thanks in advance, Sebastiaan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mvn netbeans:netbeans command for QuickStart Project
Francisco Diaz Trepat - gmail wrote: Hi I just downloaded the maven 2.0.7 and ran the *mvn archetype:create -DarchetypeGroupId=org.apache.wicket* then ran the *mvn netbeans:netbeans* inside the project to get a Netbeans project. And got an error. That's because there is no such plug-in. RTFM here: http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html Regards, Al - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket:enclosure and authorization
Hi, OK, figured it might be something like this! Thanks for the fast reply. :-) Regards, Sebastiaan Igor Vaynberg wrote: enclosures work on the visibility level, not render level. since your adminlink is visible, but its rendering is aborted the enclosure still shows the content. to do this you have to put the link into a webmarkupcontainer, and authorize that container instead of a link. -igor On 10/31/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Hi, I have a main menu with an admin link which only renders when the user has the ADMIN role (MainMenu.java): final BookmarkablePageLink adminLink = new BookmarkablePageLink(adminLink, AdminHomePage.class); MetaDataRoleAuthorizationStrategy.authorize(adminLink, RENDER, ADMIN); add(adminLink); In my MainMenu.html I have: wicket:enclosure id=adminLink li a wicket:id=adminLinkAdministratie/a /li /wicket:enclosure I was hoping that when the admin link is not rendered due to the user not having the proper role, that the li/li would also not be rendered, however, it does not seem to work this way... Is this not the way I'm supposed to do this? Or should this work? Otherwise, what is the right way to go about this? Thanks in advance, Sebastiaan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME Cryptographic Signature
Re: wicket:enclosure and authorization
there seems to be a bit of a disconnect between render in auth and our general component visibility concept. perhaps it might be an improvement to aligh auth strategy with visibility rather then render...what do others think? -igor On 10/31/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Hi, OK, figured it might be something like this! Thanks for the fast reply. :-) Regards, Sebastiaan Igor Vaynberg wrote: enclosures work on the visibility level, not render level. since your adminlink is visible, but its rendering is aborted the enclosure still shows the content. to do this you have to put the link into a webmarkupcontainer, and authorize that container instead of a link. -igor On 10/31/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Hi, I have a main menu with an admin link which only renders when the user has the ADMIN role (MainMenu.java): final BookmarkablePageLink adminLink = new BookmarkablePageLink(adminLink, AdminHomePage.class); MetaDataRoleAuthorizationStrategy.authorize(adminLink, RENDER, ADMIN); add(adminLink); In my MainMenu.html I have: wicket:enclosure id=adminLink li a wicket:id=adminLinkAdministratie/a /li /wicket:enclosure I was hoping that when the admin link is not rendered due to the user not having the proper role, that the li/li would also not be rendered, however, it does not seem to work this way... Is this not the way I'm supposed to do this? Or should this work? Otherwise, what is the right way to go about this? Thanks in advance, Sebastiaan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket:enclosure and authorization
On 10/31/07, Igor Vaynberg [EMAIL PROTECTED] wrote: there seems to be a bit of a disconnect between render in auth and our general component visibility concept. perhaps it might be an improvement to aligh auth strategy with visibility rather then render...what do others think? Yeah. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stateless page and Pragma no-cache
That is already overridden by WebPage which adds the headers. It also calls super which looks necessary. So how can I override this but still have the Page.configureResponse() called? On 31 Oct 2007, at 13:20, Matej Knopp wrote: Override Page.configureResponse() and add the flags you want there. -Matej On 10/31/07, John Patterson [EMAIL PROTECTED] wrote: Hi, I notice that Pragma no-cache is set for every WebPage and I cannot see how I can turn it off for my bookmarkable stateless pages could would benefit from being cached. Cheers, John - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Disabling Wicket Ajax Debug in browser
Hi I am new to wicket. I using Ajax autocomplete text field. It is working well. But i want to disable Wicket Ajax Debug. where i have to set wicketajaxdebug = false i am not having wicket-ajax-debug.js file can any one help me Thanks in Advance Madhavi -- View this message in context: http://www.nabble.com/Disabling-Wicket-Ajax-Debug-in-browser-tf4729498.html#a13523658 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]