Re: multi file upload question

2009-11-18 Thread Marcelo Fukushima
nevermind me... should have seen the example before posting... ill
shut up now...

On Wed, Nov 18, 2009 at 11:33 AM, Marcelo Fukushima  wrote:
> couldnt it be done with some clever javascript? creating a new  type="file"> each time one is selected?
>
> On Mon, Nov 16, 2009 at 3:51 PM, Pieter Degraeuwe
>  wrote:
>> The multiple files upload is achieved by a flash object. It works both in
>> firefox as chrome (but, indeed, sometimes it is in gmail not available).
>> I didn't need such a feature yet, however I was curious how they (google)
>> did it :-)
>>
>> To prove it is flash, just right click on the 'Attach a file', and you get
>> the Flash context menu :-)
>>
>> Pieter
>>
>> On Mon, Nov 16, 2009 at 6:05 PM, Igor Vaynberg 
>> wrote:
>>
>>> hrm, i know chrome supports it, but not firefox in gmail. you will
>>> have to look at how chrome does it, im sure building support for that
>>> should be pretty easy.
>>>
>>> -igor
>>>
>>> On Mon, Nov 16, 2009 at 8:51 AM, Troy Cauble  wrote:
>>> > I'm familiar with this multi file upload example:
>>> > http://www.wicket-library.com/wicket-examples/upload/multi
>>> > where a system file chooser is used multiple times to
>>> > select single files to build the upload list.
>>> >
>>> > I see other web apps (gmail for example) where the user
>>> > can select multiple files with one system chooser dialog.
>>> > Is there a way to do this with Wicket?
>>> >
>>> > Thanks,
>>> > troy
>>> >
>>> > -
>>> > 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
>>>
>>>
>>
>>
>> --
>> Pieter Degraeuwe
>> Systemworks bvba
>> Belgiëlaan 61
>> 9070 Destelbergen
>> GSM: +32 (0)485/68.60.85
>> Email: pieter.degrae...@systemworks.be
>> visit us at http://www.systemworks.be
>>
>
>
>
> --
> http://mapsdev.blogspot.com/
> Marcelo Takeshi Fukushima
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: multi file upload question

2009-11-18 Thread Marcelo Fukushima
couldnt it be done with some clever javascript? creating a new  each time one is selected?

On Mon, Nov 16, 2009 at 3:51 PM, Pieter Degraeuwe
 wrote:
> The multiple files upload is achieved by a flash object. It works both in
> firefox as chrome (but, indeed, sometimes it is in gmail not available).
> I didn't need such a feature yet, however I was curious how they (google)
> did it :-)
>
> To prove it is flash, just right click on the 'Attach a file', and you get
> the Flash context menu :-)
>
> Pieter
>
> On Mon, Nov 16, 2009 at 6:05 PM, Igor Vaynberg wrote:
>
>> hrm, i know chrome supports it, but not firefox in gmail. you will
>> have to look at how chrome does it, im sure building support for that
>> should be pretty easy.
>>
>> -igor
>>
>> On Mon, Nov 16, 2009 at 8:51 AM, Troy Cauble  wrote:
>> > I'm familiar with this multi file upload example:
>> > http://www.wicket-library.com/wicket-examples/upload/multi
>> > where a system file chooser is used multiple times to
>> > select single files to build the upload list.
>> >
>> > I see other web apps (gmail for example) where the user
>> > can select multiple files with one system chooser dialog.
>> > Is there a way to do this with Wicket?
>> >
>> > Thanks,
>> > troy
>> >
>> > -
>> > 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
>>
>>
>
>
> --
> Pieter Degraeuwe
> Systemworks bvba
> Belgiëlaan 61
> 9070 Destelbergen
> GSM: +32 (0)485/68.60.85
> Email: pieter.degrae...@systemworks.be
> visit us at http://www.systemworks.be
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: mi first app deployed with wicket

2009-10-13 Thread Marcelo Fukushima
make sure the project packaging is set to 'war' so maven will put the
required libs in the WEB-INF/lib.

On Mon, Oct 12, 2009 at 6:22 PM, Fernando Wermus
 wrote:
