Re: chrome + wicket ajax + back button = problem?
I had the same problem ... > Take a look at > http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/ > isn't there a better fix? E.g. it seems to me that this 'hack' avoids client-side js caching (or is this a wrong observation)? Regards, Peter. -- http://jetwick.com twitter search prototype - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
Looks great, thanks for the link. +1 on CouchDB, et al vs only DB4o, Wicket+Scala+Couch is a really nice stack Thanks On 9/21/10 11:42 PM, Thomas Kappler wrote: On 09/22/10 03:41, Sam Stainsby wrote: Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: http://sustainablesoftware.com.au/blog/?p=77 "I’m pleased to announce a new web application framework, called Granite, and an associated set of reusable libraries, called Uniscala. Please note that this is a work in progress: we are not announcing a release yet, or even a beta. A number people have started asking about the project, and so I felt it would be helpful to let the wider world know what is going on." "Granite is a lightweight framework for the rapid development of web applications. It is based on the very cool and richly featured Apache Wicket web framework. Granite uses an embedded object database that avoids the need for SQL or Object-Relational Mappers (ORMs), and, in the Wicket tradition, is proud of, if not smug about, its distinct lack of external XML configuration files." Hey, I find that quite exciting. Now that you've done the hard work of fitting a non-relational store into a Wicket-based framework, do you think it would be hard to substitute other data stores such as Redis, CouchDB, BDB for DB4O? -- Thomas - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Making a DecoratedButton; Need to pre-fix/post-fix tag around the button component
Hi Guys, I am trying to make a reusable DecoratedButton component (extension of wicket Button), which would draw itself with appropriate icon, color, and other styles, based on the provided ButtonType, an enum e.g. 'Save', 'Edit', 'Delete', 'Search', 'Cancel' etc... I am trying to find solution to; how to encapsulate the html (associated with the button) in the form of wicket component to get the desired look & feel. The html that represents the button is as below: ./resources/Save.png Save The html-button as you see above is encapsulated in a '' tag. The Button component (DecoratedButton) I am making, I want the user to use the html tag to attach the component to (instead of using which is the container tag in my implementation), as that is only intuitive, when using a Button component. Ok, so here is my question, how can i prefix/post-fix tag or any other tag, around the html tag to which the new DecoratedButton component will be attached to. I did think about the option of renaming the '' tag to '' using setName in OnComponentTag() method, and than appending/injecting the remaining html within it (e.g. the Button itself). But than what if the user has any other behaviors/style/attributes attached to the button component, how would gather all those attributes from it to the new button tag html i inject with the ..? It doesn't seem like the right way to go ? Any ideas/thoughts ? Thanks in advance, Farhan. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Making-a-DecoratedButton-Need-to-pre-fix-post-fix-div-tag-around-the-button-component-tp2552950p2552950.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: The Long, Long Dependency Trail
Thanks very much all for your helpful replies. I'll try to answer all at once: Josh, I'm using Hibernate 3.5.6-Final. I'm going to clean out my .m2 repository of the Hibernate stuff, then try Bas' suggestion and see if it works without me having to manually install the jars to my local repository as I've done. Martijn, that sounds like a good suggestion in a sense, but I'm honestly trying to keep things as simple as possible (for future maintainability given I might not be the one working on this project next year), so hopefully I'll be able to get a pom.xml file together that does everything necessary without needing any local manager. But that's a good idea for my own stuff (i.e., at home) so I might give that a try. Thanks. Sebastian, just yesterday I tried letting Eclipse manage my dependencies using Maven (since this project uses Maven) and it seems sensible enough, just a different process and place to look to manage my external libraries. Thomas, prior to this project I used Ant exclusively, so that kind of thing is certainly the way to go, and it scales fine to lots of jars. You can get pretty tricky with Ant, and it's great for managing the jar/war metadata, signing jars, etc., lots of things I don't know how to do in Maven (assuming they call can be done -- this remains to be seen). Don, I've been tempted to looking into Ivy for a long time, and if it weren't for the fact that the Wicket project seems pretty Maven-centric (even acknowledging that they state that Maven is not strictly required), I'd probaby go back to Ant and use Ivy for my dependencies. I still may in the end. As I mentioned above, there's things I know how to do in Ant that I may want to accomplish without having to learn how in Maven. I still think Ant is pretty amazing really. With Ivy it might be a complete solution for me (I'm not one to use new software just because it's a popular fad, unless it's actually an improvement over what I'm already doing). Finally, thanks Nino, it turns out that I actually did use an archetype to generate the beginnings of this project, which is certainly one thing in Maven I do like. Postscript: I added the maven repository as suggested by Bas, backed all the Databinder stuff back to 1.3.0 so that I didn't need the SNAPSHOTs (and thereby fixed a bug due to a class that is no longer used), and stopped trying to use AuthDataApplication as my base class (using just DataApplication) since I'm using wicket-auth-roles and already had my own role-based auth classes in place. So now it works and has Hibernate and Databinder in the app. Next step: start building the database classes. Thanks all, this was very helpful. Ichiro - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: chrome + wicket ajax + back button = proble m?
Doesn't it make more sense to override WebPage's setHeaders(WebResponse) method? You get the response as a param instead of pulling it from the request cycle and the method name is just right. _ From: Richard Nichols [mailto:r...@visural.com] To: users@wicket.apache.org Sent: Thu, 23 Sep 2010 17:47:24 -0400 Subject: Re: chrome + wicket ajax + back button = problem? Take a look at http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/ On Wed, Sep 22, 2010 at 12:58 PM, Ryan Crumley wrote: > All, > > I ran into strange behavior involving wicket ajax updates + chrome + back > button. I am pretty sure the issue is not caused by wicket but I am hoping > the problem might sound familiar to someone and they can point me in the > right direction. The scenario goes like this: > > - An ajax request is made that updates the DOM. > - The user navigates to another page by clicking on a link. > - The user uses the browser back button to go back to the original page. > > After clicking back Google Chrome shows the page as it was originally > rendered (before the DOM update). All other browsers show the page as it > was > when the user left the page (with the DOM update). Besides the possibility > of showing stale data the other problem is that the page state has been > altered by the ajax request and links that were originally rendered may no > longer be valid. > > I found a few links where people are having similar issues: > > > http://www.maintaino.com/nuts-and-bolts/2010/04/08/teaching-chrome-not-to-cache-your-rails-pages/ > > Possibly related to using jQuery and/or window.onUnload() and "bfcache": > > > http://stackoverflow.com/questions/158319/cross-browser-onload-event-and-the-back-button > https://developer.mozilla.org/En/Using_Firefox_1.5_caching > > In addition to using Wicket 1.4.12 I am also using jQuery 1.4.2 and google > analytics on these pages. I don't think any unload handlers have been added > however my only check was looking at all the attributes on the "window" > object via the inspector. > > Has anyone else seen similar behavior? Even better, anyone else have a > solution? You may be seeing errors like this one in your logs: > > org.apache.wicket.protocol.http.request.InvalidUrlException: > org.apache.wicket.WicketRuntimeException: component wid1:wid2:1:wid3 not > found on page com.foo.xxx > > > Thanks! > > Ryan > -- Richard Nichols http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
Re: chrome + wicket ajax + back button = problem?
Take a look at http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/ On Wed, Sep 22, 2010 at 12:58 PM, Ryan Crumley wrote: > All, > > I ran into strange behavior involving wicket ajax updates + chrome + back > button. I am pretty sure the issue is not caused by wicket but I am hoping > the problem might sound familiar to someone and they can point me in the > right direction. The scenario goes like this: > > - An ajax request is made that updates the DOM. > - The user navigates to another page by clicking on a link. > - The user uses the browser back button to go back to the original page. > > After clicking back Google Chrome shows the page as it was originally > rendered (before the DOM update). All other browsers show the page as it > was > when the user left the page (with the DOM update). Besides the possibility > of showing stale data the other problem is that the page state has been > altered by the ajax request and links that were originally rendered may no > longer be valid. > > I found a few links where people are having similar issues: > > > http://www.maintaino.com/nuts-and-bolts/2010/04/08/teaching-chrome-not-to-cache-your-rails-pages/ > > Possibly related to using jQuery and/or window.onUnload() and "bfcache": > > > http://stackoverflow.com/questions/158319/cross-browser-onload-event-and-the-back-button > https://developer.mozilla.org/En/Using_Firefox_1.5_caching > > In addition to using Wicket 1.4.12 I am also using jQuery 1.4.2 and google > analytics on these pages. I don't think any unload handlers have been added > however my only check was looking at all the attributes on the "window" > object via the inspector. > > Has anyone else seen similar behavior? Even better, anyone else have a > solution? You may be seeing errors like this one in your logs: > > org.apache.wicket.protocol.http.request.InvalidUrlException: > org.apache.wicket.WicketRuntimeException: component wid1:wid2:1:wid3 not > found on page com.foo.xxx > > > Thanks! > > Ryan > -- Richard Nichols http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
Re: Removing jsessionid from URl
Hi, check this http://markmail.org/thread/u42f6idu2hsdulom 2010/9/22 Ayodeji Aladejebi > Hi, > > I have been tryin to figure out what to do to remove jsessionid from the > URL > > I have mount(new QueryStringUrlCodingStrategy("/home", AppHomePage.class)); > > All my links are BookmarkablePageLinks. > > am using wicket 1.4.8 on Apache Tomcat/6.0.29 > -- S pozdravem Vojtěch Krása
Re: StackOverFlowError
Hello, Pages are serialized at the end of the request cycle (this includes at the end of ajax requests) Look at AbstractPageStore.serializePage(...) Specificically the call to Objects.objectToByteArray(page.getPageMapEntry()) which turns the page into a bytearray. http://grepcode.com/file/repo1.maven.org/maven2/org.apache.wicket/wicket/1.4.10/org/apache/wicket/protocol/http/pagestore/AbstractPageStore.java#AbstractPageStore.serializePage%28org.apache.wicket.Page%29 Regards, Mike When exactly does a page get serialized/serialized? On Thu, Sep 23, 2010 at 12:54 PM, Igor Vaynbergwrote: in dev serialization should happen just like in production. -igor On Thu, Sep 23, 2010 at 10:34 AM, Douglas Ferguson wrote: Hey guys, We overwrote "IObjectStreamFactory" with a copy that has more logging and we found the object that is causing the problems in our production logs. Now we need to recreate it in a more controlled environment. How could we force serialization of this object in a dev environmental? D/ On Wed, Sep 22, 2010 at 6:23 PM, Andreas Petersson i had a very similar problem occuring in production when where was a cluster failover. i could never reproduce it. did something strange happen to you like, the filesystem was partially wiped during writing? - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Saving a component in session
You really don't want to save a component in a session. A component has its own lifecycle, tied to pagerequests, and its own scope tied to its parent components and the page it is part of. From what I understand of your story, what you should do is write your own component that wraps a Label or an AjaxEditLabel depending on some condition/mode. This is very easy to make with wicket. On Thu, 23 Sep 2010 13:24 +0300, "Mihai Postelnicu" wrote: > Guys, > I work on the same project as below (integrating an interface translator > with Wicket) and we are a bit stuck. Any ideas? > > Thanks in advance for your time ! > Mihai > > On 09/23/2010 12:29 PM, Alexandru Artimon wrote: > > Forgot to mention that the component is an AjaxEditableLabel and I > > need to save it to session because I'm creating a custom wicket tag > > for translation purposes. When in translator mode I want all the > > labels to be replaced by AjaxEditableLabel's so that the translator > > can do his job easier. > > > > The problem I have is that when I click on the label of the > > AjaxEditableLabel, it produces an ajax request in order to change > > visibility modes and show the edit box. I did my custom tag replacing > > by implementing an IComponentResolver, which (from what I figured) > > happens on render. So my AjaxEditableLabel component isn't in the page > > when the Ajax request arrives. I planned to solve this by fetching the > > missing component from the session on my own, by overwriting > > resolveListenerInterfaceTarget. Now when I fetch the original > > AjaxEditableLabel from the session, all it's children (the Label and > > TextField) are gone. > > > > Any ideas will be much appreciated. > > > > Thanks, > > Alexandru > > > > > > > > On 09/23/2010 11:57 AM, Alexandru Artimon wrote: > >> Hello, > >> > >> I have a problem when saving a component to the session, all it's > >> children disappear. > >> I do the save like this: > >> > >> session.bind(); > >> session.setMetaData(MY_KEY, component); > >> > >> > >> Regards, > >> Alexandru > > > > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: StackOverFlowError
at the end of request -igor On Thu, Sep 23, 2010 at 11:55 AM, Douglas Ferguson wrote: > When exactly does a page get serialized/serialized? > > On Thu, Sep 23, 2010 at 12:54 PM, Igor Vaynberg > wrote: > >> in dev serialization should happen just like in production. >> >> -igor >> >> On Thu, Sep 23, 2010 at 10:34 AM, Douglas Ferguson >> wrote: >> > Hey guys, >> > >> > We overwrote "IObjectStreamFactory" with a copy that has more logging and >> we >> > found the object that is causing the problems in our production logs. Now >> we >> > need to recreate it in a more controlled environment. >> > >> > How could we force serialization of this object in a dev environmental? >> > >> > D/ >> > >> > On Wed, Sep 22, 2010 at 6:23 PM, Andreas Petersson > >wrote: >> > >> >> i had a very similar problem occuring in production when where was a >> >> cluster failover. i could never reproduce it. did something strange >> happen >> >> to you like, the filesystem was partially wiped during writing? >> >> >> >> >> >> - >> >> 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 >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Job opportunity in Tahiti
Our team is developing a new application using the following technologies : -Wicket -Hibernate -Portlet -Liferay So we are looking for a Java developer for 6 month. The project starts in October. You must at least be skilled in Java and Wicket. We will teach you the other technologies if needed. Our company has been using Java for 6 years and Wicket for 3 years now. As we are located in Tahiti, French Polynesia, you have to be fluent in French and allowed to work here (French or European citizen). Feel free to have a look at our web site : http://www.piti.pf www.piti.pf . Please, don't hesitate to PM me if you are interested. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Job-opportunity-in-Tahiti-tp2552526p2552526.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: StackOverFlowError
When exactly does a page get serialized/serialized? On Thu, Sep 23, 2010 at 12:54 PM, Igor Vaynberg wrote: > in dev serialization should happen just like in production. > > -igor > > On Thu, Sep 23, 2010 at 10:34 AM, Douglas Ferguson > wrote: > > Hey guys, > > > > We overwrote "IObjectStreamFactory" with a copy that has more logging and > we > > found the object that is causing the problems in our production logs. Now > we > > need to recreate it in a more controlled environment. > > > > How could we force serialization of this object in a dev environmental? > > > > D/ > > > > On Wed, Sep 22, 2010 at 6:23 PM, Andreas Petersson >wrote: > > > >> i had a very similar problem occuring in production when where was a > >> cluster failover. i could never reproduce it. did something strange > happen > >> to you like, the filesystem was partially wiped during writing? > >> > >> > >> - > >> 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: Setting Checked Boxes in CheckGroup
See http://wicket.apache.org/start/quickstart.html Use this to create a small application that exhibits the bug. Regards, Erik. Op 23-09-10 19:26, Shelli Orton schreef: What do you mean by "quickstart"? Shelli -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Thursday, September 23, 2010 10:57 AM To: users@wicket.apache.org Subject: Re: Setting Checked Boxes in CheckGroup im going to guess something is wrong with your model. hard to tell without a quickstart. -igor -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: StackOverFlowError
in dev serialization should happen just like in production. -igor On Thu, Sep 23, 2010 at 10:34 AM, Douglas Ferguson wrote: > Hey guys, > > We overwrote "IObjectStreamFactory" with a copy that has more logging and we > found the object that is causing the problems in our production logs. Now we > need to recreate it in a more controlled environment. > > How could we force serialization of this object in a dev environmental? > > D/ > > On Wed, Sep 22, 2010 at 6:23 PM, Andreas Petersson > wrote: > >> i had a very similar problem occuring in production when where was a >> cluster failover. i could never reproduce it. did something strange happen >> to you like, the filesystem was partially wiped during writing? >> >> >> - >> 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: StackOverFlowError
Hey guys, We overwrote "IObjectStreamFactory" with a copy that has more logging and we found the object that is causing the problems in our production logs. Now we need to recreate it in a more controlled environment. How could we force serialization of this object in a dev environmental? D/ On Wed, Sep 22, 2010 at 6:23 PM, Andreas Petersson wrote: > i had a very similar problem occuring in production when where was a > cluster failover. i could never reproduce it. did something strange happen > to you like, the filesystem was partially wiped during writing? > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
RE: Setting Checked Boxes in CheckGroup
What do you mean by "quickstart"? Shelli -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Thursday, September 23, 2010 10:57 AM To: users@wicket.apache.org Subject: Re: Setting Checked Boxes in CheckGroup im going to guess something is wrong with your model. hard to tell without a quickstart. -igor On Thu, Sep 23, 2010 at 9:25 AM, Shelli Orton wrote: > Does anybody have a suggestion for this? > > Thanks, > > Shelli > > -Original Message- > From: Shelli Orton > Sent: Wednesday, September 22, 2010 1:54 PM > To: users@wicket.apache.org > Subject: Setting Checked Boxes in CheckGroup > > Hi, > > I am trying to use a CheckGroup to manage which columns are used in a > datatable. I've set up my columns as per the code below. The > getColumnCheckBoxes method creates the check boxes that will be part of > the group. The getDefaultColumns defines which columns should be > checked by default. The default columns are being set, but the boxes > are not being displayed as "checked" when the page is first loaded. > However, the correct columns are being displayed in the datatable, so > they are being set "behind the scenes". > > How do I get them to display as checked on page load? > > Thanks in advance! > > Shelli > > CODE: > > public class HomePage extends WebPage > { > StringResourceModel columnA = new StringResourceModel("columnA", > this, > null); > StringResourceModel columnB = new StringResourceModel("columnB", > this, > null); > StringResourceModel columnC = new StringResourceModel("columnC", > this, > null); > StringResourceModel columnD = new StringResourceModel("columnD", > this, > null); > > ArrayList columnCheckBoxes = null; > > CheckGroup columnCheckGroup = new > CheckGroup("columnCheckGroup", > new ArrayList()); > > �...@suppresswarnings("rawtypes") > List columns = new ArrayList(); > > /** > * Constructor that is invoked when page is invoked without a > session. > * > * @param parameters Page parameters > */ > �...@suppresswarnings("rawtypes") > public HomePage(final PageParameters parameters) > { > �...@suppresswarnings("serial") > Form queryForm = new Form("queryForm") > { > �...@override > protected void onSubmit() > { > // do stuff > } > }; > > add(queryForm); > > // Create column selection boxes > columnCheckGroup.add(new > CheckGroupSelector("columnCheckGroupSelector")); > > �...@suppresswarnings({ "unchecked", "serial" }) > ListView checkBoxes = new ListView("columnCheckGroup", > getColumnCheckBoxes()) > { > �...@suppresswarnings("unchecked") > protected void populateItem(ListItem item) > { > item.add(new Check("columnCheckbox", item.getModel())); > item.add(new Label("displayValue", > new PropertyModel(item.getModel(), > "displayValue"))); > } > > }; > > if (columnCheckGroup.getModelObject().isEmpty()) > { > columnCheckGroup.setModelObject(this.getDefaultColumns()); > } > > columnCheckGroup.add(checkBoxes); > queryForm.add(columnCheckGroup); > > // more init stuff... > > } > > public ArrayList getColumnCheckBoxes() > { > if (columnCheckBoxes == null) > { > columnCheckBoxes = new ArrayList(); > > columnCheckBoxes.add(new SelectOption("columnA", > this.columnA.getObject())); > columnCheckBoxes.add(new SelectOption("columnB", > this.columnB.getObject())); > columnCheckBoxes.add(new SelectOption("columnC", > this.columnC.getObject())); > columnCheckBoxes.add(new SelectOption("columnD", > this.columnD.getObject())); > } > > return columnCheckBoxes; > } > > /* > By default, columns A and B are selected > */ > private ArrayList getDefaultColumns() > { > ArrayList defaultColumns = new > ArrayList(); > > defaultColumns.add(new SelectOption("columnA", > this.columnA.getObject())); > defaultColumns.add(new SelectOption("columnB", > this.columnB.getObject())); > > return defaultColumns; > } > > class SelectOption implements Serializable > { > private static final long serialVersionUID = 1L; > > private String propertyValue; > private String displayValue; > > /** > * Utility class for storing property and display values for > option > * widgets (e.g. drop down lists, check boxes). > */ > public SelectOption(String propertyValue, String displayValue) > { > this.propertyValue = propertyValue; > this.displayValue = displayValue; > } > > // getters/setters > } > } >
Re: Setting Checked Boxes in CheckGroup
im going to guess something is wrong with your model. hard to tell without a quickstart. -igor On Thu, Sep 23, 2010 at 9:25 AM, Shelli Orton wrote: > Does anybody have a suggestion for this? > > Thanks, > > Shelli > > -Original Message- > From: Shelli Orton > Sent: Wednesday, September 22, 2010 1:54 PM > To: users@wicket.apache.org > Subject: Setting Checked Boxes in CheckGroup > > Hi, > > I am trying to use a CheckGroup to manage which columns are used in a > datatable. I've set up my columns as per the code below. The > getColumnCheckBoxes method creates the check boxes that will be part of > the group. The getDefaultColumns defines which columns should be > checked by default. The default columns are being set, but the boxes > are not being displayed as "checked" when the page is first loaded. > However, the correct columns are being displayed in the datatable, so > they are being set "behind the scenes". > > How do I get them to display as checked on page load? > > Thanks in advance! > > Shelli > > CODE: > > public class HomePage extends WebPage > { > StringResourceModel columnA = new StringResourceModel("columnA", > this, > null); > StringResourceModel columnB = new StringResourceModel("columnB", > this, > null); > StringResourceModel columnC = new StringResourceModel("columnC", > this, > null); > StringResourceModel columnD = new StringResourceModel("columnD", > this, > null); > > ArrayList columnCheckBoxes = null; > > CheckGroup columnCheckGroup = new > CheckGroup("columnCheckGroup", > new ArrayList()); > > �...@suppresswarnings("rawtypes") > List columns = new ArrayList(); > > /** > * Constructor that is invoked when page is invoked without a > session. > * > * @param parameters Page parameters > */ > �...@suppresswarnings("rawtypes") > public HomePage(final PageParameters parameters) > { > �...@suppresswarnings("serial") > Form queryForm = new Form("queryForm") > { > �...@override > protected void onSubmit() > { > // do stuff > } > }; > > add(queryForm); > > // Create column selection boxes > columnCheckGroup.add(new > CheckGroupSelector("columnCheckGroupSelector")); > > �...@suppresswarnings({ "unchecked", "serial" }) > ListView checkBoxes = new ListView("columnCheckGroup", > getColumnCheckBoxes()) > { > �...@suppresswarnings("unchecked") > protected void populateItem(ListItem item) > { > item.add(new Check("columnCheckbox", item.getModel())); > item.add(new Label("displayValue", > new PropertyModel(item.getModel(), > "displayValue"))); > } > > }; > > if (columnCheckGroup.getModelObject().isEmpty()) > { > columnCheckGroup.setModelObject(this.getDefaultColumns()); > } > > columnCheckGroup.add(checkBoxes); > queryForm.add(columnCheckGroup); > > // more init stuff... > > } > > public ArrayList getColumnCheckBoxes() > { > if (columnCheckBoxes == null) > { > columnCheckBoxes = new ArrayList(); > > columnCheckBoxes.add(new SelectOption("columnA", > this.columnA.getObject())); > columnCheckBoxes.add(new SelectOption("columnB", > this.columnB.getObject())); > columnCheckBoxes.add(new SelectOption("columnC", > this.columnC.getObject())); > columnCheckBoxes.add(new SelectOption("columnD", > this.columnD.getObject())); > } > > return columnCheckBoxes; > } > > /* > By default, columns A and B are selected > */ > private ArrayList getDefaultColumns() > { > ArrayList defaultColumns = new > ArrayList(); > > defaultColumns.add(new SelectOption("columnA", > this.columnA.getObject())); > defaultColumns.add(new SelectOption("columnB", > this.columnB.getObject())); > > return defaultColumns; > } > > class SelectOption implements Serializable > { > private static final long serialVersionUID = 1L; > > private String propertyValue; > private String displayValue; > > /** > * Utility class for storing property and display values for > option > * widgets (e.g. drop down lists, check boxes). > */ > public SelectOption(String propertyValue, String displayValue) > { > this.propertyValue = propertyValue; > this.displayValue = displayValue; > } > > // getters/setters > } > } > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > >
Re: The Long, Long Dependency Trail
if I where you i'd go use one of the legup archetypes or wicket stuff iolite (although a bit outdated) and build on those, they provide the boilder plate so you dont have to write it. Use a artifact manager like nexus or artifactory.. As for the rest of it, I wrote an article here : http://ninomartinez.wordpress.com/2009/12/10/building-software-cheat-sheet/ 2010/9/23 Ichiro Furusato : > Hello, > > I've been working with Wicket for about a week now and things were > moving along all cruisy until I started adding Hibernate and > Databinder dependencies into my POM. Then all hell broke loose and I > seem to now find myself in the NoClassDefFoundError, then find and > manually install jar cycle. I mean, things with Wicket were just so, > well, SENSIBLE, and now I'm back in nightmare-programming-land again. > > In looking at some of the examples on the Web that combine Wicket and > Hibernate, they don't seem to be needing anywhere near the number of > dependencies I am now adding. I'm guessing I must be doing something > wrong, as I'm still pretty new to Maven, being a longstanding Ant > person. That I've had to manually install a whole bunch (6) of jars > seems a clue. Part of this may be due to the folks who wrote > Databinder using git rather than a maven repository (why oh why?!). > > My application extends net.databinder.auth.hib.AuthDataApplication so > that it can be an authenticating database application. I've attached > both the latest stack trace and my pom.xml file in hopes that some > kind soul can tell me where I've gone terribly wrong. Perhaps I'm > almost at the end of the dependency tunnel but I'm not yet seeing any > light yet. I'm guessing this is probably a blaringly obvious problem, > or maybe not a problem at all and I'm almost there. > > Thanks very much, > > Ichiro > > PS. BTW, I'm really enjoying Wicket so far; I haven't had this much > fun programming since HyperCard. I hope it's not significantly more > complicated a year or two from now than it is now. If the developer > team can keep to that ethos of simplicity Wicket will only gain in > popularity. Avoid the bloat. > > > - > 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: Setting Checked Boxes in CheckGroup
Does anybody have a suggestion for this? Thanks, Shelli -Original Message- From: Shelli Orton Sent: Wednesday, September 22, 2010 1:54 PM To: users@wicket.apache.org Subject: Setting Checked Boxes in CheckGroup Hi, I am trying to use a CheckGroup to manage which columns are used in a datatable. I've set up my columns as per the code below. The getColumnCheckBoxes method creates the check boxes that will be part of the group. The getDefaultColumns defines which columns should be checked by default. The default columns are being set, but the boxes are not being displayed as "checked" when the page is first loaded. However, the correct columns are being displayed in the datatable, so they are being set "behind the scenes". How do I get them to display as checked on page load? Thanks in advance! Shelli CODE: public class HomePage extends WebPage { StringResourceModel columnA = new StringResourceModel("columnA", this, null); StringResourceModel columnB = new StringResourceModel("columnB", this, null); StringResourceModel columnC = new StringResourceModel("columnC", this, null); StringResourceModel columnD = new StringResourceModel("columnD", this, null); ArrayList columnCheckBoxes = null; CheckGroup columnCheckGroup = new CheckGroup("columnCheckGroup", new ArrayList()); @SuppressWarnings("rawtypes") List columns = new ArrayList(); /** * Constructor that is invoked when page is invoked without a session. * * @param parameters Page parameters */ @SuppressWarnings("rawtypes") public HomePage(final PageParameters parameters) { @SuppressWarnings("serial") Form queryForm = new Form("queryForm") { @Override protected void onSubmit() { // do stuff } }; add(queryForm); // Create column selection boxes columnCheckGroup.add(new CheckGroupSelector("columnCheckGroupSelector")); @SuppressWarnings({ "unchecked", "serial" }) ListView checkBoxes = new ListView("columnCheckGroup", getColumnCheckBoxes()) { @SuppressWarnings("unchecked") protected void populateItem(ListItem item) { item.add(new Check("columnCheckbox", item.getModel())); item.add(new Label("displayValue", new PropertyModel(item.getModel(), "displayValue"))); } }; if (columnCheckGroup.getModelObject().isEmpty()) { columnCheckGroup.setModelObject(this.getDefaultColumns()); } columnCheckGroup.add(checkBoxes); queryForm.add(columnCheckGroup); // more init stuff... } public ArrayList getColumnCheckBoxes() { if (columnCheckBoxes == null) { columnCheckBoxes = new ArrayList(); columnCheckBoxes.add(new SelectOption("columnA", this.columnA.getObject())); columnCheckBoxes.add(new SelectOption("columnB", this.columnB.getObject())); columnCheckBoxes.add(new SelectOption("columnC", this.columnC.getObject())); columnCheckBoxes.add(new SelectOption("columnD", this.columnD.getObject())); } return columnCheckBoxes; } /* By default, columns A and B are selected */ private ArrayList getDefaultColumns() { ArrayList defaultColumns = new ArrayList(); defaultColumns.add(new SelectOption("columnA", this.columnA.getObject())); defaultColumns.add(new SelectOption("columnB", this.columnB.getObject())); return defaultColumns; } class SelectOption implements Serializable { private static final long serialVersionUID = 1L; private String propertyValue; private String displayValue; /** * Utility class for storing property and display values for option * widgets (e.g. drop down lists, check boxes). */ public SelectOption(String propertyValue, String displayValue) { this.propertyValue = propertyValue; this.displayValue = displayValue; } // getters/setters } } - 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: HeadersToolbar incompatible to other components than Label?
Works fine. Thanks a lot! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: HeadersToolbar incompatible to other components than Label?
instead of adding the checkbox directly wrap it in a panel. -igor On Thu, Sep 23, 2010 at 7:46 AM, Benedikt Schlegel wrote: > In short, i want to add a CheckGroupSelector instead of a Label. > So i guess i need a way to replace the markup of HeaderToolbar, > without rewriting the whole thing. > > Suggestions? > > - > 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: HeadersToolbar incompatible to other components than Label?
Well... most of the logic is in the constructor. So i have to copy the whole code from there and just make some little tweaks. Kinda ugly but now i realized that theres no other way. What a pity! Thanks anyway. 2010/9/23 Martin Grigorov : > Yes, you'll need to provide your own markup. > > MyToolbar extends HeaderToolbar { > // override the constroctor only > } > then provide MyToolbar.html which is modified version of HeaderToolbar.html > > On Thu, Sep 23, 2010 at 4:46 PM, Benedikt Schlegel < > codecab.dri...@googlemail.com> wrote: > >> In short, i want to add a CheckGroupSelector instead of a Label. >> So i guess i need a way to replace the markup of HeaderToolbar, >> without rewriting the whole thing. >> >> Suggestions? >> >> - >> 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: HeadersToolbar incompatible to other components than Label?
Yes, you'll need to provide your own markup. MyToolbar extends HeaderToolbar { // override the constroctor only } then provide MyToolbar.html which is modified version of HeaderToolbar.html On Thu, Sep 23, 2010 at 4:46 PM, Benedikt Schlegel < codecab.dri...@googlemail.com> wrote: > In short, i want to add a CheckGroupSelector instead of a Label. > So i guess i need a way to replace the markup of HeaderToolbar, > without rewriting the whole thing. > > Suggestions? > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: HeadersToolbar incompatible to other components than Label?
In short, i want to add a CheckGroupSelector instead of a Label. So i guess i need a way to replace the markup of HeaderToolbar, without rewriting the whole thing. Suggestions? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The Long, Long Dependency Trail
If you want to stick with Ant, try Ivy instead of Maven. It can read Maven pom files, and has a decent eclipse plug-in. On Sep 23, 2010, at 5:28 AM, Ichiro Furusato wrote: > . I'm guessing I must be doing something > wrong, as I'm still pretty new to Maven, being a longstanding Ant > person. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: noob question
sonoerin yahoo.com> writes: > > > customerA.domain.com > customerB.domain.com > > So I am not sure if its best to just have multiple deployments each with > their own Wicket Application/homepage or if there is a way to bundle them > all into a single app that handles each request/response based upon url (for > example). Hi sonoerin! It all depends on how your websites should interact with each other. If they are completely independent you should keep a wicket Application/homepage for each website. On the other hand if you websites should interact with each others, a common wicket Application could be a better choice. So if your websites should exchange some kind of session data (ex: user credentials) you should consider to bundle them into a single application and map each website on a different URL. However I don't know if Wicket let you map an application on different URL, maybe you should work on web server configuration. Bye! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The Long, Long Dependency Trail
On 09/23/10 14:28, Ichiro Furusato wrote: Hello, I've been working with Wicket for about a week now and things were moving along all cruisy until I started adding Hibernate and Databinder dependencies into my POM. Then all hell broke loose and I seem to now find myself in the NoClassDefFoundError, then find and manually install jar cycle. I mean, things with Wicket were just so, well, SENSIBLE, and now I'm back in nightmare-programming-land again. This will probably only apply to smaller projects, but I'd like to offer my experience as an example. I recently made a Wicket app with JPA, Hibernate, and Jetty not using any dependency manager at all. I downloaded the Jars from each project's website, put them into lib/, and made a very small Ant build.xml containing It worked without problems. Sometimes simple is better. Of course, if you need a ton of other libraries, it may get too complicated. -- Thomas -- --- Thomas Kapplerthomas.kapp...@isb-sib.ch Swiss Institute of Bioinformatics Tel: +41 22 379 51 89 CMU, rue Michel Servet 1 1211 Geneve 4 Switzerland http://www.uniprot.org --- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Saving a component in session
Yeah it's not what we need, that's why we are implementing some other. And also wicket:message doesn't have the ability to work in an "editor-mode". Alexandru On 09/23/2010 03:34 PM, Martin Grigorov wrote: I guess you are aware of ? On Thu, Sep 23, 2010 at 1:41 PM, Alexandru Artimon< aarti...@dgfoundation.org> wrote: Hello, This aproach didn't work for me. I tried first only adding an AjaxEditableLabel in my ComponentResolver, but once I clicked the label (in order to change into an edit box) wicket complained that it couldn't find the AjaxEditableLabel component in the Page. So that's how I ended up overwriting resolveListenerInterfaceTarget in order to resolve the AjaxEditableLabel. I couldn't return a new instance of it (because adding it to the page at this point seems difficult) so I thought to use the session. Our intended translation tag looks like this:[Here the default value for it]. We need something like this because we are porting an existing webapp to Wicket that has a similar mechanism now. Thanks, Alexandru On 09/23/2010 02:07 PM, Martin Grigorov wrote: I'm not sure why the children disappear but it looks odd to me to save component in the session in first place. why not: if (request.getParameter("editMode")) { label = new AjaxEditableLabel(id, model);} else {label = new Label(id, model);} parent.addOrReplace(label); ? On Thu, Sep 23, 2010 at 12:24 PM, Mihai Postelnicu< mposteln...@dgfoundation.org> wrote: Guys, I work on the same project as below (integrating an interface translator with Wicket) and we are a bit stuck. Any ideas? Thanks in advance for your time ! Mihai On 09/23/2010 12:29 PM, Alexandru Artimon wrote: Forgot to mention that the component is an AjaxEditableLabel and I need to save it to session because I'm creating a custom wicket tag for translation purposes. When in translator mode I want all the labels to be replaced by AjaxEditableLabel's so that the translator can do his job easier. The problem I have is that when I click on the label of the AjaxEditableLabel, it produces an ajax request in order to change visibility modes and show the edit box. I did my custom tag replacing by implementing an IComponentResolver, which (from what I figured) happens on render. So my AjaxEditableLabel component isn't in the page when the Ajax request arrives. I planned to solve this by fetching the missing component from the session on my own, by overwriting resolveListenerInterfaceTarget. Now when I fetch the original AjaxEditableLabel from the session, all it's children (the Label and TextField) are gone. Any ideas will be much appreciated. Thanks, Alexandru On 09/23/2010 11:57 AM, Alexandru Artimon wrote: Hello, I have a problem when saving a component to the session, all it's children disappear. I do the save like this: session.bind(); session.setMetaData(MY_KEY, component); Regards, Alexandru - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The Long, Long Dependency Trail
(Sorry for the topic hijacking Ichiro ...) Interesting tip, thanks! I've only been using maven for a year now, mainly by using m2eclipse to prevent library jars ending up in my source repository. Sebastian - Original Message - From: "Martijn Dashorst" To: Sent: Thursday, September 23, 2010 2:49 PM Subject: Re: The Long, Long Dependency Trail I would not add those external repositories to your own pom, but rely on a repository manager instead to retrieve the dependencies. See: * artifactory * nexus * archiva Martijn On Thu, Sep 23, 2010 at 2:48 PM, Bas Gooren wrote: More recent versions of hibernate are available in the JBoss maven repo (which I do not see in your pom.xml): jboss https://repository.jboss.org/nexus/content/repositories/releases Sebastian - Original Message - From: "Josh Kamau" To: Sent: Thursday, September 23, 2010 2:44 PM Subject: Re: The Long, Long Dependency Trail I suggest you use hibernate 3.5+. it seems more organized adding hibernate-core , hibernate-annotations adds all the neccessary hibernate dependencies. I normally use hibernate JPA entity manager and all i add is one dependency for hibernate-entitymanager. Regards. On Thu, Sep 23, 2010 at 3:28 PM, Ichiro Furusato wrote: Hello, I've been working with Wicket for about a week now and things were moving along all cruisy until I started adding Hibernate and Databinder dependencies into my POM. Then all hell broke loose and I seem to now find myself in the NoClassDefFoundError, then find and manually install jar cycle. I mean, things with Wicket were just so, well, SENSIBLE, and now I'm back in nightmare-programming-land again. In looking at some of the examples on the Web that combine Wicket and Hibernate, they don't seem to be needing anywhere near the number of dependencies I am now adding. I'm guessing I must be doing something wrong, as I'm still pretty new to Maven, being a longstanding Ant person. That I've had to manually install a whole bunch (6) of jars seems a clue. Part of this may be due to the folks who wrote Databinder using git rather than a maven repository (why oh why?!). My application extends net.databinder.auth.hib.AuthDataApplication so that it can be an authenticating database application. I've attached both the latest stack trace and my pom.xml file in hopes that some kind soul can tell me where I've gone terribly wrong. Perhaps I'm almost at the end of the dependency tunnel but I'm not yet seeing any light yet. I'm guessing this is probably a blaringly obvious problem, or maybe not a problem at all and I'm almost there. Thanks very much, Ichiro PS. BTW, I'm really enjoying Wicket so far; I haven't had this much fun programming since HyperCard. I hope it's not significantly more complicated a year or two from now than it is now. If the developer team can keep to that ethos of simplicity Wicket will only gain in popularity. Avoid the bloat. - 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 -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8 - 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: The Long, Long Dependency Trail
I would not add those external repositories to your own pom, but rely on a repository manager instead to retrieve the dependencies. See: * artifactory * nexus * archiva Martijn On Thu, Sep 23, 2010 at 2:48 PM, Bas Gooren wrote: > More recent versions of hibernate are available in the JBoss maven repo > (which I do not see in your pom.xml): > > > jboss > https://repository.jboss.org/nexus/content/repositories/releases > > > Sebastian > > - Original Message - From: "Josh Kamau" > To: > Sent: Thursday, September 23, 2010 2:44 PM > Subject: Re: The Long, Long Dependency Trail > > >> I suggest you use hibernate 3.5+. it seems more organized adding >> hibernate-core , hibernate-annotations adds all the neccessary hibernate >> dependencies. >> >> I normally use hibernate JPA entity manager and all i add is one >> dependency >> for hibernate-entitymanager. >> >> Regards. >> >> On Thu, Sep 23, 2010 at 3:28 PM, Ichiro Furusato >> wrote: >> >>> Hello, >>> >>> I've been working with Wicket for about a week now and things were >>> moving along all cruisy until I started adding Hibernate and >>> Databinder dependencies into my POM. Then all hell broke loose and I >>> seem to now find myself in the NoClassDefFoundError, then find and >>> manually install jar cycle. I mean, things with Wicket were just so, >>> well, SENSIBLE, and now I'm back in nightmare-programming-land again. >>> >>> In looking at some of the examples on the Web that combine Wicket and >>> Hibernate, they don't seem to be needing anywhere near the number of >>> dependencies I am now adding. I'm guessing I must be doing something >>> wrong, as I'm still pretty new to Maven, being a longstanding Ant >>> person. That I've had to manually install a whole bunch (6) of jars >>> seems a clue. Part of this may be due to the folks who wrote >>> Databinder using git rather than a maven repository (why oh why?!). >>> >>> My application extends net.databinder.auth.hib.AuthDataApplication so >>> that it can be an authenticating database application. I've attached >>> both the latest stack trace and my pom.xml file in hopes that some >>> kind soul can tell me where I've gone terribly wrong. Perhaps I'm >>> almost at the end of the dependency tunnel but I'm not yet seeing any >>> light yet. I'm guessing this is probably a blaringly obvious problem, >>> or maybe not a problem at all and I'm almost there. >>> >>> Thanks very much, >>> >>> Ichiro >>> >>> PS. BTW, I'm really enjoying Wicket so far; I haven't had this much >>> fun programming since HyperCard. I hope it's not significantly more >>> complicated a year or two from now than it is now. If the developer >>> team can keep to that ethos of simplicity Wicket will only gain in >>> popularity. Avoid the bloat. >>> >>> >>> - >>> 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 > > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The Long, Long Dependency Trail
More recent versions of hibernate are available in the JBoss maven repo (which I do not see in your pom.xml): jboss https://repository.jboss.org/nexus/content/repositories/releases Sebastian - Original Message - From: "Josh Kamau" To: Sent: Thursday, September 23, 2010 2:44 PM Subject: Re: The Long, Long Dependency Trail I suggest you use hibernate 3.5+. it seems more organized adding hibernate-core , hibernate-annotations adds all the neccessary hibernate dependencies. I normally use hibernate JPA entity manager and all i add is one dependency for hibernate-entitymanager. Regards. On Thu, Sep 23, 2010 at 3:28 PM, Ichiro Furusato wrote: Hello, I've been working with Wicket for about a week now and things were moving along all cruisy until I started adding Hibernate and Databinder dependencies into my POM. Then all hell broke loose and I seem to now find myself in the NoClassDefFoundError, then find and manually install jar cycle. I mean, things with Wicket were just so, well, SENSIBLE, and now I'm back in nightmare-programming-land again. In looking at some of the examples on the Web that combine Wicket and Hibernate, they don't seem to be needing anywhere near the number of dependencies I am now adding. I'm guessing I must be doing something wrong, as I'm still pretty new to Maven, being a longstanding Ant person. That I've had to manually install a whole bunch (6) of jars seems a clue. Part of this may be due to the folks who wrote Databinder using git rather than a maven repository (why oh why?!). My application extends net.databinder.auth.hib.AuthDataApplication so that it can be an authenticating database application. I've attached both the latest stack trace and my pom.xml file in hopes that some kind soul can tell me where I've gone terribly wrong. Perhaps I'm almost at the end of the dependency tunnel but I'm not yet seeing any light yet. I'm guessing this is probably a blaringly obvious problem, or maybe not a problem at all and I'm almost there. Thanks very much, Ichiro PS. BTW, I'm really enjoying Wicket so far; I haven't had this much fun programming since HyperCard. I hope it's not significantly more complicated a year or two from now than it is now. If the developer team can keep to that ethos of simplicity Wicket will only gain in popularity. Avoid the bloat. - 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
HeadersToolbar incompatible to other components than Label?
I've implemented a CheckGroupColumn which is supposed to easily extend the DataTable with multi-row actions. But when i add it to my DataTable i get the following exception: --- WicketMessage: Component label must be applied to a tag of type 'input', not '' (line 0, column 0) [markup = jar:file:/D:/work/base/LIB_POOL/wicket/wicket-extensions-1.4.9.jar!/org/apache/wicket/extensions/markup/html/repeater/data/table/HeadersToolbar.html [header-label] , index = 6, current = '' (line 21, column 27)] --- I do understand whats wrong here, but i have no clue how to work a round that problem. Any ideas? Heres the CheckGroupColumn.java: public class CheckGroupColumn extends AbstractColumn { private static final long serialVersionUID = 1L; private CheckGroup checkGroup; public CheckGroupColumn(CheckGroup checkGroup) { super(new Model("")); this.checkGroup = checkGroup; } @Override public Component getHeader(String componentId) { return new CheckGroupSelector(componentId, checkGroup); } @Override public void populateItem(Item> cellItem, String componentId, IModel rowModel) { cellItem.add(new Check(componentId, rowModel, checkGroup)); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The Long, Long Dependency Trail
I suggest you use hibernate 3.5+. it seems more organized adding hibernate-core , hibernate-annotations adds all the neccessary hibernate dependencies. I normally use hibernate JPA entity manager and all i add is one dependency for hibernate-entitymanager. Regards. On Thu, Sep 23, 2010 at 3:28 PM, Ichiro Furusato wrote: > Hello, > > I've been working with Wicket for about a week now and things were > moving along all cruisy until I started adding Hibernate and > Databinder dependencies into my POM. Then all hell broke loose and I > seem to now find myself in the NoClassDefFoundError, then find and > manually install jar cycle. I mean, things with Wicket were just so, > well, SENSIBLE, and now I'm back in nightmare-programming-land again. > > In looking at some of the examples on the Web that combine Wicket and > Hibernate, they don't seem to be needing anywhere near the number of > dependencies I am now adding. I'm guessing I must be doing something > wrong, as I'm still pretty new to Maven, being a longstanding Ant > person. That I've had to manually install a whole bunch (6) of jars > seems a clue. Part of this may be due to the folks who wrote > Databinder using git rather than a maven repository (why oh why?!). > > My application extends net.databinder.auth.hib.AuthDataApplication so > that it can be an authenticating database application. I've attached > both the latest stack trace and my pom.xml file in hopes that some > kind soul can tell me where I've gone terribly wrong. Perhaps I'm > almost at the end of the dependency tunnel but I'm not yet seeing any > light yet. I'm guessing this is probably a blaringly obvious problem, > or maybe not a problem at all and I'm almost there. > > Thanks very much, > > Ichiro > > PS. BTW, I'm really enjoying Wicket so far; I haven't had this much > fun programming since HyperCard. I hope it's not significantly more > complicated a year or two from now than it is now. If the developer > team can keep to that ethos of simplicity Wicket will only gain in > popularity. Avoid the bloat. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org >
Re: Saving a component in session
I guess you are aware of ? On Thu, Sep 23, 2010 at 1:41 PM, Alexandru Artimon < aarti...@dgfoundation.org> wrote: > Hello, > > This aproach didn't work for me. I tried first only adding an > AjaxEditableLabel in my ComponentResolver, but once I clicked the label (in > order to change into an edit box) wicket complained that it couldn't find > the AjaxEditableLabel component in the Page. So that's how I ended up > overwriting resolveListenerInterfaceTarget in order to resolve the > AjaxEditableLabel. I couldn't return a new instance of it (because adding it > to the page at this point seems difficult) so I thought to use the session. > > Our intended translation tag looks like this: key="home:nameField">[Here the default value for it]. > We need something like this because we are porting an existing webapp to > Wicket that has a similar mechanism now. > > Thanks, > Alexandru > > > On 09/23/2010 02:07 PM, Martin Grigorov wrote: > >> I'm not sure why the children disappear but it looks odd to me to save >> component in the session in first place. >> >> why not: >> if (request.getParameter("editMode")) { label = new AjaxEditableLabel(id, >> model);} else {label = new Label(id, model);} >> parent.addOrReplace(label); >> >> ? >> >> On Thu, Sep 23, 2010 at 12:24 PM, Mihai Postelnicu< >> mposteln...@dgfoundation.org> wrote: >> >> Guys, >>> I work on the same project as below (integrating an interface translator >>> with Wicket) and we are a bit stuck. Any ideas? >>> >>> Thanks in advance for your time ! >>> Mihai >>> >>> >>> On 09/23/2010 12:29 PM, Alexandru Artimon wrote: >>> >>> Forgot to mention that the component is an AjaxEditableLabel and I need to save it to session because I'm creating a custom wicket tag for translation purposes. When in translator mode I want all the labels to be replaced by AjaxEditableLabel's so that the translator can do his job easier. The problem I have is that when I click on the label of the AjaxEditableLabel, it produces an ajax request in order to change visibility modes and show the edit box. I did my custom tag replacing by implementing an IComponentResolver, which (from what I figured) happens on render. So my AjaxEditableLabel component isn't in the page when the Ajax request arrives. I planned to solve this by fetching the missing component from the session on my own, by overwriting resolveListenerInterfaceTarget. Now when I fetch the original AjaxEditableLabel from the session, all it's children (the Label and TextField) are gone. Any ideas will be much appreciated. Thanks, Alexandru On 09/23/2010 11:57 AM, Alexandru Artimon wrote: Hello, > > I have a problem when saving a component to the session, all it's > children disappear. > I do the save like this: > >session.bind(); >session.setMetaData(MY_KEY, component); > > > Regards, > Alexandru > >
The Long, Long Dependency Trail
Hello, I've been working with Wicket for about a week now and things were moving along all cruisy until I started adding Hibernate and Databinder dependencies into my POM. Then all hell broke loose and I seem to now find myself in the NoClassDefFoundError, then find and manually install jar cycle. I mean, things with Wicket were just so, well, SENSIBLE, and now I'm back in nightmare-programming-land again. In looking at some of the examples on the Web that combine Wicket and Hibernate, they don't seem to be needing anywhere near the number of dependencies I am now adding. I'm guessing I must be doing something wrong, as I'm still pretty new to Maven, being a longstanding Ant person. That I've had to manually install a whole bunch (6) of jars seems a clue. Part of this may be due to the folks who wrote Databinder using git rather than a maven repository (why oh why?!). My application extends net.databinder.auth.hib.AuthDataApplication so that it can be an authenticating database application. I've attached both the latest stack trace and my pom.xml file in hopes that some kind soul can tell me where I've gone terribly wrong. Perhaps I'm almost at the end of the dependency tunnel but I'm not yet seeing any light yet. I'm guessing this is probably a blaringly obvious problem, or maybe not a problem at all and I'm almost there. Thanks very much, Ichiro PS. BTW, I'm really enjoying Wicket so far; I haven't had this much fun programming since HyperCard. I hope it's not significantly more complicated a year or two from now than it is now. If the developer team can keep to that ethos of simplicity Wicket will only gain in popularity. Avoid the bloat. --- Test set: net.neocortext.web.TestHomePage --- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.225 sec <<< FAILURE! testRenderMyPage(net.neocortext.web.TestHomePage) Time elapsed: 0.182 sec <<< ERROR! java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider at net.databinder.hib.DataApplication.buildHibernateSessionFactory(DataApplication.java:88) at net.databinder.hib.DataApplication.dataInit(DataApplication.java:56) at net.databinder.DataApplicationBase.internalInit(DataApplicationBase.java:54) at net.databinder.auth.hib.AuthDataApplication.internalInit(AuthDataApplication.java:74) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:721) at org.apache.wicket.protocol.http.MockWebApplication.(MockWebApplication.java:168) at org.apache.wicket.util.tester.BaseWicketTester.(BaseWicketTester.java:218) at org.apache.wicket.util.tester.WicketTester.(WicketTester.java:331) at org.apache.wicket.util.tester.WicketTester.(WicketTester.java:314) at net.neocortext.web.TestHomePage.setUp(TestHomePage.java:19) at junit.framework.TestCase.runBare(TestCase.java:128) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) 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.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) 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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataProvider at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:
Re: onload
Hi, 2010/9/23 Ole Hansen : > Hi, > > 2010/9/23 Martin Grigorov : >> Why do you have two components on "bodyElement" ? >> >> WebMarkupContainer body = new WebMarkupContainer("bodyElement"); > > Yes it is redundant, but dosent seem to make a difference weather it > is there or not. No need to look further into this. I messed up. > > Thanks, > Jess > > >> add(new WebMarkupContainer("bodyElement") { >> >> On Thu, Sep 23, 2010 at 11:00 AM, Ole Hansen wrote: >> >>> Hi, >>> >>> Newbee question: I need to add the onload attribute to the body tag (I >>> can't use other methods to accomplish the same thing...) >>> >>> My html: >>> >>> >>> ... >>> >>> >>> >>> ... >>> >>> >>> >>> >>> Java: >>> WebMarkupContainer body = new WebMarkupContainer("bodyElement"); >>> >>> add(new WebMarkupContainer("bodyElement") { >>> �...@override >>> public boolean isTransparentResolver() { >>> return true; >>> } >>> �...@override >>> protected void onComponentTag(final ComponentTag tag) { >>> super.onComponentTag(tag); >>> tag.put("onload", "onload();"); >>> } >>> }); >>> >>> Result html: >>> >>> >>> ... >>> >>> >>> >>> ... >>> >>> I now have two body start tags. >>> The code below results in a runtime exception stating that bodyElement >>> was not declared.. >>> >>> >>> >>> ... >>> >>> >>> >>> >>> I have also tried adding: >>> add(new BodyTagAttributeModifier("onload", true, new Model("onload();"), >>> this)); >>> >>> But nothing gets added to the body tag. >>> >>> Can someone direct me in the right direction? >>> >>> >>> Wicket version: 1.4.1 >>> JDK: IBM JDK 5.0.10 >>> >>> Regards, >>> Jess >>> >>> - >>> 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: Saving a component in session
Hello, This aproach didn't work for me. I tried first only adding an AjaxEditableLabel in my ComponentResolver, but once I clicked the label (in order to change into an edit box) wicket complained that it couldn't find the AjaxEditableLabel component in the Page. So that's how I ended up overwriting resolveListenerInterfaceTarget in order to resolve the AjaxEditableLabel. I couldn't return a new instance of it (because adding it to the page at this point seems difficult) so I thought to use the session. Our intended translation tag looks like this: key="home:nameField">[Here the default value for it]. We need something like this because we are porting an existing webapp to Wicket that has a similar mechanism now. Thanks, Alexandru On 09/23/2010 02:07 PM, Martin Grigorov wrote: I'm not sure why the children disappear but it looks odd to me to save component in the session in first place. why not: if (request.getParameter("editMode")) { label = new AjaxEditableLabel(id, model);} else {label = new Label(id, model);} parent.addOrReplace(label); ? On Thu, Sep 23, 2010 at 12:24 PM, Mihai Postelnicu< mposteln...@dgfoundation.org> wrote: Guys, I work on the same project as below (integrating an interface translator with Wicket) and we are a bit stuck. Any ideas? Thanks in advance for your time ! Mihai On 09/23/2010 12:29 PM, Alexandru Artimon wrote: Forgot to mention that the component is an AjaxEditableLabel and I need to save it to session because I'm creating a custom wicket tag for translation purposes. When in translator mode I want all the labels to be replaced by AjaxEditableLabel's so that the translator can do his job easier. The problem I have is that when I click on the label of the AjaxEditableLabel, it produces an ajax request in order to change visibility modes and show the edit box. I did my custom tag replacing by implementing an IComponentResolver, which (from what I figured) happens on render. So my AjaxEditableLabel component isn't in the page when the Ajax request arrives. I planned to solve this by fetching the missing component from the session on my own, by overwriting resolveListenerInterfaceTarget. Now when I fetch the original AjaxEditableLabel from the session, all it's children (the Label and TextField) are gone. Any ideas will be much appreciated. Thanks, Alexandru On 09/23/2010 11:57 AM, Alexandru Artimon wrote: Hello, I have a problem when saving a component to the session, all it's children disappear. I do the save like this: session.bind(); session.setMetaData(MY_KEY, component); Regards, Alexandru
Re: using IOC in panels?
Good point. On Thu, Sep 23, 2010 at 12:45 PM, James Carman wrote: > I meant automatically. Why introduce an interface if you're going to > just do this anyway? > > On Thu, Sep 23, 2010 at 6:42 AM, Ernesto Reinaldo Barreiro > wrote: >> Doing >> >> getApplication().notifyComponentInstantiationListeners(this); >> >> as component does? >> >> >> On Thu, Sep 23, 2010 at 12:39 PM, James Carman >> wrote: >>> Again, how would merely putting a marker interface on some random >>> class allow Wicket to be notified about when it is instantiated? Now, >>> if you bring AspectJ into the mix, you might have something. Or, as >>> someone else already suggested, use Salve. >>> >>> On Thu, Sep 23, 2010 at 6:35 AM, Ernesto Reinaldo Barreiro >>> wrote: Listeners could be used for other things: not only injecting dependencies. The interface would mark classes that could be instantiated by wicket listeners. But yes you are probably right and it would be overkilling... Ernesto On Thu, Sep 23, 2010 at 12:27 PM, James Carman wrote: > I meant the "Instantiatable" interface you mentioned. I would assume > that it would be a marker interface that would indicate to Wicket that > you want it injected. This already happens with @SpringBean without > the need for an interface. If the injector sees a @SpringBean field, > it injects it. For other classes (like models and the like), if you > have a superclass that injects in its constructor, you're covered. > > On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro > wrote: >> The interface IComponentInstantiationListener is tied to component: >> >> public interface IComponentInstantiationListener >> { >> /** >> * Called for every component that is instantiated. This method >> is called >> * during construction, so do not depend on the >> construction being completed >> * yet. The id is guaranteed to be set before this call. >> * >> * @param component >> * the component that is being instantiated. >> */ >> void onInstantiation(Component component); >> } >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 12:17 PM, James Carman >> wrote: >>> So, why would you need an interface, then? Just do this. >>> >>> On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro >>> wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman wrote: > On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro > wrote: >> >> So that other classes could use the same trick by implementing >> IInstantiable ? >> > > How, exactly, is Wicket going to know when they're instantiated? The > only way the component instantiation stuff works is that the Component > constructor does the notification. > > - > 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 >>> >>> - >>> 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 >> >> > > - > 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 >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsu
Re: Saving a component in session
I'm not sure why the children disappear but it looks odd to me to save component in the session in first place. why not: if (request.getParameter("editMode")) { label = new AjaxEditableLabel(id, model);} else {label = new Label(id, model);} parent.addOrReplace(label); ? On Thu, Sep 23, 2010 at 12:24 PM, Mihai Postelnicu < mposteln...@dgfoundation.org> wrote: > Guys, > I work on the same project as below (integrating an interface translator > with Wicket) and we are a bit stuck. Any ideas? > > Thanks in advance for your time ! > Mihai > > > On 09/23/2010 12:29 PM, Alexandru Artimon wrote: > >> Forgot to mention that the component is an AjaxEditableLabel and I need >> to save it to session because I'm creating a custom wicket tag for >> translation purposes. When in translator mode I want all the labels to be >> replaced by AjaxEditableLabel's so that the translator can do his job >> easier. >> >> The problem I have is that when I click on the label of the >> AjaxEditableLabel, it produces an ajax request in order to change visibility >> modes and show the edit box. I did my custom tag replacing by implementing >> an IComponentResolver, which (from what I figured) happens on render. So my >> AjaxEditableLabel component isn't in the page when the Ajax request arrives. >> I planned to solve this by fetching the missing component from the session >> on my own, by overwriting resolveListenerInterfaceTarget. Now when I fetch >> the original AjaxEditableLabel from the session, all it's children (the >> Label and TextField) are gone. >> >> Any ideas will be much appreciated. >> >> Thanks, >> Alexandru >> >> >> >> On 09/23/2010 11:57 AM, Alexandru Artimon wrote: >> >>> Hello, >>> >>> I have a problem when saving a component to the session, all it's >>> children disappear. >>> I do the save like this: >>> >>>session.bind(); >>>session.setMetaData(MY_KEY, component); >>> >>> >>> Regards, >>> Alexandru >>> >> >> >> >
Re: using IOC in panels?
I meant automatically. Why introduce an interface if you're going to just do this anyway? On Thu, Sep 23, 2010 at 6:42 AM, Ernesto Reinaldo Barreiro wrote: > Doing > > getApplication().notifyComponentInstantiationListeners(this); > > as component does? > > > On Thu, Sep 23, 2010 at 12:39 PM, James Carman > wrote: >> Again, how would merely putting a marker interface on some random >> class allow Wicket to be notified about when it is instantiated? Now, >> if you bring AspectJ into the mix, you might have something. Or, as >> someone else already suggested, use Salve. >> >> On Thu, Sep 23, 2010 at 6:35 AM, Ernesto Reinaldo Barreiro >> wrote: >>> Listeners could be used for other things: not only injecting >>> dependencies. The interface would mark classes that could be >>> instantiated by wicket listeners. But yes you are probably right and >>> it would be overkilling... >>> >>> Ernesto >>> >>> On Thu, Sep 23, 2010 at 12:27 PM, James Carman >>> wrote: I meant the "Instantiatable" interface you mentioned. I would assume that it would be a marker interface that would indicate to Wicket that you want it injected. This already happens with @SpringBean without the need for an interface. If the injector sees a @SpringBean field, it injects it. For other classes (like models and the like), if you have a superclass that injects in its constructor, you're covered. On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro wrote: > The interface IComponentInstantiationListener is tied to component: > > public interface IComponentInstantiationListener > { > /** > * Called for every component that is instantiated. This method is > called > * during construction, so do not depend on the > construction being completed > * yet. The id is guaranteed to be set before this call. > * > * @param component > * the component that is being instantiated. > */ > void onInstantiation(Component component); > } > > Ernesto > > On Thu, Sep 23, 2010 at 12:17 PM, James Carman > wrote: >> So, why would you need an interface, then? Just do this. >> >> On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro >> wrote: >>> Well you could have your hierarchy of classes and on your base class >>> call >>> >>> getApplication().notifyComponentInstantiationListeners(this); >>> >>> As component does. >>> >>> Ernesto >>> >>> On Thu, Sep 23, 2010 at 12:11 PM, James Carman >>> wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro wrote: > > So that other classes could use the same trick by implementing > IInstantiable ? > How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 >>> >>> >> >> - >> 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 > > - 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 >>> >>> >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubsc
Re: using IOC in panels?
Doing getApplication().notifyComponentInstantiationListeners(this); as component does? On Thu, Sep 23, 2010 at 12:39 PM, James Carman wrote: > Again, how would merely putting a marker interface on some random > class allow Wicket to be notified about when it is instantiated? Now, > if you bring AspectJ into the mix, you might have something. Or, as > someone else already suggested, use Salve. > > On Thu, Sep 23, 2010 at 6:35 AM, Ernesto Reinaldo Barreiro > wrote: >> Listeners could be used for other things: not only injecting >> dependencies. The interface would mark classes that could be >> instantiated by wicket listeners. But yes you are probably right and >> it would be overkilling... >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 12:27 PM, James Carman >> wrote: >>> I meant the "Instantiatable" interface you mentioned. I would assume >>> that it would be a marker interface that would indicate to Wicket that >>> you want it injected. This already happens with @SpringBean without >>> the need for an interface. If the injector sees a @SpringBean field, >>> it injects it. For other classes (like models and the like), if you >>> have a superclass that injects in its constructor, you're covered. >>> >>> On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro >>> wrote: The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * during construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman wrote: > So, why would you need an interface, then? Just do this. > > On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro > wrote: >> Well you could have your hierarchy of classes and on your base class call >> >> getApplication().notifyComponentInstantiationListeners(this); >> >> As component does. >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 12:11 PM, James Carman >> wrote: >>> On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro >>> wrote: So that other classes could use the same trick by implementing IInstantiable ? >>> >>> How, exactly, is Wicket going to know when they're instantiated? The >>> only way the component instantiation stuff works is that the Component >>> constructor does the notification. >>> >>> - >>> 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 >> >> > > - > 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 >>> >>> - >>> 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 >> >> > > - > 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: using IOC in panels?
Again, how would merely putting a marker interface on some random class allow Wicket to be notified about when it is instantiated? Now, if you bring AspectJ into the mix, you might have something. Or, as someone else already suggested, use Salve. On Thu, Sep 23, 2010 at 6:35 AM, Ernesto Reinaldo Barreiro wrote: > Listeners could be used for other things: not only injecting > dependencies. The interface would mark classes that could be > instantiated by wicket listeners. But yes you are probably right and > it would be overkilling... > > Ernesto > > On Thu, Sep 23, 2010 at 12:27 PM, James Carman > wrote: >> I meant the "Instantiatable" interface you mentioned. I would assume >> that it would be a marker interface that would indicate to Wicket that >> you want it injected. This already happens with @SpringBean without >> the need for an interface. If the injector sees a @SpringBean field, >> it injects it. For other classes (like models and the like), if you >> have a superclass that injects in its constructor, you're covered. >> >> On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro >> wrote: >>> The interface IComponentInstantiationListener is tied to component: >>> >>> public interface IComponentInstantiationListener >>> { >>> /** >>> * Called for every component that is instantiated. This method is >>> called >>> * during construction, so do not depend on the >>> construction being completed >>> * yet. The id is guaranteed to be set before this call. >>> * >>> * @param component >>> * the component that is being instantiated. >>> */ >>> void onInstantiation(Component component); >>> } >>> >>> Ernesto >>> >>> On Thu, Sep 23, 2010 at 12:17 PM, James Carman >>> wrote: So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro wrote: > Well you could have your hierarchy of classes and on your base class call > > getApplication().notifyComponentInstantiationListeners(this); > > As component does. > > Ernesto > > On Thu, Sep 23, 2010 at 12:11 PM, James Carman > wrote: >> On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro >> wrote: >>> >>> So that other classes could use the same trick by implementing >>> IInstantiable ? >>> >> >> How, exactly, is Wicket going to know when they're instantiated? The >> only way the component instantiation stuff works is that the Component >> constructor does the notification. >> >> - >> 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 > > - 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 >>> >>> >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Listeners could be used for other things: not only injecting dependencies. The interface would mark classes that could be instantiated by wicket listeners. But yes you are probably right and it would be overkilling... Ernesto On Thu, Sep 23, 2010 at 12:27 PM, James Carman wrote: > I meant the "Instantiatable" interface you mentioned. I would assume > that it would be a marker interface that would indicate to Wicket that > you want it injected. This already happens with @SpringBean without > the need for an interface. If the injector sees a @SpringBean field, > it injects it. For other classes (like models and the like), if you > have a superclass that injects in its constructor, you're covered. > > On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro > wrote: >> The interface IComponentInstantiationListener is tied to component: >> >> public interface IComponentInstantiationListener >> { >> /** >> * Called for every component that is instantiated. This method is >> called >> * during construction, so do not depend on the >> construction being completed >> * yet. The id is guaranteed to be set before this call. >> * >> * @param component >> * the component that is being instantiated. >> */ >> void onInstantiation(Component component); >> } >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 12:17 PM, James Carman >> wrote: >>> So, why would you need an interface, then? Just do this. >>> >>> On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro >>> wrote: Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman wrote: > On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro > wrote: >> >> So that other classes could use the same trick by implementing >> IInstantiable ? >> > > How, exactly, is Wicket going to know when they're instantiated? The > only way the component instantiation stuff works is that the Component > constructor does the notification. > > - > 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 >>> >>> - >>> 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 >> >> > > - > 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: using IOC in panels?
I meant the "Instantiatable" interface you mentioned. I would assume that it would be a marker interface that would indicate to Wicket that you want it injected. This already happens with @SpringBean without the need for an interface. If the injector sees a @SpringBean field, it injects it. For other classes (like models and the like), if you have a superclass that injects in its constructor, you're covered. On Thu, Sep 23, 2010 at 6:24 AM, Ernesto Reinaldo Barreiro wrote: > The interface IComponentInstantiationListener is tied to component: > > public interface IComponentInstantiationListener > { > /** > * Called for every component that is instantiated. This method is > called > * during construction, so do not depend on the > construction being completed > * yet. The id is guaranteed to be set before this call. > * > * @param component > * the component that is being instantiated. > */ > void onInstantiation(Component component); > } > > Ernesto > > On Thu, Sep 23, 2010 at 12:17 PM, James Carman > wrote: >> So, why would you need an interface, then? Just do this. >> >> On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro >> wrote: >>> Well you could have your hierarchy of classes and on your base class call >>> >>> getApplication().notifyComponentInstantiationListeners(this); >>> >>> As component does. >>> >>> Ernesto >>> >>> On Thu, Sep 23, 2010 at 12:11 PM, James Carman >>> wrote: On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro wrote: > > So that other classes could use the same trick by implementing > IInstantiable ? > How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - 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 >>> >>> >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Saving a component in session
Guys, I work on the same project as below (integrating an interface translator with Wicket) and we are a bit stuck. Any ideas? Thanks in advance for your time ! Mihai On 09/23/2010 12:29 PM, Alexandru Artimon wrote: Forgot to mention that the component is an AjaxEditableLabel and I need to save it to session because I'm creating a custom wicket tag for translation purposes. When in translator mode I want all the labels to be replaced by AjaxEditableLabel's so that the translator can do his job easier. The problem I have is that when I click on the label of the AjaxEditableLabel, it produces an ajax request in order to change visibility modes and show the edit box. I did my custom tag replacing by implementing an IComponentResolver, which (from what I figured) happens on render. So my AjaxEditableLabel component isn't in the page when the Ajax request arrives. I planned to solve this by fetching the missing component from the session on my own, by overwriting resolveListenerInterfaceTarget. Now when I fetch the original AjaxEditableLabel from the session, all it's children (the Label and TextField) are gone. Any ideas will be much appreciated. Thanks, Alexandru On 09/23/2010 11:57 AM, Alexandru Artimon wrote: Hello, I have a problem when saving a component to the session, all it's children disappear. I do the save like this: session.bind(); session.setMetaData(MY_KEY, component); Regards, Alexandru
Re: using IOC in panels?
The interface IComponentInstantiationListener is tied to component: public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * during construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component *the component that is being instantiated. */ void onInstantiation(Component component); } Ernesto On Thu, Sep 23, 2010 at 12:17 PM, James Carman wrote: > So, why would you need an interface, then? Just do this. > > On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro > wrote: >> Well you could have your hierarchy of classes and on your base class call >> >> getApplication().notifyComponentInstantiationListeners(this); >> >> As component does. >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 12:11 PM, James Carman >> wrote: >>> On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro >>> wrote: So that other classes could use the same trick by implementing IInstantiable ? >>> >>> How, exactly, is Wicket going to know when they're instantiated? The >>> only way the component instantiation stuff works is that the Component >>> constructor does the notification. >>> >>> - >>> 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 >> >> > > - > 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: dynamic template page
Thanks a lot! IMarkupResourceStreamProvider does the trick:) - www.hermanhorsten.be -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/dynamic-template-page-tp2550354p2551774.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: using IOC in panels?
Some Models maybe? Right now I have a few of them where I have InjectorHolder.getInjector().inject(this); But maybe you are right and this out of Wicket's "scope". Ernesto On Thu, Sep 23, 2010 at 12:11 PM, Bas Gooren wrote: > I'd be curious to hear for what "other classes" you have in mind. You'll > always need to call the instantiation listener at some point to invoke the > injector. > So simply implementing IInstantiable will not be enough to have injection > magically work. > > I think the reason it's currently implemented the way it is, is that all > components have a Component base class which can abstract behavior like > this. > > In case you want dependency injection anywhere, you should take a look at > something like Salve (http://code.google.com/p/salve/) > > Sebastian > > - Original Message - From: "Ernesto Reinaldo Barreiro" > > To: > Sent: Thursday, September 23, 2010 12:07 PM > Subject: Re: using IOC in panels? > > > Shall I create an RFE? Or this something that does not make much sense? > > Ernesto > > On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael > wrote: >> >> yeah that would be handy. >> >> 2010/9/23 Ernesto Reinaldo Barreiro : >>> >>> Martin, >>> >>> Yes, I see: >>> >>> getApplication().notifyComponentInstantiationListeners(this); >>> >>> Would it make sense (for 1.5) to have: >>> >>> -an interface IInstantiable >>> -modify >>> >>> public interface IComponentInstantiationListener >>> { >>> /** >>> * Called for every component that is instantiated. This method is called >>> * during construction, so do not depend on the >>> construction being completed >>> * yet. The id is guaranteed to be set before this call. >>> * >>> * @param component >>> * the component that is being instantiated. >>> */ >>> void onInstantiation(IInstantiable component); >>> } >>> >>> So that other classes could use the same trick by implementing >>> IInstantiable ? >>> >>> Cheers, >>> >>> Ernesto >>> >>> On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov >>> wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > There is a component instantiation listener that takes care of that: > you just use new as "always". > > Ernesto > > On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael > wrote: > > but how should panel then be managed.. > > > > Because if I create the panel myself in the page it won't work right? > > Can I ask wicket to instansiate my panel? > > > > 2010/9/23 Martin Grigorov : > >> Panel is a Component, so you can use @Inject on the Panel members. > >> Use Injector.get().inject(target) only in non Component classes. > >> > >> P.S. The API above is for 1.5. > >> > >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < > >> martin.maku...@koodaripalvelut.com> wrote: > >> > >>> You must weigh benefits and cons about whereto manage your IOC. > >>> > >>> ** > >>> Martin > >>> > >>> 2010/9/23 nino martinez wael : > >>> > I need to be able to inject a service into my panel.. > >>> > > >>> > Should I then just use: > >>> > > >>> > org.apache.wicket.injection.Injector.get().inject(Object object). > >>> > > >>> > or are there are prettier way? I feel that calling > >>> > org.apache.wicket.injection.Injector.get().inject(Object object) > >>> > inside my panels sort of violates the IOC principle? > >>> > > >>> > 2010/9/23 Martin Makundi : > >>> >> What is your need exactly? > >>> >> > >>> >> ** > >>> >> Martin > >>> >> > >>> >> 2010/9/23 nino martinez wael : > >>> >>> Hi > >>> >>> > >>> >>> what should I do if I want to use IOC in my panels? In short I > >>> >>> >>> >>> need > a > >>> >>> sort of a provider injected into a panel, what's the prettiest > >>> >>> >>> >>> way > to > >>> >>> do it? > >>> >>> > >>> >>> regards Nino > >>> >>> > >>> >>> > - > >>> >>> 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 > >>> >> > >>> >> > >>> > > >>> > > >>> > - > >>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >>> > For additional commands, e-mail: users-h...@wicket.apache.org > >>> > > >>> > > >>> > >>> > >>> -
Re: using IOC in panels?
what about custom IModel impls ? it will work automatically for all IModel impls provided by Wicket, but will not work for custom ones. And then the users will start creating tickets ... On Thu, Sep 23, 2010 at 12:16 PM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > Well you could have your hierarchy of classes and on your base class call > > getApplication().notifyComponentInstantiationListeners(this); > > As component does. > > Ernesto > > On Thu, Sep 23, 2010 at 12:11 PM, James Carman > wrote: > > On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro > > wrote: > >> > >> So that other classes could use the same trick by implementing > IInstantiable ? > >> > > > > How, exactly, is Wicket going to know when they're instantiated? The > > only way the component instantiation stuff works is that the Component > > constructor does the notification. > > > > - > > 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: using IOC in panels?
So, why would you need an interface, then? Just do this. On Thu, Sep 23, 2010 at 6:16 AM, Ernesto Reinaldo Barreiro wrote: > Well you could have your hierarchy of classes and on your base class call > > getApplication().notifyComponentInstantiationListeners(this); > > As component does. > > Ernesto > > On Thu, Sep 23, 2010 at 12:11 PM, James Carman > wrote: >> On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro >> wrote: >>> >>> So that other classes could use the same trick by implementing >>> IInstantiable ? >>> >> >> How, exactly, is Wicket going to know when they're instantiated? The >> only way the component instantiation stuff works is that the Component >> constructor does the notification. >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Well you could have your hierarchy of classes and on your base class call getApplication().notifyComponentInstantiationListeners(this); As component does. Ernesto On Thu, Sep 23, 2010 at 12:11 PM, James Carman wrote: > On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro > wrote: >> >> So that other classes could use the same trick by implementing IInstantiable >> ? >> > > How, exactly, is Wicket going to know when they're instantiated? The > only way the component instantiation stuff works is that the Component > constructor does the notification. > > - > 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: using IOC in panels?
James, I think know how it works: I was just wondering if it can be extended for other types of objects and how useful it could be. Ernesto On Thu, Sep 23, 2010 at 12:09 PM, James Carman wrote: > You don't need to have Wicket instantiate anything for you. The > listener knows when you instantiate any component (Component's > constructor does the magic). Just use @SpringBean in your panel and > it will work. > > On Thu, Sep 23, 2010 at 6:07 AM, Ernesto Reinaldo Barreiro > wrote: >> Shall I create an RFE? Or this something that does not make much sense? >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael >> wrote: >>> yeah that would be handy. >>> >>> 2010/9/23 Ernesto Reinaldo Barreiro : Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * during construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov wrote: > Panel's constructor calls super() and Component's ctor asks the > instantiation listener to do its work > > On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < > reier...@gmail.com> wrote: > >> There is a component instantiation listener that takes care of that: >> you just use new as "always". >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael >> wrote: >> > but how should panel then be managed.. >> > >> > Because if I create the panel myself in the page it won't work right? >> > Can I ask wicket to instansiate my panel? >> > >> > 2010/9/23 Martin Grigorov : >> >> Panel is a Component, so you can use @Inject on the Panel members. >> >> Use Injector.get().inject(target) only in non Component classes. >> >> >> >> P.S. The API above is for 1.5. >> >> >> >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < >> >> martin.maku...@koodaripalvelut.com> wrote: >> >> >> >>> You must weigh benefits and cons about whereto manage your IOC. >> >>> >> >>> ** >> >>> Martin >> >>> >> >>> 2010/9/23 nino martinez wael : >> >>> > I need to be able to inject a service into my panel.. >> >>> > >> >>> > Should I then just use: >> >>> > >> >>> > org.apache.wicket.injection.Injector.get().inject(Object object). >> >>> > >> >>> > or are there are prettier way? I feel that calling >> >>> > org.apache.wicket.injection.Injector.get().inject(Object object) >> >>> > inside my panels sort of violates the IOC principle? >> >>> > >> >>> > 2010/9/23 Martin Makundi : >> >>> >> What is your need exactly? >> >>> >> >> >>> >> ** >> >>> >> Martin >> >>> >> >> >>> >> 2010/9/23 nino martinez wael : >> >>> >>> Hi >> >>> >>> >> >>> >>> what should I do if I want to use IOC in my panels? In short I >> >>> >>> need >> a >> >>> >>> sort of a provider injected into a panel, what's the prettiest >> >>> >>> way >> to >> >>> >>> do it? >> >>> >>> >> >>> >>> regards Nino >> >>> >>> >> >>> >>> >> - >> >>> >>> 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 >> >>> >> >> >>> >> >> >>> > >> >>> > - >> >>> > 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: using IOC in panels?
On Thu, Sep 23, 2010 at 5:46 AM, Ernesto Reinaldo Barreiro wrote: > > So that other classes could use the same trick by implementing IInstantiable ? > How, exactly, is Wicket going to know when they're instantiated? The only way the component instantiation stuff works is that the Component constructor does the notification. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
I'd be curious to hear for what "other classes" you have in mind. You'll always need to call the instantiation listener at some point to invoke the injector. So simply implementing IInstantiable will not be enough to have injection magically work. I think the reason it's currently implemented the way it is, is that all components have a Component base class which can abstract behavior like this. In case you want dependency injection anywhere, you should take a look at something like Salve (http://code.google.com/p/salve/) Sebastian - Original Message - From: "Ernesto Reinaldo Barreiro" To: Sent: Thursday, September 23, 2010 12:07 PM Subject: Re: using IOC in panels? Shall I create an RFE? Or this something that does not make much sense? Ernesto On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael wrote: yeah that would be handy. 2010/9/23 Ernesto Reinaldo Barreiro : Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * during construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component * the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: There is a component instantiation listener that takes care of that: you just use new as "always". Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael wrote: > but how should panel then be managed.. > > Because if I create the panel myself in the page it won't work right? > Can I ask wicket to instansiate my panel? > > 2010/9/23 Martin Grigorov : >> Panel is a Component, so you can use @Inject on the Panel members. >> Use Injector.get().inject(target) only in non Component classes. >> >> P.S. The API above is for 1.5. >> >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < >> martin.maku...@koodaripalvelut.com> wrote: >> >>> You must weigh benefits and cons about whereto manage your IOC. >>> >>> ** >>> Martin >>> >>> 2010/9/23 nino martinez wael : >>> > I need to be able to inject a service into my panel.. >>> > >>> > Should I then just use: >>> > >>> > org.apache.wicket.injection.Injector.get().inject(Object object). >>> > >>> > or are there are prettier way? I feel that calling >>> > org.apache.wicket.injection.Injector.get().inject(Object object) >>> > inside my panels sort of violates the IOC principle? >>> > >>> > 2010/9/23 Martin Makundi : >>> >> What is your need exactly? >>> >> >>> >> ** >>> >> Martin >>> >> >>> >> 2010/9/23 nino martinez wael : >>> >>> Hi >>> >>> >>> >>> what should I do if I want to use IOC in my panels? In short I >>> >>> need a >>> >>> sort of a provider injected into a panel, what's the prettiest >>> >>> way to >>> >>> do it? >>> >>> >>> >>> regards Nino >>> >>> >>> >>> - >>> >>> 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 >>> >> >>> >> >>> > >>> > - >>> > 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 >>> >>> >> > > - > 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 - 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 co
Re: using IOC in panels?
You don't need to have Wicket instantiate anything for you. The listener knows when you instantiate any component (Component's constructor does the magic). Just use @SpringBean in your panel and it will work. On Thu, Sep 23, 2010 at 6:07 AM, Ernesto Reinaldo Barreiro wrote: > Shall I create an RFE? Or this something that does not make much sense? > > Ernesto > > On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael > wrote: >> yeah that would be handy. >> >> 2010/9/23 Ernesto Reinaldo Barreiro : >>> Martin, >>> >>> Yes, I see: >>> >>> getApplication().notifyComponentInstantiationListeners(this); >>> >>> Would it make sense (for 1.5) to have: >>> >>> -an interface IInstantiable >>> -modify >>> >>> public interface IComponentInstantiationListener >>> { >>> /** >>> * Called for every component that is instantiated. This method is >>> called >>> * during construction, so do not depend on the >>> construction being completed >>> * yet. The id is guaranteed to be set before this call. >>> * >>> * @param component >>> * the component that is being instantiated. >>> */ >>> void onInstantiation(IInstantiable component); >>> } >>> >>> So that other classes could use the same trick by implementing >>> IInstantiable ? >>> >>> Cheers, >>> >>> Ernesto >>> >>> On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov >>> wrote: Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > There is a component instantiation listener that takes care of that: > you just use new as "always". > > Ernesto > > On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael > wrote: > > but how should panel then be managed.. > > > > Because if I create the panel myself in the page it won't work right? > > Can I ask wicket to instansiate my panel? > > > > 2010/9/23 Martin Grigorov : > >> Panel is a Component, so you can use @Inject on the Panel members. > >> Use Injector.get().inject(target) only in non Component classes. > >> > >> P.S. The API above is for 1.5. > >> > >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < > >> martin.maku...@koodaripalvelut.com> wrote: > >> > >>> You must weigh benefits and cons about whereto manage your IOC. > >>> > >>> ** > >>> Martin > >>> > >>> 2010/9/23 nino martinez wael : > >>> > I need to be able to inject a service into my panel.. > >>> > > >>> > Should I then just use: > >>> > > >>> > org.apache.wicket.injection.Injector.get().inject(Object object). > >>> > > >>> > or are there are prettier way? I feel that calling > >>> > org.apache.wicket.injection.Injector.get().inject(Object object) > >>> > inside my panels sort of violates the IOC principle? > >>> > > >>> > 2010/9/23 Martin Makundi : > >>> >> What is your need exactly? > >>> >> > >>> >> ** > >>> >> Martin > >>> >> > >>> >> 2010/9/23 nino martinez wael : > >>> >>> Hi > >>> >>> > >>> >>> what should I do if I want to use IOC in my panels? In short I > >>> >>> need > a > >>> >>> sort of a provider injected into a panel, what's the prettiest way > to > >>> >>> do it? > >>> >>> > >>> >>> regards Nino > >>> >>> > >>> >>> > - > >>> >>> 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 > >>> >> > >>> >> > >>> > > >>> > - > >>> > 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 > >>> > >>> > >> > > > > - > > 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...@wick
Re: using IOC in panels?
Shall I create an RFE? Or this something that does not make much sense? Ernesto On Thu, Sep 23, 2010 at 11:51 AM, nino martinez wael wrote: > yeah that would be handy. > > 2010/9/23 Ernesto Reinaldo Barreiro : >> Martin, >> >> Yes, I see: >> >> getApplication().notifyComponentInstantiationListeners(this); >> >> Would it make sense (for 1.5) to have: >> >> -an interface IInstantiable >> -modify >> >> public interface IComponentInstantiationListener >> { >> /** >> * Called for every component that is instantiated. This method is >> called >> * during construction, so do not depend on the >> construction being completed >> * yet. The id is guaranteed to be set before this call. >> * >> * @param component >> * the component that is being instantiated. >> */ >> void onInstantiation(IInstantiable component); >> } >> >> So that other classes could use the same trick by implementing IInstantiable >> ? >> >> Cheers, >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov >> wrote: >>> Panel's constructor calls super() and Component's ctor asks the >>> instantiation listener to do its work >>> >>> On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < >>> reier...@gmail.com> wrote: >>> There is a component instantiation listener that takes care of that: you just use new as "always". Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael wrote: > but how should panel then be managed.. > > Because if I create the panel myself in the page it won't work right? > Can I ask wicket to instansiate my panel? > > 2010/9/23 Martin Grigorov : >> Panel is a Component, so you can use @Inject on the Panel members. >> Use Injector.get().inject(target) only in non Component classes. >> >> P.S. The API above is for 1.5. >> >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < >> martin.maku...@koodaripalvelut.com> wrote: >> >>> You must weigh benefits and cons about whereto manage your IOC. >>> >>> ** >>> Martin >>> >>> 2010/9/23 nino martinez wael : >>> > I need to be able to inject a service into my panel.. >>> > >>> > Should I then just use: >>> > >>> > org.apache.wicket.injection.Injector.get().inject(Object object). >>> > >>> > or are there are prettier way? I feel that calling >>> > org.apache.wicket.injection.Injector.get().inject(Object object) >>> > inside my panels sort of violates the IOC principle? >>> > >>> > 2010/9/23 Martin Makundi : >>> >> What is your need exactly? >>> >> >>> >> ** >>> >> Martin >>> >> >>> >> 2010/9/23 nino martinez wael : >>> >>> Hi >>> >>> >>> >>> what should I do if I want to use IOC in my panels? In short I need a >>> >>> sort of a provider injected into a panel, what's the prettiest way to >>> >>> do it? >>> >>> >>> >>> regards Nino >>> >>> >>> >>> - >>> >>> 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 >>> >> >>> >> >>> > >>> > - >>> > 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 >>> >>> >> > > - > 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 >>> >> >> - >> 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: onload
Hi, 2010/9/23 Martin Grigorov : > Why do you have two components on "bodyElement" ? > > WebMarkupContainer body = new WebMarkupContainer("bodyElement"); Yes it is redundant, but dosent seem to make a difference weather it is there or not. Thanks, Jess > add(new WebMarkupContainer("bodyElement") { > > On Thu, Sep 23, 2010 at 11:00 AM, Ole Hansen wrote: > >> Hi, >> >> Newbee question: I need to add the onload attribute to the body tag (I >> can't use other methods to accomplish the same thing...) >> >> My html: >> >> >> ... >> >> >> >> ... >> >> >> >> >> Java: >> WebMarkupContainer body = new WebMarkupContainer("bodyElement"); >> >> add(new WebMarkupContainer("bodyElement") { >> �...@override >> public boolean isTransparentResolver() { >> return true; >> } >> �...@override >> protected void onComponentTag(final ComponentTag tag) { >> super.onComponentTag(tag); >> tag.put("onload", "onload();"); >> } >> }); >> >> Result html: >> >> >> ... >> >> >> >> ... >> >> I now have two body start tags. >> The code below results in a runtime exception stating that bodyElement >> was not declared.. >> >> >> >> ... >> >> >> >> >> I have also tried adding: >> add(new BodyTagAttributeModifier("onload", true, new Model("onload();"), >> this)); >> >> But nothing gets added to the body tag. >> >> Can someone direct me in the right direction? >> >> >> Wicket version: 1.4.1 >> JDK: IBM JDK 5.0.10 >> >> Regards, >> Jess >> >> - >> 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: using IOC in panels?
yeah that would be handy. 2010/9/23 Ernesto Reinaldo Barreiro : > Martin, > > Yes, I see: > > getApplication().notifyComponentInstantiationListeners(this); > > Would it make sense (for 1.5) to have: > > -an interface IInstantiable > -modify > > public interface IComponentInstantiationListener > { > /** > * Called for every component that is instantiated. This method is > called > * during construction, so do not depend on the > construction being completed > * yet. The id is guaranteed to be set before this call. > * > * @param component > * the component that is being instantiated. > */ > void onInstantiation(IInstantiable component); > } > > So that other classes could use the same trick by implementing IInstantiable ? > > Cheers, > > Ernesto > > On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov > wrote: >> Panel's constructor calls super() and Component's ctor asks the >> instantiation listener to do its work >> >> On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < >> reier...@gmail.com> wrote: >> >>> There is a component instantiation listener that takes care of that: >>> you just use new as "always". >>> >>> Ernesto >>> >>> On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael >>> wrote: >>> > but how should panel then be managed.. >>> > >>> > Because if I create the panel myself in the page it won't work right? >>> > Can I ask wicket to instansiate my panel? >>> > >>> > 2010/9/23 Martin Grigorov : >>> >> Panel is a Component, so you can use @Inject on the Panel members. >>> >> Use Injector.get().inject(target) only in non Component classes. >>> >> >>> >> P.S. The API above is for 1.5. >>> >> >>> >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < >>> >> martin.maku...@koodaripalvelut.com> wrote: >>> >> >>> >>> You must weigh benefits and cons about whereto manage your IOC. >>> >>> >>> >>> ** >>> >>> Martin >>> >>> >>> >>> 2010/9/23 nino martinez wael : >>> >>> > I need to be able to inject a service into my panel.. >>> >>> > >>> >>> > Should I then just use: >>> >>> > >>> >>> > org.apache.wicket.injection.Injector.get().inject(Object object). >>> >>> > >>> >>> > or are there are prettier way? I feel that calling >>> >>> > org.apache.wicket.injection.Injector.get().inject(Object object) >>> >>> > inside my panels sort of violates the IOC principle? >>> >>> > >>> >>> > 2010/9/23 Martin Makundi : >>> >>> >> What is your need exactly? >>> >>> >> >>> >>> >> ** >>> >>> >> Martin >>> >>> >> >>> >>> >> 2010/9/23 nino martinez wael : >>> >>> >>> Hi >>> >>> >>> >>> >>> >>> what should I do if I want to use IOC in my panels? In short I need >>> a >>> >>> >>> sort of a provider injected into a panel, what's the prettiest way >>> to >>> >>> >>> do it? >>> >>> >>> >>> >>> >>> regards Nino >>> >>> >>> >>> >>> >>> >>> - >>> >>> >>> 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 >>> >>> >> >>> >>> >> >>> >>> > >>> >>> > - >>> >>> > 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 >>> >>> >>> >>> >>> >> >>> > >>> > - >>> > 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 >>> >>> >> > > - > 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: using IOC in panels?
Martin, Yes, I see: getApplication().notifyComponentInstantiationListeners(this); Would it make sense (for 1.5) to have: -an interface IInstantiable -modify public interface IComponentInstantiationListener { /** * Called for every component that is instantiated. This method is called * during construction, so do not depend on the construction being completed * yet. The id is guaranteed to be set before this call. * * @param component *the component that is being instantiated. */ void onInstantiation(IInstantiable component); } So that other classes could use the same trick by implementing IInstantiable ? Cheers, Ernesto On Thu, Sep 23, 2010 at 11:34 AM, Martin Grigorov wrote: > Panel's constructor calls super() and Component's ctor asks the > instantiation listener to do its work > > On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < > reier...@gmail.com> wrote: > >> There is a component instantiation listener that takes care of that: >> you just use new as "always". >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael >> wrote: >> > but how should panel then be managed.. >> > >> > Because if I create the panel myself in the page it won't work right? >> > Can I ask wicket to instansiate my panel? >> > >> > 2010/9/23 Martin Grigorov : >> >> Panel is a Component, so you can use @Inject on the Panel members. >> >> Use Injector.get().inject(target) only in non Component classes. >> >> >> >> P.S. The API above is for 1.5. >> >> >> >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < >> >> martin.maku...@koodaripalvelut.com> wrote: >> >> >> >>> You must weigh benefits and cons about whereto manage your IOC. >> >>> >> >>> ** >> >>> Martin >> >>> >> >>> 2010/9/23 nino martinez wael : >> >>> > I need to be able to inject a service into my panel.. >> >>> > >> >>> > Should I then just use: >> >>> > >> >>> > org.apache.wicket.injection.Injector.get().inject(Object object). >> >>> > >> >>> > or are there are prettier way? I feel that calling >> >>> > org.apache.wicket.injection.Injector.get().inject(Object object) >> >>> > inside my panels sort of violates the IOC principle? >> >>> > >> >>> > 2010/9/23 Martin Makundi : >> >>> >> What is your need exactly? >> >>> >> >> >>> >> ** >> >>> >> Martin >> >>> >> >> >>> >> 2010/9/23 nino martinez wael : >> >>> >>> Hi >> >>> >>> >> >>> >>> what should I do if I want to use IOC in my panels? In short I need >> a >> >>> >>> sort of a provider injected into a panel, what's the prettiest way >> to >> >>> >>> do it? >> >>> >>> >> >>> >>> regards Nino >> >>> >>> >> >>> >>> >> - >> >>> >>> 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 >> >>> >> >> >>> >> >> >>> > >> >>> > - >> >>> > 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 >> >>> >> >>> >> >> >> > >> > - >> > 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 >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket 1.5 migration guide lacking mount information
See MountedMapperTest On Thu, Sep 23, 2010 at 11:43 AM, nino martinez wael < nino.martinez.w...@gmail.com> wrote: > Hehe, wrong link to the documentation.. > > But I actually do not get named parameters(it's just null) when using > MountedMapper.. > > 2010/9/23 Martin Grigorov : > > Hi Nino, > > > > On Thu, Sep 23, 2010 at 11:10 AM, nino martinez wael < > > nino.martinez.w...@gmail.com> wrote: > > > >> seem the wicket examples also are incomplete here as they uses > deprecated > >> calls: > >> > >> > >> > http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/niceurl/NiceUrlApplication.java > >> > > Currently the examples use the deprecated #mount() method which delegates > to > > the new one: > > org.apache.wicket.Application.getRootRequestMapperAsCompound().add(new > > MountedMapper("path", MyPage.class)); > > > > Soon we will introduce something like mountPage("path", MyPage.class) > which > > will do the same as above but with less typing. > > The same for mountResource("path", ResourceReference) (this will use > > ResourceMapper). > > getRootRequestMapperAsCompound() will stay there for the other less used > > mappers and your custom mappers. > > > >> > >> Igor and Martin seems to be working on a new example: > >> > >> > >> > http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper > >> > > > >> But what would the correct 1.5 way to mount a bookmarkablepage with a > >> querystringurlcodingstrategy? > >> > > use MountedMapper. It is smart mapper - works with both indexed and named > > parameters. > > To read them: pageParameters.get("name") or .get(0) - indexed. > > > >> > >> 2010/9/23 nino martinez wael : > >> > Hi > >> > > >> > Seems the way you mount pages has been change, the migration guide > >> > ( > >> > https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-WicketIOCchanges > >> ) > >> > does not mention this. > >> > > IOC changes are not related to page mapping ;-) > > > >> > > >> > Also the default way that 1.4 mapped pages was as a > >> > querystringurlcodingstrategy AFAIK, this has changed to indexed > >> > aswell.. > >> > > >> > regards Nino > >> > > >> > >> - > >> 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: wicket 1.5 migration guide lacking mount information
Hehe, wrong link to the documentation.. But I actually do not get named parameters(it's just null) when using MountedMapper.. 2010/9/23 Martin Grigorov : > Hi Nino, > > On Thu, Sep 23, 2010 at 11:10 AM, nino martinez wael < > nino.martinez.w...@gmail.com> wrote: > >> seem the wicket examples also are incomplete here as they uses deprecated >> calls: >> >> >> http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/niceurl/NiceUrlApplication.java >> > Currently the examples use the deprecated #mount() method which delegates to > the new one: > org.apache.wicket.Application.getRootRequestMapperAsCompound().add(new > MountedMapper("path", MyPage.class)); > > Soon we will introduce something like mountPage("path", MyPage.class) which > will do the same as above but with less typing. > The same for mountResource("path", ResourceReference) (this will use > ResourceMapper). > getRootRequestMapperAsCompound() will stay there for the other less used > mappers and your custom mappers. > >> >> Igor and Martin seems to be working on a new example: >> >> >> http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper >> > >> But what would the correct 1.5 way to mount a bookmarkablepage with a >> querystringurlcodingstrategy? >> > use MountedMapper. It is smart mapper - works with both indexed and named > parameters. > To read them: pageParameters.get("name") or .get(0) - indexed. > >> >> 2010/9/23 nino martinez wael : >> > Hi >> > >> > Seems the way you mount pages has been change, the migration guide >> > ( >> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-WicketIOCchanges >> ) >> > does not mention this. >> > IOC changes are not related to page mapping ;-) > >> > >> > Also the default way that 1.4 mapped pages was as a >> > querystringurlcodingstrategy AFAIK, this has changed to indexed >> > aswell.. >> > >> > regards Nino >> > >> >> - >> 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: using IOC in panels?
ahh cool :) And thanks.. I know im "spamming" alot currently.. 2010/9/23 Martin Grigorov : > Panel's constructor calls super() and Component's ctor asks the > instantiation listener to do its work > > On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < > reier...@gmail.com> wrote: > >> There is a component instantiation listener that takes care of that: >> you just use new as "always". >> >> Ernesto >> >> On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael >> wrote: >> > but how should panel then be managed.. >> > >> > Because if I create the panel myself in the page it won't work right? >> > Can I ask wicket to instansiate my panel? >> > >> > 2010/9/23 Martin Grigorov : >> >> Panel is a Component, so you can use @Inject on the Panel members. >> >> Use Injector.get().inject(target) only in non Component classes. >> >> >> >> P.S. The API above is for 1.5. >> >> >> >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < >> >> martin.maku...@koodaripalvelut.com> wrote: >> >> >> >>> You must weigh benefits and cons about whereto manage your IOC. >> >>> >> >>> ** >> >>> Martin >> >>> >> >>> 2010/9/23 nino martinez wael : >> >>> > I need to be able to inject a service into my panel.. >> >>> > >> >>> > Should I then just use: >> >>> > >> >>> > org.apache.wicket.injection.Injector.get().inject(Object object). >> >>> > >> >>> > or are there are prettier way? I feel that calling >> >>> > org.apache.wicket.injection.Injector.get().inject(Object object) >> >>> > inside my panels sort of violates the IOC principle? >> >>> > >> >>> > 2010/9/23 Martin Makundi : >> >>> >> What is your need exactly? >> >>> >> >> >>> >> ** >> >>> >> Martin >> >>> >> >> >>> >> 2010/9/23 nino martinez wael : >> >>> >>> Hi >> >>> >>> >> >>> >>> what should I do if I want to use IOC in my panels? In short I need >> a >> >>> >>> sort of a provider injected into a panel, what's the prettiest way >> to >> >>> >>> do it? >> >>> >>> >> >>> >>> regards Nino >> >>> >>> >> >>> >>> >> - >> >>> >>> 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 >> >>> >> >> >>> >> >> >>> > >> >>> > - >> >>> > 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 >> >>> >> >>> >> >> >> > >> > - >> > 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 >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Panel's constructor calls super() and Component's ctor asks the instantiation listener to do its work On Thu, Sep 23, 2010 at 11:21 AM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > There is a component instantiation listener that takes care of that: > you just use new as "always". > > Ernesto > > On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael > wrote: > > but how should panel then be managed.. > > > > Because if I create the panel myself in the page it won't work right? > > Can I ask wicket to instansiate my panel? > > > > 2010/9/23 Martin Grigorov : > >> Panel is a Component, so you can use @Inject on the Panel members. > >> Use Injector.get().inject(target) only in non Component classes. > >> > >> P.S. The API above is for 1.5. > >> > >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < > >> martin.maku...@koodaripalvelut.com> wrote: > >> > >>> You must weigh benefits and cons about whereto manage your IOC. > >>> > >>> ** > >>> Martin > >>> > >>> 2010/9/23 nino martinez wael : > >>> > I need to be able to inject a service into my panel.. > >>> > > >>> > Should I then just use: > >>> > > >>> > org.apache.wicket.injection.Injector.get().inject(Object object). > >>> > > >>> > or are there are prettier way? I feel that calling > >>> > org.apache.wicket.injection.Injector.get().inject(Object object) > >>> > inside my panels sort of violates the IOC principle? > >>> > > >>> > 2010/9/23 Martin Makundi : > >>> >> What is your need exactly? > >>> >> > >>> >> ** > >>> >> Martin > >>> >> > >>> >> 2010/9/23 nino martinez wael : > >>> >>> Hi > >>> >>> > >>> >>> what should I do if I want to use IOC in my panels? In short I need > a > >>> >>> sort of a provider injected into a panel, what's the prettiest way > to > >>> >>> do it? > >>> >>> > >>> >>> regards Nino > >>> >>> > >>> >>> > - > >>> >>> 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 > >>> >> > >>> >> > >>> > > >>> > - > >>> > 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 > >>> > >>> > >> > > > > - > > 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: wicket 1.5 migration guide lacking mount information
Hi Nino, On Thu, Sep 23, 2010 at 11:10 AM, nino martinez wael < nino.martinez.w...@gmail.com> wrote: > seem the wicket examples also are incomplete here as they uses deprecated > calls: > > > http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/niceurl/NiceUrlApplication.java > Currently the examples use the deprecated #mount() method which delegates to the new one: org.apache.wicket.Application.getRootRequestMapperAsCompound().add(new MountedMapper("path", MyPage.class)); Soon we will introduce something like mountPage("path", MyPage.class) which will do the same as above but with less typing. The same for mountResource("path", ResourceReference) (this will use ResourceMapper). getRootRequestMapperAsCompound() will stay there for the other less used mappers and your custom mappers. > > Igor and Martin seems to be working on a new example: > > > http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper > > But what would the correct 1.5 way to mount a bookmarkablepage with a > querystringurlcodingstrategy? > use MountedMapper. It is smart mapper - works with both indexed and named parameters. To read them: pageParameters.get("name") or .get(0) - indexed. > > 2010/9/23 nino martinez wael : > > Hi > > > > Seems the way you mount pages has been change, the migration guide > > ( > https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-WicketIOCchanges > ) > > does not mention this. > IOC changes are not related to page mapping ;-) > > > > Also the default way that 1.4 mapped pages was as a > > querystringurlcodingstrategy AFAIK, this has changed to indexed > > aswell.. > > > > regards Nino > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Saving a component in session
Forgot to mention that the component is an AjaxEditableLabel and I need to save it to session because I'm creating a custom wicket tag for translation purposes. When in translator mode I want all the labels to be replaced by AjaxEditableLabel's so that the translator can do his job easier. The problem I have is that when I click on the label of the AjaxEditableLabel, it produces an ajax request in order to change visibility modes and show the edit box. I did my custom tag replacing by implementing an IComponentResolver, which (from what I figured) happens on render. So my AjaxEditableLabel component isn't in the page when the Ajax request arrives. I planned to solve this by fetching the missing component from the session on my own, by overwriting resolveListenerInterfaceTarget. Now when I fetch the original AjaxEditableLabel from the session, all it's children (the Label and TextField) are gone. Any ideas will be much appreciated. Thanks, Alexandru On 09/23/2010 11:57 AM, Alexandru Artimon wrote: Hello, I have a problem when saving a component to the session, all it's children disappear. I do the save like this: session.bind(); session.setMetaData(MY_KEY, component); Regards, Alexandru
Re: using IOC in panels?
There is a component instantiation listener that takes care of that: you just use new as "always". Ernesto On Thu, Sep 23, 2010 at 11:17 AM, nino martinez wael wrote: > but how should panel then be managed.. > > Because if I create the panel myself in the page it won't work right? > Can I ask wicket to instansiate my panel? > > 2010/9/23 Martin Grigorov : >> Panel is a Component, so you can use @Inject on the Panel members. >> Use Injector.get().inject(target) only in non Component classes. >> >> P.S. The API above is for 1.5. >> >> On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < >> martin.maku...@koodaripalvelut.com> wrote: >> >>> You must weigh benefits and cons about whereto manage your IOC. >>> >>> ** >>> Martin >>> >>> 2010/9/23 nino martinez wael : >>> > I need to be able to inject a service into my panel.. >>> > >>> > Should I then just use: >>> > >>> > org.apache.wicket.injection.Injector.get().inject(Object object). >>> > >>> > or are there are prettier way? I feel that calling >>> > org.apache.wicket.injection.Injector.get().inject(Object object) >>> > inside my panels sort of violates the IOC principle? >>> > >>> > 2010/9/23 Martin Makundi : >>> >> What is your need exactly? >>> >> >>> >> ** >>> >> Martin >>> >> >>> >> 2010/9/23 nino martinez wael : >>> >>> Hi >>> >>> >>> >>> what should I do if I want to use IOC in my panels? In short I need a >>> >>> sort of a provider injected into a panel, what's the prettiest way to >>> >>> do it? >>> >>> >>> >>> regards Nino >>> >>> >>> >>> - >>> >>> 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 >>> >> >>> >> >>> > >>> > - >>> > 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 >>> >>> >> > > - > 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: using IOC in panels?
but how should panel then be managed.. Because if I create the panel myself in the page it won't work right? Can I ask wicket to instansiate my panel? 2010/9/23 Martin Grigorov : > Panel is a Component, so you can use @Inject on the Panel members. > Use Injector.get().inject(target) only in non Component classes. > > P.S. The API above is for 1.5. > > On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> You must weigh benefits and cons about whereto manage your IOC. >> >> ** >> Martin >> >> 2010/9/23 nino martinez wael : >> > I need to be able to inject a service into my panel.. >> > >> > Should I then just use: >> > >> > org.apache.wicket.injection.Injector.get().inject(Object object). >> > >> > or are there are prettier way? I feel that calling >> > org.apache.wicket.injection.Injector.get().inject(Object object) >> > inside my panels sort of violates the IOC principle? >> > >> > 2010/9/23 Martin Makundi : >> >> What is your need exactly? >> >> >> >> ** >> >> Martin >> >> >> >> 2010/9/23 nino martinez wael : >> >>> Hi >> >>> >> >>> what should I do if I want to use IOC in my panels? In short I need a >> >>> sort of a provider injected into a panel, what's the prettiest way to >> >>> do it? >> >>> >> >>> regards Nino >> >>> >> >>> - >> >>> 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 >> >> >> >> >> > >> > - >> > 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 >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
Panel is a Component, so you can use @Inject on the Panel members. Use Injector.get().inject(target) only in non Component classes. P.S. The API above is for 1.5. On Thu, Sep 23, 2010 at 11:03 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > You must weigh benefits and cons about whereto manage your IOC. > > ** > Martin > > 2010/9/23 nino martinez wael : > > I need to be able to inject a service into my panel.. > > > > Should I then just use: > > > > org.apache.wicket.injection.Injector.get().inject(Object object). > > > > or are there are prettier way? I feel that calling > > org.apache.wicket.injection.Injector.get().inject(Object object) > > inside my panels sort of violates the IOC principle? > > > > 2010/9/23 Martin Makundi : > >> What is your need exactly? > >> > >> ** > >> Martin > >> > >> 2010/9/23 nino martinez wael : > >>> Hi > >>> > >>> what should I do if I want to use IOC in my panels? In short I need a > >>> sort of a provider injected into a panel, what's the prettiest way to > >>> do it? > >>> > >>> regards Nino > >>> > >>> - > >>> 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 > >> > >> > > > > - > > 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: onload
Why do you have two components on "bodyElement" ? WebMarkupContainer body = new WebMarkupContainer("bodyElement"); add(new WebMarkupContainer("bodyElement") { On Thu, Sep 23, 2010 at 11:00 AM, Ole Hansen wrote: > Hi, > > Newbee question: I need to add the onload attribute to the body tag (I > can't use other methods to accomplish the same thing...) > > My html: > > > ... > > > > ... > > > > > Java: > WebMarkupContainer body = new WebMarkupContainer("bodyElement"); > > add(new WebMarkupContainer("bodyElement") { > @Override > public boolean isTransparentResolver() { >return true; > } > @Override > protected void onComponentTag(final ComponentTag tag) { >super.onComponentTag(tag); >tag.put("onload", "onload();"); > } > }); > > Result html: > > > ... > > > > ... > > I now have two body start tags. > The code below results in a runtime exception stating that bodyElement > was not declared.. > > > > ... > > > > > I have also tried adding: > add(new BodyTagAttributeModifier("onload", true, new Model("onload();"), > this)); > > But nothing gets added to the body tag. > > Can someone direct me in the right direction? > > > Wicket version: 1.4.1 > JDK: IBM JDK 5.0.10 > > Regards, > Jess > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: wicket 1.5 migration guide lacking mount information
seem the wicket examples also are incomplete here as they uses deprecated calls: http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/niceurl/NiceUrlApplication.java Igor and Martin seems to be working on a new example: http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper But what would the correct 1.5 way to mount a bookmarkablepage with a querystringurlcodingstrategy? 2010/9/23 nino martinez wael : > Hi > > Seems the way you mount pages has been change, the migration guide > (https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-WicketIOCchanges) > does not mention this. > > Also the default way that 1.4 mapped pages was as a > querystringurlcodingstrategy AFAIK, this has changed to indexed > aswell.. > > regards Nino > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket 1.5 migration guide lacking mount information
Hi Seems the way you mount pages has been change, the migration guide (https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-WicketIOCchanges) does not mention this. Also the default way that 1.4 mapped pages was as a querystringurlcodingstrategy AFAIK, this has changed to indexed aswell.. regards Nino - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
SV: Removing jsessionid from URl
> is it because a user disables cookies in the browser? Yes, in that case the rewritten URLs are needed to maintain session state. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using IOC in panels?
You must weigh benefits and cons about whereto manage your IOC. ** Martin 2010/9/23 nino martinez wael : > I need to be able to inject a service into my panel.. > > Should I then just use: > > org.apache.wicket.injection.Injector.get().inject(Object object). > > or are there are prettier way? I feel that calling > org.apache.wicket.injection.Injector.get().inject(Object object) > inside my panels sort of violates the IOC principle? > > 2010/9/23 Martin Makundi : >> What is your need exactly? >> >> ** >> Martin >> >> 2010/9/23 nino martinez wael : >>> Hi >>> >>> what should I do if I want to use IOC in my panels? In short I need a >>> sort of a provider injected into a panel, what's the prettiest way to >>> do it? >>> >>> regards Nino >>> >>> - >>> 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 >> >> > > - > 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: using IOC in panels?
Nino, Can you just @SpringBean or @Inject? Don't know if this is the "pretties way" as this might be a matter of personal taste;-) Enresto On Thu, Sep 23, 2010 at 10:14 AM, nino martinez wael wrote: > Hi > > what should I do if I want to use IOC in my panels? In short I need a > sort of a provider injected into a panel, what's the prettiest way to > do it? > > regards Nino > > - > 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: using IOC in panels?
I need to be able to inject a service into my panel.. Should I then just use: org.apache.wicket.injection.Injector.get().inject(Object object). or are there are prettier way? I feel that calling org.apache.wicket.injection.Injector.get().inject(Object object) inside my panels sort of violates the IOC principle? 2010/9/23 Martin Makundi : > What is your need exactly? > > ** > Martin > > 2010/9/23 nino martinez wael : >> Hi >> >> what should I do if I want to use IOC in my panels? In short I need a >> sort of a provider injected into a panel, what's the prettiest way to >> do it? >> >> regards Nino >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
onload
Hi, Newbee question: I need to add the onload attribute to the body tag (I can't use other methods to accomplish the same thing...) My html: ... ... Java: WebMarkupContainer body = new WebMarkupContainer("bodyElement"); add(new WebMarkupContainer("bodyElement") { �...@override public boolean isTransparentResolver() { return true; } �...@override protected void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); tag.put("onload", "onload();"); } }); Result html: ... ... I now have two body start tags. The code below results in a runtime exception stating that bodyElement was not declared.. ... I have also tried adding: add(new BodyTagAttributeModifier("onload", true, new Model("onload();"), this)); But nothing gets added to the body tag. Can someone direct me in the right direction? Wicket version: 1.4.1 JDK: IBM JDK 5.0.10 Regards, Jess - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Saving a component in session
Hello, I have a problem when saving a component to the session, all it's children disappear. I do the save like this: session.bind(); session.setMetaData(MY_KEY, component); Regards, Alexandru
Re: using IOC in panels?
What is your need exactly? ** Martin 2010/9/23 nino martinez wael : > Hi > > what should I do if I want to use IOC in my panels? In short I need a > sort of a provider injected into a panel, what's the prettiest way to > do it? > > regards Nino > > - > 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: FeedbackPanel does not clean up after displaying error messages using Ajax
> Don't worry, we've all had those head <--> palm moments :) PEBKAC. :) Maybe a FindBugs plugin that checks that overridden methods always have a non-empty implementation? Even the Eclipse built-in test for empty blocks would help in some cases (except it allows a comment to satisfy the condition). - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Removing jsessionid from URl
is it because a user disables cookies in the browser? On Wed, Sep 22, 2010 at 7:35 AM, Wilhelmsen Tor Iver wrote: > > I have been tryin to figure out what to do to remove jsessionid from > > the URL > > The web container will add that to the first response URL when a session is > created in case cookies are not supported. What is corny is that this is not > further maintained (in a non-cookie situation) without the developer > explicitly calling ServletResponse.encodeURL() for all URLs - the container > should maintain the responsibility for you. > > - Tor Iver > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Aladejebi Ayodeji A., DabarObjects Solutions Phone: +234 9 875 1763 Mobile: +234 803 589 1780 Email: d...@dabarobjects.com Web: www.dabarobjects.com
onload
Hi, Newbee question: I need to add the onload attribute to the body tag (I can't use other methods to accomplish the same thing...) My html: http://www.w3.org/1999/xhtml"; xmlns:wicket="http://org.apache.wicket.sourceforge.net/"; > ... ... Java: WebMarkupContainer body = new WebMarkupContainer("bodyElement"); add(new WebMarkupContainer("bodyElement") { �...@override public boolean isTransparentResolver() { return true; } �...@override protected void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); tag.put("onload", "onload();"); } }); Result html: ... ... I now have two body start tags. The code below results in a runtime exception stating that bodyElement was not declared.. ... I have also tried adding: add(new BodyTagAttributeModifier("onload", true, new Model("onload();"), this)); But nothing gets added to the body tag. Can someone direct me in the right direction? Wicket version: 1.4.1 JDK: IBM JDK 5.0.10 Regards, Jess - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
using IOC in panels?
Hi what should I do if I want to use IOC in my panels? In short I need a sort of a provider injected into a panel, what's the prettiest way to do it? regards Nino - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Too frequent page creation in portlet environment
We are running Glassfish 3.0.1 + Liferay 5.2.3 and have some portlets using Wicket 1.4.9 (in deployment mode). These work fine on the platform when running on our local Windows developer PCs, but when deployed onto a Solaris server running the same software, forms stop working. Debugging indicates that the Pages' constructors are called more times than expected, i.e. submitting a portlet's form creates a new page (instead of using the instance created for the first rendering and which ought to be in the Session), once for the action phase (with the form data present) and then once for the render phase (where of course the parameters have gone). Debug output indicates that it does not create new Sessions, so the SessionStore seems OK. Is there some configuration that can differ between the two environments that can cause Wicket to behave differently? Can it be PageStore issues? Med vennlig hilsen TOR IVER WILHELMSEN Senior systemutvikler Arrive AS T (+47) 48 16 06 18 E-post: toriv...@arrive.no http://www.arrive.no http://servicedesk.arrive.no
Re: Hiding parts of the path
you can try writing your own webrequestcodingstrategy, but be careful not to break relative urls. -igor On Wed, Sep 22, 2010 at 11:59 PM, Bert wrote: > Hi list, > > i want to services the same app using different (but structural > identical) databases. > say: > > http://foo.org/site/alpha > http://foo.org/site/beta > http://foo.org/site/ceti > ... > > I have managed to get JPA working with an routing datasource, to > switch the database > depending on the url path. > > Now i need to tell Wicket that it should basically ignore those extra > alpha, beta,.. path > component when looking up the request target and add it back when > generating urls. > > So, for Wicket, an incoming URL of http://foo.org/site/alpha/page1 > should be treated as > http://foo.org/site/site1. Of course, generated URL should include the > extra information... > > My first idea was to overwrite the WicketFilter.getRelativePath() and > remove the extra > path component. This did not work. > > Any other idea? Would an UrlCodingStrategy help? > > thanks in advance > Bert > > - > 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: announcing Granite - a Wicket-Scala-DB4O web application stack
> You could abstract the datastore in the stack using JDO/DataNucleus. It > supports DB40. In fact as it also supports RDBMS you could easily create > a datastore agnostic Wicket/Scala stack - that would be most awesome! > Just as a side note: there is/was an mini example with warp persist which can handle db4o+neodatis (and with some minor work also hibernate): http://karussell.wordpress.com/2010/01/18/crud-with-wicket-guice-db4o-neodatis/ Regards, Peter. -- http://jetwick.com twitter search prototype - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org