Re: Validating multiple components as one
Hi, The new way is to use the dynamic extra parameters. Each Ajax behavior and component has a method #updateAjaxAttributes(AjaxRequestAttributes attributes) : attributes.getDynamicExtraParameters().add("return [obj1, obj2, ...]"). Where objN are JavaScript objects like: {"name": formComponent.getInputName(), "value": Wicket.Form.serialize(Wicket.$('"+formComponent.getMarkupId()+"')) } The above is a pseudo code but I hope you follow me. Martin Grigorov Wicket Training and Consulting On Mon, Apr 14, 2014 at 8:45 PM, Christian Smolka < christian.smo...@etecture.de> wrote: > Hi to everybody! > > My little problem is about validating multiple input fields as a single > one. > So, I have three DoB fields (one for the day, one for the month and one > for the > year) that should be validated as a single date. > > While using Wicket 1.5 we overwrote AjaxEventBehavior#getEventHandler() and > returned a custom made JavaScript that serialized the three fields like > this: > > > StringBuffer buffer = new StringBuffer("wicketAjaxPost('") > .append(this.getCallbackUrl()).append("', "); > for (String id : this.getInputIds()) { > buffer.append("wicketSerialize(Wicket.$('").append(id).append("')) + > "); > } > buffer.setLength(buffer.length() - 3); > return buffer; > > > This worked pretty well. But I have to migrate the application to Wicket 6 > and this doing does work anymore. As far as I understood the new Ajax-way, > it isn't possible anymore to provide a custom script like the one above. > But > how can I restore the old behavior? Do I have to put the fields into a > form and > submit the whole form to validate it? > > Thanks in advance! > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Wicket CDI application junit test
Hi, See https://issues.apache.org/jira/browse/WICKET-5264 Martin Grigorov Wicket Training and Consulting On Tue, Apr 15, 2014 at 6:29 AM, Duke wrote: > Hi all. > Tried to build simple example with EntityManager injection: > > public class LoginPage extends BasePage { > > @Inject EntityManager em; > ... > } > > public class Application extends WebApplication { > @Override > protected void init() { > super.init(); > new CdiConfiguration().configure(this); > } > } > > It fails on new CdiConfiguration().configure(this); with message: > Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-70 > Simple > bean [EnhancedAnnotatedTypeImpl] class > org.apache.wicket.markup.html.panel.FeedbackPanel$1 cannot be a non-static > inner class > at > > org.jboss.weld.injection.producer.BasicInjectionTarget.checkType(BasicInjectionTarget.java:81) > at > > org.jboss.weld.injection.producer.BasicInjectionTarget.(BasicInjectionTarget.java:69) > at > > org.jboss.weld.injection.producer.BeanInjectionTarget.(BeanInjectionTarget.java:52) > at > > org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:95) > at > > org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:78) > > If I comment line with configuring of CdiConfiguration, all injections are > nulls (( > What I am doing wrong? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665402.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: Wicket CDI application junit test
Hi all. Tried to build simple example with EntityManager injection: public class LoginPage extends BasePage { @Inject EntityManager em; ... } public class Application extends WebApplication { @Override protected void init() { super.init(); new CdiConfiguration().configure(this); } } It fails on new CdiConfiguration().configure(this); with message: Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl] class org.apache.wicket.markup.html.panel.FeedbackPanel$1 cannot be a non-static inner class at org.jboss.weld.injection.producer.BasicInjectionTarget.checkType(BasicInjectionTarget.java:81) at org.jboss.weld.injection.producer.BasicInjectionTarget.(BasicInjectionTarget.java:69) at org.jboss.weld.injection.producer.BeanInjectionTarget.(BeanInjectionTarget.java:52) at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:95) at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:78) If I comment line with configuring of CdiConfiguration, all injections are nulls (( What I am doing wrong? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665402.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: Introducing Croquet: Combining Wicket, Jetty, Hibernate, and Guice
Off-topic a bit... on the JPA front, I'm still relatively new and finding it not as useful as I would have hoped. Beyond VERY simple read-by-primary-key and update/create/delete, anything else seems tedious. I'm having to learn the JPA query language (yes, you can use SQL but then you lose generics/typing). I'm highly considering updating another one of my projects SOP4J-DBUTILS (https://github.com/wspeirs/sop4j-dbutils) to handle JPA annotations for the basic CRUD operations, then just making it slightly easier to use complex where clauses to populate POJOs. Thoughts? Bill- P.S. We should probably take this off the Wicket list if folks want to continue discussing... On Mon, Apr 14, 2014 at 9:03 AM, Chris Snyder wrote: > Thanks for the reply - no worries on the delay. > > In my case, I'm using EclipseLink. I originally was using Hibernate, but > switched after encountering a known bug in Hibernate (the specifics of > which I no longer recall). Since I was sticking to using the pure JPA API, > it was a quick drop-in replacement. Recently, however, I have used a couple > of EclipseLink-specific features, so it wouldn't be as quick to switch back > (assuming that the bug in Hibernate has been fixed). > > This certainly wouldn't stop me from checking out Croquet - if I end up > adapting it to use EclipseLink, I'll be sure to share my changes. > > Best, > Chris > > > On Mon, Apr 14, 2014 at 8:44 AM, Bill Speirs > wrote: > > > Chris, sorry for not responding more quickly... was traveling back from > > ApacheCon NA. > > > > Honestly, it would be non-trivial to drop in a replacement to Hibernate. > > The JpaPersistService (http://goo.gl/FeI6xU) handles the configuration > > coming from persistence.xml and has nothing Hibernate specific. The > problem > > is the CroquetPersistService, DataSourceHibernateModule, and > > EntityManagerProxyFactory classes. > > > > What JPA provider would you rather use? I've never used anything but > > Hibernate, and never had issues with it... just curious why you'd like to > > use something else. > > > > Also, patches/pull requests are always happily accepted :-) > > > > Thanks for checking it out... > > > > Bill- > > > > > > On Wed, Apr 9, 2014 at 1:05 PM, Chris Snyder > >wrote: > > > > > Looks like awesome work - very clean page design and excellent > > > documentation, and I'm sure that the quality extends to the code as > well. > > > I'll definitely be looking into this for my next project, if not > porting > > > some of my current ones. > > > > > > When using Croquet, how easy would it be to drop in a different JPA > > > implementation in place of Hibernate? > > > > > > Best, > > > Chris > > > > > > > > > On Wed, Apr 9, 2014 at 12:51 PM, William Speirs > > > wrote: > > > > > > > I gave a talk at ApacheCon NA yesterday on Croquet. It is a > combination > > > of > > > > Wicket, Jetty, Hibernate, and Guice to make it super-easy to start > > > writing > > > > Wicket code almost immediately, instead of spending time configuring > > > > everything. > > > > > > > > Slides: > > > > > > > > > > > > > > https://docs.google.com/presentation/d/1m3jdbpYoSBOCPz8Wes9mPvhf8TLp_3dndj_gW08iFL8/ > > > > Code: https://github.com/metrink/croquet > > > > Docs: http://croquet.metrink.com > > > > > > > > Thanks... > > > > > > > > Bill- > > > > > > > > > > > > > -- > Chris Snyder > Web Developer, BioLogos > 616.328.5218 x203 > biologos.org >
Re: Validating multiple components as one
Do I have to put the fields into a form and submit the whole form Wrapping all three inputs in a form with an AjaxFormSubmitBehavior is the easiest solution. Do you have any problems with it? Sven On 04/14/2014 07:45 PM, Christian Smolka wrote: Hi to everybody! My little problem is about validating multiple input fields as a single one. So, I have three DoB fields (one for the day, one for the month and one for the year) that should be validated as a single date. While using Wicket 1.5 we overwrote AjaxEventBehavior#getEventHandler() and returned a custom made JavaScript that serialized the three fields like this: StringBuffer buffer = new StringBuffer("wicketAjaxPost('") .append(this.getCallbackUrl()).append("', "); for (String id : this.getInputIds()) { buffer.append("wicketSerialize(Wicket.$('").append(id).append("')) + "); } buffer.setLength(buffer.length() - 3); return buffer; This worked pretty well. But I have to migrate the application to Wicket 6 and this doing does work anymore. As far as I understood the new Ajax-way, it isn't possible anymore to provide a custom script like the one above. But how can I restore the old behavior? Do I have to put the fields into a form and submit the whole form to validate it? Thanks in advance! - 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: TinyMCE InPlaceEditComponent on Wicket 6
It's a problem introduced with the workaround at https://issues.apache.org/jira/browse/WICKET-5248 and never removed. If you try working with version 6.9.0 (both Wicket and WicketStuff) you shouldn't have this problem. I'm committing a fix. Yes, I'm using version 6.14 of wicketstuff-tinymce. Dirk. 2014-04-14 16:59 GMT+02:00 Martin Grigorov : Hi, Do you use wicketstuff-tinymce 6.14 as well ? http://central.maven.org/maven2/org/wicketstuff/wicketstuff-tinymce/6.14.0/ Martin Grigorov Wicket Training and Consulting On Mon, Apr 14, 2014 at 5:54 PM, Dirk Germonpré wrote: Hello, I'm working on a large web application. Parts of the application are still running on Wicket 1.4, but I'm in the process of migrating them to Wicket 6. We used the wicket.contrib.tinymce.InPlaceEditComponent for inline editing of large texts. This worked fine on Wicket 1.4, but there seem to be some problems on Wicket 6.14. I now have to double-click on a text label before it is turned into a TinyMCE editor. On Wicket 1.4 a single click was enough. I can work with the editor but once a click on the cancel button, things go wrong. I can open the editor again by double-clicking the text, but in the editor, nothing works anymore. Is anyone using the TinyMCE editor on Wicket 6? Kind regards, Dirk Germonpré. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Validating multiple components as one
Hi to everybody! My little problem is about validating multiple input fields as a single one. So, I have three DoB fields (one for the day, one for the month and one for the year) that should be validated as a single date. While using Wicket 1.5 we overwrote AjaxEventBehavior#getEventHandler() and returned a custom made JavaScript that serialized the three fields like this: StringBuffer buffer = new StringBuffer("wicketAjaxPost('") .append(this.getCallbackUrl()).append("', "); for (String id : this.getInputIds()) { buffer.append("wicketSerialize(Wicket.$('").append(id).append("')) + "); } buffer.setLength(buffer.length() - 3); return buffer; This worked pretty well. But I have to migrate the application to Wicket 6 and this doing does work anymore. As far as I understood the new Ajax-way, it isn't possible anymore to provide a custom script like the one above. But how can I restore the old behavior? Do I have to put the fields into a form and submit the whole form to validate it? Thanks in advance! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: TinyMCE InPlaceEditComponent on Wicket 6
Yes, I'm using version 6.14 of wicketstuff-tinymce. Dirk. 2014-04-14 16:59 GMT+02:00 Martin Grigorov : > Hi, > > Do you use wicketstuff-tinymce 6.14 as well ? > > http://central.maven.org/maven2/org/wicketstuff/wicketstuff-tinymce/6.14.0/ > > Martin Grigorov > Wicket Training and Consulting > > > On Mon, Apr 14, 2014 at 5:54 PM, Dirk Germonpré >wrote: > > > Hello, > > > > I'm working on a large web application. Parts of the application are > still > > running on Wicket 1.4, but I'm in the process of migrating them to Wicket > > 6. We used the wicket.contrib.tinymce.InPlaceEditComponent for inline > > editing of large texts. This worked fine on Wicket 1.4, but there seem to > > be some problems on Wicket 6.14. > > I now have to double-click on a text label before it is turned into a > > TinyMCE editor. On Wicket 1.4 a single click was enough. > > I can work with the editor but once a click on the cancel button, things > go > > wrong. I can open the editor again by double-clicking the text, but in > the > > editor, nothing works anymore. > > > > Is anyone using the TinyMCE editor on Wicket 6? > > > > Kind regards, > > Dirk Germonpré. > > > -- Dirk Germonpré adres: Zuiderboomgaard 9, 8310 Assebroek email: dirk.germon...@gmail.com vaste telefoon: 050/300500 gsm: 0485/915617
Two Questions
1) I have a feedback panel and when i add messages under info(), they do not show up. When I add the message via error(), it shows as expected. Why might this be? 2) I am using the @SpringBean annotation, works fine. But I want to inject a string property value that came from the properties file my spring reads. How would I get that? I tried ${myProp} in the @SpringBean, but that doesn't work...and I kinda thought it would be a longshot. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Two-Questions-tp4665394.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: TinyMCE InPlaceEditComponent on Wicket 6
Hi, Do you use wicketstuff-tinymce 6.14 as well ? http://central.maven.org/maven2/org/wicketstuff/wicketstuff-tinymce/6.14.0/ Martin Grigorov Wicket Training and Consulting On Mon, Apr 14, 2014 at 5:54 PM, Dirk Germonpré wrote: > Hello, > > I'm working on a large web application. Parts of the application are still > running on Wicket 1.4, but I'm in the process of migrating them to Wicket > 6. We used the wicket.contrib.tinymce.InPlaceEditComponent for inline > editing of large texts. This worked fine on Wicket 1.4, but there seem to > be some problems on Wicket 6.14. > I now have to double-click on a text label before it is turned into a > TinyMCE editor. On Wicket 1.4 a single click was enough. > I can work with the editor but once a click on the cancel button, things go > wrong. I can open the editor again by double-clicking the text, but in the > editor, nothing works anymore. > > Is anyone using the TinyMCE editor on Wicket 6? > > Kind regards, > Dirk Germonpré. >
TinyMCE InPlaceEditComponent on Wicket 6
Hello, I'm working on a large web application. Parts of the application are still running on Wicket 1.4, but I'm in the process of migrating them to Wicket 6. We used the wicket.contrib.tinymce.InPlaceEditComponent for inline editing of large texts. This worked fine on Wicket 1.4, but there seem to be some problems on Wicket 6.14. I now have to double-click on a text label before it is turned into a TinyMCE editor. On Wicket 1.4 a single click was enough. I can work with the editor but once a click on the cancel button, things go wrong. I can open the editor again by double-clicking the text, but in the editor, nothing works anymore. Is anyone using the TinyMCE editor on Wicket 6? Kind regards, Dirk Germonpré.
Re: Introducing Croquet: Combining Wicket, Jetty, Hibernate, and Guice
Thanks for the reply - no worries on the delay. In my case, I'm using EclipseLink. I originally was using Hibernate, but switched after encountering a known bug in Hibernate (the specifics of which I no longer recall). Since I was sticking to using the pure JPA API, it was a quick drop-in replacement. Recently, however, I have used a couple of EclipseLink-specific features, so it wouldn't be as quick to switch back (assuming that the bug in Hibernate has been fixed). This certainly wouldn't stop me from checking out Croquet - if I end up adapting it to use EclipseLink, I'll be sure to share my changes. Best, Chris On Mon, Apr 14, 2014 at 8:44 AM, Bill Speirs wrote: > Chris, sorry for not responding more quickly... was traveling back from > ApacheCon NA. > > Honestly, it would be non-trivial to drop in a replacement to Hibernate. > The JpaPersistService (http://goo.gl/FeI6xU) handles the configuration > coming from persistence.xml and has nothing Hibernate specific. The problem > is the CroquetPersistService, DataSourceHibernateModule, and > EntityManagerProxyFactory classes. > > What JPA provider would you rather use? I've never used anything but > Hibernate, and never had issues with it... just curious why you'd like to > use something else. > > Also, patches/pull requests are always happily accepted :-) > > Thanks for checking it out... > > Bill- > > > On Wed, Apr 9, 2014 at 1:05 PM, Chris Snyder >wrote: > > > Looks like awesome work - very clean page design and excellent > > documentation, and I'm sure that the quality extends to the code as well. > > I'll definitely be looking into this for my next project, if not porting > > some of my current ones. > > > > When using Croquet, how easy would it be to drop in a different JPA > > implementation in place of Hibernate? > > > > Best, > > Chris > > > > > > On Wed, Apr 9, 2014 at 12:51 PM, William Speirs > > wrote: > > > > > I gave a talk at ApacheCon NA yesterday on Croquet. It is a combination > > of > > > Wicket, Jetty, Hibernate, and Guice to make it super-easy to start > > writing > > > Wicket code almost immediately, instead of spending time configuring > > > everything. > > > > > > Slides: > > > > > > > > > https://docs.google.com/presentation/d/1m3jdbpYoSBOCPz8Wes9mPvhf8TLp_3dndj_gW08iFL8/ > > > Code: https://github.com/metrink/croquet > > > Docs: http://croquet.metrink.com > > > > > > Thanks... > > > > > > Bill- > > > > > > -- Chris Snyder Web Developer, BioLogos 616.328.5218 x203 biologos.org
Re: Introducing Croquet: Combining Wicket, Jetty, Hibernate, and Guice
In our project we have removed Hibernate because it's licence is not AL compatible We are using OpenJPA, was not so hard to replace On Mon, Apr 14, 2014 at 7:44 PM, Bill Speirs wrote: > Chris, sorry for not responding more quickly... was traveling back from > ApacheCon NA. > > Honestly, it would be non-trivial to drop in a replacement to Hibernate. > The JpaPersistService (http://goo.gl/FeI6xU) handles the configuration > coming from persistence.xml and has nothing Hibernate specific. The problem > is the CroquetPersistService, DataSourceHibernateModule, and > EntityManagerProxyFactory classes. > > What JPA provider would you rather use? I've never used anything but > Hibernate, and never had issues with it... just curious why you'd like to > use something else. > > Also, patches/pull requests are always happily accepted :-) > > Thanks for checking it out... > > Bill- > > > On Wed, Apr 9, 2014 at 1:05 PM, Chris Snyder >wrote: > > > Looks like awesome work - very clean page design and excellent > > documentation, and I'm sure that the quality extends to the code as well. > > I'll definitely be looking into this for my next project, if not porting > > some of my current ones. > > > > When using Croquet, how easy would it be to drop in a different JPA > > implementation in place of Hibernate? > > > > Best, > > Chris > > > > > > On Wed, Apr 9, 2014 at 12:51 PM, William Speirs > > wrote: > > > > > I gave a talk at ApacheCon NA yesterday on Croquet. It is a combination > > of > > > Wicket, Jetty, Hibernate, and Guice to make it super-easy to start > > writing > > > Wicket code almost immediately, instead of spending time configuring > > > everything. > > > > > > Slides: > > > > > > > > > https://docs.google.com/presentation/d/1m3jdbpYoSBOCPz8Wes9mPvhf8TLp_3dndj_gW08iFL8/ > > > Code: https://github.com/metrink/croquet > > > Docs: http://croquet.metrink.com > > > > > > Thanks... > > > > > > Bill- > > > > > > -- WBR Maxim aka solomax
Re: Introducing Croquet: Combining Wicket, Jetty, Hibernate, and Guice
Chris, sorry for not responding more quickly... was traveling back from ApacheCon NA. Honestly, it would be non-trivial to drop in a replacement to Hibernate. The JpaPersistService (http://goo.gl/FeI6xU) handles the configuration coming from persistence.xml and has nothing Hibernate specific. The problem is the CroquetPersistService, DataSourceHibernateModule, and EntityManagerProxyFactory classes. What JPA provider would you rather use? I've never used anything but Hibernate, and never had issues with it... just curious why you'd like to use something else. Also, patches/pull requests are always happily accepted :-) Thanks for checking it out... Bill- On Wed, Apr 9, 2014 at 1:05 PM, Chris Snyder wrote: > Looks like awesome work - very clean page design and excellent > documentation, and I'm sure that the quality extends to the code as well. > I'll definitely be looking into this for my next project, if not porting > some of my current ones. > > When using Croquet, how easy would it be to drop in a different JPA > implementation in place of Hibernate? > > Best, > Chris > > > On Wed, Apr 9, 2014 at 12:51 PM, William Speirs > wrote: > > > I gave a talk at ApacheCon NA yesterday on Croquet. It is a combination > of > > Wicket, Jetty, Hibernate, and Guice to make it super-easy to start > writing > > Wicket code almost immediately, instead of spending time configuring > > everything. > > > > Slides: > > > > > https://docs.google.com/presentation/d/1m3jdbpYoSBOCPz8Wes9mPvhf8TLp_3dndj_gW08iFL8/ > > Code: https://github.com/metrink/croquet > > Docs: http://croquet.metrink.com > > > > Thanks... > > > > Bill- > > >
Re: Download byte array
Hi, On Mon, Apr 14, 2014 at 2:03 PM, Carl-Eric Menzel wrote: > You can use a org.apache.wicket.request.resource.ByteArrayResource > instead - It's an IResource implementation that takes a byte array. You > can then use the resource in a DownloadLink, for example. > ResourceLink would be simpler. Christoph should already know that from the previous discussion. Also see org.apache.wicket.util.resource.AbstractResourceStream. It has few abstract methods, one of them - org.apache.wicket.util.resource.IResourceStream#getInputStream. Just return ByteArrayInputStream. > > Carl-Eric > > On Mon, 14 Apr 2014 12:11:06 +0200 > wrote: > > > Hello, > > > > Iam using a FileResourceStream to download a file. This needs an > > File, which I create on the fly like this: > > > > tempFile = File.createTempFile("SLA", ".xls"); > > > > InputStream data = new > > > ByteArrayInputStream(ConsoleDataHandlerImpl.getInstance().getReportAsByteStream(beginDate,endDate)); > > Files.writeTo(tempFile, data); > > > > It works fine. But the problem is that it save the tempfile in my tmp > > folder. Is there a RessourceStream in Wicket which can handle a byte > > array so that I don't need a tempfile? > > > > > > Mit freundlichen Grüßen > > Christoph Manig > > > > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Download byte array
You can use a org.apache.wicket.request.resource.ByteArrayResource instead - It's an IResource implementation that takes a byte array. You can then use the resource in a DownloadLink, for example. Carl-Eric On Mon, 14 Apr 2014 12:11:06 +0200 wrote: > Hello, > > Iam using a FileResourceStream to download a file. This needs an > File, which I create on the fly like this: > > tempFile = File.createTempFile("SLA", ".xls"); > > InputStream data = new > ByteArrayInputStream(ConsoleDataHandlerImpl.getInstance().getReportAsByteStream(beginDate,endDate)); > Files.writeTo(tempFile, data); > > It works fine. But the problem is that it save the tempfile in my tmp > folder. Is there a RessourceStream in Wicket which can handle a byte > array so that I don't need a tempfile? > > > Mit freundlichen Grüßen > Christoph Manig > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Download byte array
Hello, Iam using a FileResourceStream to download a file. This needs an File, which I create on the fly like this: tempFile = File.createTempFile("SLA", ".xls"); InputStream data = new ByteArrayInputStream(ConsoleDataHandlerImpl.getInstance().getReportAsByteStream(beginDate,endDate)); Files.writeTo(tempFile, data); It works fine. But the problem is that it save the tempfile in my tmp folder. Is there a RessourceStream in Wicket which can handle a byte array so that I don't need a tempfile? Mit freundlichen Grüßen Christoph Manig
Re: peculiarities with wicket hibernate
I got a step further with the following definitions I succeded to Insert the ManyToOne relationships. Only the DropDownChoices don't write the changes back in the Model: In the hybernate model: @ManyToOne(cascade = CascadeType.REFRESH,fetch=FetchType.EAGER) @JoinColumn(name="ObKeinKontakt",nullable=false) public Objektsuch getObjektsuch(){ return this.objektsuch; } @ManyToOne(cascade = CascadeType.REFRESH,fetch=FetchType.EAGER) @JoinColumn(name="ObjArtID",nullable=false) public Objektart getObjektart(){ return this.objektart; } In the wicket form: IChoiceRenderer objektsuchchoicerenderer= new IChoiceRenderer() { public Object getDisplayValue(Objektsuch objektsuch) { return objektsuch.getSuchtext()+" "+objektsuch.getId(); } public String getIdValue(Objektsuch object,int index) { return object.getId().toString(); } }; IChoiceRenderer objektartchoicerenderer= new IChoiceRenderer() { public Object getDisplayValue(Objektart objektart) { return objektart.getObjartname()+" "+objektart.getId(); } public String getIdValue(Objektart object,int index) { return object.getId().toString(); } }; IModel> makeChoicesObjektsuch = new AbstractReadOnlyModel>() { @Override public List getObject() { List objektsuchlist=new ArrayList(); Iterator objektsuchiterator=objektsuchManager.getObjektsuchen().iterator(); while(objektsuchiterator.hasNext()){ Objektsuch objektsuch=(Objektsuch)objektsuchiterator.next(); objektsuchlist.add(objektsuch); } return objektsuchlist; } }; IModel> makeChoicesObjektart = new AbstractReadOnlyModel>() { @Override public List getObject() { List objektartlist=new ArrayList(); Iterator objektartiterator=objektartManager.getObjektartes().iterator(); while(objektartiterator.hasNext()){ Objektart objektart=(Objektart)objektartiterator.next(); objektartlist.add(objektart); } return objektartlist; } }; final DropDownChoice obkeinkontakt = new DropDownChoice("objektsuch", makeChoicesObjektsuch,objektsuchchoicerenderer); add(obkeinkontakt); final DropDownChoice objektart = new DropDownChoice("objektart", makeChoicesObjektart,objektartchoicerenderer); add(objektart); Am 14.04.2014 09:39, schrieb Yahoo: I serarated the hibernate part in an own maven modul. I the tests in this modul everything works well. I use a lot of many to one relationships. In the web application I get sometimes problems, that the key of a many to one relationship is not written or the DropDownChoice does'nt write the change in the model. Generally I am disappointed by the abstraction hibernate gives me in the application. There are a lot of cases where you are torn in the specialities of how hibernate works in a web application. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Form component's model#setObject getting called twice per submit when inside a Border
Hi, On Sun, Apr 13, 2014 at 7:44 PM, Sven Meier wrote: > >If the hierarchy is correct then the 1.4 logic is very confusing to me. > > Same way here ;). > > You know that Wicket 1.4 is no longer actively developed, so we won't > improve this, even if it is a bug. > I've read this thread very quickly so I may miss something but Border has been improved in Wicket 1.5. Now there are two methods: 1) #add() - adds children to the body container (same for #remove, #replace, #addOrReplace, etc.) 2) #addToBorder() - adds to the Border itself This way it is more transparent for the application code. > > Regards > Sven > > > > On 04/11/2014 11:07 PM, Craig L wrote: > >> Hi Sven, just a follow-up. If I am reading the debugger correctly I >> believe >> everything is layered correctly without adding the form directly to the >> border.bodycontainer. >> >> I stopped the debugger at the first instance of visitComponentsPostOrder >> in >> Form.class internalUpdateFormComponentModels() after Submit. >> >> 'this' is showing as the Form >>Form's parent is GenericFormPanel >> GenericFormPanel's parent is Border$BorderBodyContainer >>Border$BorderBodyContainer's parent is our custom border >> SpinnBorder >> SpinnBorder's parent is GenericFormPage >> GenericFormPage's parent is null >> >> After the ensuing findParent call the SpinnBorder becomes the first >> argument >> into the next visitComponentsPostOrder call and it starts marching down >> the >> children chain. >> >> If the hierarchy is correct then the 1.4 logic is very confusing to me. >> As >> I read it as long as the Form lives anywhere underneath a Border.class >> object, whether its in the BodyContainer or not, it's setObjects will get >> called twice. Unless there is some way I need to detach the Form from the >> Border during this submit process? >> >> Thanks in advance for enlightening me. >> Craig >> >> >> >> -- >> View this message in context: http://apache-wicket.1842946. >> n4.nabble.com/Form-component-s-model-setObject-getting- >> called-twice-per-submit-when-inside-a-Border-tp4665278p4665375.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 >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: IPageMap in Wicket 6 ?
Hi, Before deleting this code it would be safer if you explain how you use IPageMap. Maybe you need to migrate this code. Martin Grigorov Wicket Training and Consulting On Mon, Apr 14, 2014 at 10:39 AM, arnzel wrote: > Hi, > > i am migrating a wicket project from 1.3 to 1.6 > > i got in some classes references to the interface IPageMap. > > in the wiki i read > > "Page map" concept was discarded in Wicket 1.5 and is no longer part of the > future releases." > > So i can delte any code relevant to IPageMap ? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/IPageMap-in-Wicket-6-tp4665378.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 > >
IPageMap in Wicket 6 ?
Hi, i am migrating a wicket project from 1.3 to 1.6 i got in some classes references to the interface IPageMap. in the wiki i read "Page map" concept was discarded in Wicket 1.5 and is no longer part of the future releases." So i can delte any code relevant to IPageMap ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/IPageMap-in-Wicket-6-tp4665378.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
peculiarities with wicket hibernate
I serarated the hibernate part in an own maven modul. I the tests in this modul everything works well. I use a lot of many to one relationships. In the web application I get sometimes problems, that the key of a many to one relationship is not written or the DropDownChoice does'nt write the change in the model. Generally I am disappointed by the abstraction hibernate gives me in the application. There are a lot of cases where you are torn in the specialities of how hibernate works in a web application. Am 13.04.2014 18:44, schrieb Sven Meier: >If the hierarchy is correct then the 1.4 logic is very confusing to me. Same way here ;). You know that Wicket 1.4 is no longer actively developed, so we won't improve this, even if it is a bug. Regards Sven On 04/11/2014 11:07 PM, Craig L wrote: Hi Sven, just a follow-up. If I am reading the debugger correctly I believe everything is layered correctly without adding the form directly to the border.bodycontainer. I stopped the debugger at the first instance of visitComponentsPostOrder in Form.class internalUpdateFormComponentModels() after Submit. 'this' is showing as the Form Form's parent is GenericFormPanel GenericFormPanel's parent is Border$BorderBodyContainer Border$BorderBodyContainer's parent is our custom border SpinnBorder SpinnBorder's parent is GenericFormPage GenericFormPage's parent is null After the ensuing findParent call the SpinnBorder becomes the first argument into the next visitComponentsPostOrder call and it starts marching down the children chain. If the hierarchy is correct then the 1.4 logic is very confusing to me. As I read it as long as the Form lives anywhere underneath a Border.class object, whether its in the BodyContainer or not, it's setObjects will get called twice. Unless there is some way I need to detach the Form from the Border during this submit process? Thanks in advance for enlightening me. Craig -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-component-s-model-setObject-getting-called-twice-per-submit-when-inside-a-Border-tp4665278p4665375.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 - 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