> Hi all,
>    I ve been working with Maven, so there is no chance to have some
> dependecies problems, but Tomcat throw this exception,
>
>
> INFO: ContextListener: attributeAdded('org.apache.catalina.MBeanServer',
> 'com.sun.jmx.mbeanserver.jmxmbeanser...@105d88a')
> Oct 12, 2009 4:54:40 PM org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NoClassDefFoundError: org/apache/wicket/RequestContext
>        at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:329)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
>        at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
>        at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
>        at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
>        at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
>        at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
>        at java.lang.Thread.run(Thread.java:619)
> Oct 12, 2009 4:54:51 PM org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet default threw exception
>
> any help?
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AutoCompleteTextField & Generics

2009-10-13 Thread Marcelo Fukushima
nope. No problem for me. Try pasting here the problematic code

On Mon, Oct 12, 2009 at 10:50 AM, Douglas Ferguson
 wrote:
> Has anybody else had problems with AutoCompleteTextField and generics.
>
> It almost seems like I'm dealing with an eclipse bug.
>
> But basically if I call
>
> behavior.getChoices.add(xxx) it is always highlighted in red because,
> I am restricted by the model use "T" but the list wants "? extends T".
>
> D/
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Storing entity object in session - how to do it?

2009-10-07 Thread Marcelo Fukushima
btw, im not actually suggesting you do that because keeping the key
pieces in memory must be a lot faster than pulling from the DB for
every component

On Wed, Oct 7, 2009 at 7:34 PM, Marcelo Fukushima  wrote:
> cant you inject the DAO's to the listeners in the moment you create
> and attack the listeners to your application?
> If you have the Injector at that moment, you could even pull your
> listeners from the Injector, no?
>
> On Wed, Oct 7, 2009 at 5:21 PM, Jeffrey Schneller
>  wrote:
>> Thanks.  I took your suggestion and now just store the key pieces that I 
>> need in the session and it looks like it is working.
>>
>> -Original Message-
>> From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
>> Sent: Wednesday, October 07, 2009 1:05 PM
>> To: users@wicket.apache.org
>> Subject: Re: Storing entity object in session - how to do it?
>>
>> We have (some key) entities (successfully) in Session. But they are
>> not lazy-load entities so they act like plain-old-java-beans.
>>
>> **
>> Martin
>>
>> 2009/10/7 Jeffrey Schneller :
>>> Looking through the archives I saw some posts that said you should not
>>> store entity objects [for example object coming from hibernate] in the
>>> session.  This makes sense to me as I just hit the problem.
>>>
>>> The archives gave lots of advice but everything seemed to contradict and
>>> no one posted a working solution.
>>>
>>>
>>
>> -
>> 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
>>
>>
>
>
>
> --
> http://mapsdev.blogspot.com/
> Marcelo Takeshi Fukushima
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Storing entity object in session - how to do it?

2009-10-07 Thread Marcelo Fukushima
cant you inject the DAO's to the listeners in the moment you create
and attack the listeners to your application?
If you have the Injector at that moment, you could even pull your
listeners from the Injector, no?

On Wed, Oct 7, 2009 at 5:21 PM, Jeffrey Schneller
 wrote:
> Thanks.  I took your suggestion and now just store the key pieces that I need 
> in the session and it looks like it is working.
>
> -Original Message-
> From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
> Sent: Wednesday, October 07, 2009 1:05 PM
> To: users@wicket.apache.org
> Subject: Re: Storing entity object in session - how to do it?
>
> We have (some key) entities (successfully) in Session. But they are
> not lazy-load entities so they act like plain-old-java-beans.
>
> **
> Martin
>
> 2009/10/7 Jeffrey Schneller :
>> Looking through the archives I saw some posts that said you should not
>> store entity objects [for example object coming from hibernate] in the
>> session.  This makes sense to me as I just hit the problem.
>>
>> The archives gave lots of advice but everything seemed to contradict and
>> no one posted a working solution.
>>
>>
>
> -
> 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
>
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindow and LazyLoading Exception

2009-10-02 Thread Marcelo Fukushima
ption: failed to lazily
>> initialize a collection of role:
>> com.mycompany.persistence.domain.Message.lazyList, no session or
>> session was closed
>>        at
>> org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
>>        at
>> org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
>>        at
>> org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
>>        at
>> org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)
>>        at
>> org.apache.wicket.markup.html.form.ListMultipleChoice.onComponentTag(ListMultipleChoice.java:246)
>>        at
>> org.apache.wicket.markup.html.form.CheckBoxMultipleChoice.onComponentTag(CheckBoxMultipleChoice.java:359)
>>        at org.apache.wicket.Component.renderComponent(Component.java:2597)
>>        at
>> org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1536)
>>        at org.apache.wicket.Component.render(Component.java:2457)
>>        at
>> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
>>        at
>> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1601)
>>        at
>> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1525)
>>        at
>> org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1926)
>>        at org.apache.wicket.Component.renderComponent(Component.java:2626)
>>
>>
>>
>>
>>
>> On Thu, Oct 1, 2009 at 10:39 PM, Marcelo Fukushima 
>> wrote:
>> > while i couldnt identify which object is throwing the
>> > lazyInitialization, the problem is probably that the entity is not
>> > associated with the hibernate session. On the request that opens the
>> > ModalWindow you must either reload or reatach the entity
>> >
>> > On Thu, Oct 1, 2009 at 7:55 PM, Albert Romanius 
>> wrote:
>> >> Hi,
>> >>
>> >> I am working with wicket and jpa/hibernate/spring. I am trying to
>> >> create a ModalWindow, but I get a LazyLoadingException. I tryed the
>> >> OSIVpattern, but it did not work.
>> >> Using the modal inside a form does not make any difference also.
>> >>
>> >> Has anyone else this problem?
>> >>
>> >>
>> >> The page which the modalWindow is triggered has:
>> >> ===
>> >>  AjaxLink link = new AjaxLink("openModal") {
>> >>                   �...@override
>> >>                    public void onClick(AjaxRequestTarget target) {
>> >>                        modalWindow.setPageCreator(new
>> >> ModalWindow.PageCreator() {
>> >>                            public Page createPage() {
>> >>                                return new MyModalPage(modalWindow,
>> >> messageListModel.getObject().get(0));
>> >>                            }
>> >>                        });
>> >>                        modalWindow.show(target);
>> >>                    }
>> >>   };
>> >> ==
>> >>
>> >> #Modal Panel
>> >> ==
>> >> public class MyModalPage extends WebPage {
>> >>
>> >>   �...@springbean
>> >>    GeneralRepository generalRepository;
>> >>
>> >>    Set selectedSubs = new HashSet();
>> >>
>> >> public MyModalPage(final ModalWindow window, Message message) {
>> >>
>> >>        Message showMessage = (Message)
>> >> generalRepository.getById(message.getId(), Message.class);
>> >>
>> >>        //showMessage.getLazyList().size();
>> >>
>> >>        Form f = new Form("form");
>> >>        add(f);
>> >>
>> >>        CheckBoxMultipleChoice subMessagesCB = new
>> CheckBoxMultipleChoice(
>> >>                "subMessages", new PropertyModel(this,
>> >> "selectedSubs"), showMessage.getLazyList());
>> >>        f.add(subMessagesCB);
>> >>
>> >>        AjaxButton saveButton = new AjaxButton("save") {
>> >>
>> >>           �...@override
>> >>            protected void onSubmit(AjaxRequestTarget target, Form
>> arg1) {
>> >>                window.close(target);
>> >>            }
>> >>        };
>> >>
>> >>        f.add(saveButton);
>> >>
>> >>        add(new AjaxLink("closeCancel")
>> >>        {
>> >>           �...@override
>> >>            public void onClick(AjaxRequestTarget target)
>> >>            {
>> >>                window.close(target);
>> >>            }
>> >>        });
>> >>
>> >>
>> >>    }
>> >> ==
>> >>
>> >>
>> >> --
>> >> Albert
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > http://mapsdev.blogspot.com/
>> > Marcelo Takeshi Fukushima
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>>
>>
>> --
>> Albert
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindow and LazyLoading Exception

2009-10-01 Thread Marcelo Fukushima
while i couldnt identify which object is throwing the
lazyInitialization, the problem is probably that the entity is not
associated with the hibernate session. On the request that opens the
ModalWindow you must either reload or reatach the entity

On Thu, Oct 1, 2009 at 7:55 PM, Albert Romanius  wrote:
> Hi,
>
> I am working with wicket and jpa/hibernate/spring. I am trying to
> create a ModalWindow, but I get a LazyLoadingException. I tryed the
> OSIVpattern, but it did not work.
> Using the modal inside a form does not make any difference also.
>
> Has anyone else this problem?
>
>
> The page which the modalWindow is triggered has:
> ===
>  AjaxLink link = new AjaxLink("openModal") {
>                   �...@override
>                    public void onClick(AjaxRequestTarget target) {
>                        modalWindow.setPageCreator(new
> ModalWindow.PageCreator() {
>                            public Page createPage() {
>                                return new MyModalPage(modalWindow,
> messageListModel.getObject().get(0));
>                            }
>                        });
>                        modalWindow.show(target);
>                    }
>   };
> ==
>
> #Modal Panel
> ==
> public class MyModalPage extends WebPage {
>
>   �...@springbean
>    GeneralRepository generalRepository;
>
>    Set selectedSubs = new HashSet();
>
> public MyModalPage(final ModalWindow window, Message message) {
>
>        Message showMessage = (Message)
> generalRepository.getById(message.getId(), Message.class);
>
>        //showMessage.getLazyList().size();
>
>        Form f = new Form("form");
>        add(f);
>
>        CheckBoxMultipleChoice subMessagesCB = new CheckBoxMultipleChoice(
>                "subMessages", new PropertyModel(this,
> "selectedSubs"), showMessage.getLazyList());
>        f.add(subMessagesCB);
>
>        AjaxButton saveButton = new AjaxButton("save") {
>
>           �...@override
>            protected void onSubmit(AjaxRequestTarget target, Form arg1) {
>                window.close(target);
>            }
>        };
>
>        f.add(saveButton);
>
>        add(new AjaxLink("closeCancel")
>        {
>           �...@override
>            public void onClick(AjaxRequestTarget target)
>            {
>                window.close(target);
>            }
>        });
>
>
>    }
> ==
>
>
> --
> Albert
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Old instances of a page remain in memory (apparently) forever

2009-09-23 Thread Marcelo Fukushima
you can check the javadoc for WeakReference, but basically
WeakReferences hold the reference until a full gc occurs

On Thu, Sep 24, 2009 at 12:14 AM, Igor Vaynberg  wrote:
> the instances are held in memory until the jvm runs the garbage collector.
>
> -igor
>
> On Wed, Sep 23, 2009 at 8:09 PM, Esteban Ignacio Masoero
>  wrote:
>> Hi:
>> I'm not sure whether this behavior is normal or not, so I'm going to
>> describe it and I hope someone can tell me if I'm doing something wrong or
>> if there's just nothing wrong!
>>
>> In my app I found out that each time a request is made, old instances of a
>> page remain in memory, and get accumulated in time (I noticed this behavior
>> by looking at the "All instances" feature from eclipse debug's perspective).
>> I searched the code for bad practices like anonyomus Model classes, but I
>> didn't find those kind of thins. So finally I created a new simple project
>> to test whether this behaviour repeated there too, and I found out that it
>> did!
>>
>> Here's the new simple project code (wicket 1.3.5, tomcat 6, eclipse
>> galileo):
>>
>> public class MyApp extends WebApplication {
>> @Override
>>  public Class getHomePage() {
>> return MyPage.class;
>> }
>> }
>>
>> public class MyPage extends WebPage {
>> private String text;
>> public MyPage() {
>>  this("");
>> }
>> public MyPage(String textt) {
>>  super();
>> this.text = textt;
>> Form form = new Form("form"){
>>  private static final long serialVersionUID = -3566834353426372805L;
>> @Override
>>  protected void onSubmit() {
>> setResponsePage(new MyPage2(text));
>> }
>>  };
>> form.add(new TextField("text", new PropertyModel(this, "text")));
>>  form.add(new Button("accept"));
>> this.add(form);
>> }
>> }
>>
>> > response page.>
>>
>> When debugging (with a breakpoint in MyPage's constructor), every time a new
>> page is instanciated, I see that the old instances of that page remains in
>> memory. Using the "All references" feature I "walked" through the
>> reference-path, and I reached a weakReference to this page from a
>> "SerializedPagesCache$SerializedPageWithSession" instance (I had to stop
>> there because it was driving me crazy). (Of course I have no idea whether
>> this is normal or not, I'm just giving more info)
>>
>> Anyway, can anyone tell me what's wrong? Or is this a expected behavior and
>> sometime later this old instances will be eliminated from the jvm?
>>
>> Thanks in advance,
>>
>> Esteban
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org