You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by John Krasnay <jo...@krasnay.ca> on 2010/06/03 14:26:45 UTC

Re: Can I develop without recompiling/restarting after every change?

Hrm, perhaps you should have qualified your advice: "If you're using
NetBeans, then for best performance..."

Also, the packaging of markup on the classpath allows you to create
re-usable JARs of components and IMHO is one of the best features of
Wicket. So perhaps the qualification should really be, "If you're using
NetBeans, and you're not planning on packaging your Wicket components in
a re-usable JAR, then for best performance..."

The way your original post is phrased makes it sound like a best
practice, and it implies the Wicket default to fetch markup from the
classpath is inferior. I don't think this is a consensus among the
community.

jk

On Thu, Jun 03, 2010 at 08:57:43PM +1200, bht@actrix.gen.nz wrote:
> Martijn,
> 
> You are making a *lot* of assumptions.
> 
> Not everybody uses Eclipse.
> 
> Nobody in this thread would consider restarts acceptable, still we are
> using this subject.
> 
> HTML files location has to do with performance in the developing
> process depending on how the IDE handles the files.
> 
> Please advise how to configure the NetBeans IDE to redeploy a HTML
> file in a Java package in a J2EE app server with the same speed as
> HTML files in the web directory (milliseconds not seconds).
> 
> 
> Thanks
> 
> Bernard
> 
> 
> 
> 
> On Sun, 30 May 2010 15:23:09 +0200, you wrote:
> 
> >Huh?
> >
> >Storing the HTML in the packages has *nothing* to do with requiring
> >restarts. Only wrongly configured IDEs may cause that.
> >
> >If your HTML doesn't get reloaded when you change it, then you should
> >run Wicket in DEVELOPMENT mode. Also make sure you've configured
> >Eclipse to copy all resources (not just .properties files)
> >
> >The Wicket Quickstart project and using Maven to generate your eclipse
> >project files (mvn eclipse:eclipse) will configure everything
> >correctly.
> >
> >Martijn
> >
> >On Sat, May 29, 2010 at 11:18 PM,  <bh...@actrix.gen.nz> wrote:
> >> Hi,
> >>
> >> For best performance of redeploys in Wicket, consider storing HTML not
> >> in the Java package structure but in the web directory. So if your IDE
> >> and app server allow for hot deployment, then HTML changes deploy much
> >> faster, ie instantly. In your application init(), you add one
> >> statement
> >>
> >> getResourceSettings().addResourceFolder("wicket");
> >>
> >> where "wicket" matches the url-pattern in your filter-mapping in
> >> web.xml.
> >>
> >> PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
> >> background on how to take this one step further.
> >>
> >> Additionally, with GlassFish V3, you get session preservation on hot
> >> deployment of Java classes.
> >>
> >> You can enable "deploy on save" for convenience.
> >>
> >> If that is not fast enough, you can run your app in debug mode and hot
> >> swap classes after save while you are debugging it.
> >>
> >> All this comes with the NetBeans IDE. You really don't have to worry
> >> about this stuff anymore.
> >>
> >> Regards
> >>
> >> Bernard
> >>
> >>
> >>
> >> On Sat, 29 May 2010 16:12:46 +0100, you wrote:
> >>
> >>>have you tried JRebel? ?I've not used it myself, but there was an
> >>>interview on JavaPosse recently, sounds like it'd be an ideal fit for
> >>>any Wicket developer.
> >>>
> >>>Dan
> >>>
> >>>On 22/07/28164 20:59, David Chang wrote:
> >>>> I am using Tomcat, any tips about how to develop out recompiling/restarting after every change?
> >>>>
> >>>> Best.
> >>>>
> >>>> --- On Fri, 5/21/10, Jeremy Thomerson<je...@wickettraining.com> ?wrote:
> >>>>
> >>>>
> >>>>> From: Jeremy Thomerson<je...@wickettraining.com>
> >>>>> Subject: Re: Can I develop without recompiling/restarting after every change?
> >>>>> To: users@wicket.apache.org
> >>>>> Date: Friday, May 21, 2010, 12:17 PM
> >>>>> the easiest way to do this is to use
> >>>>> the Start class (Start.java) from the
> >>>>> quickstart to run an embedded jetty instance in your
> >>>>> IDE. ?then, if you run
> >>>>> it in debug mode, it will hotswap any possible changes (and
> >>>>> tell you if you
> >>>>> must restart if it's an incompatible change)
> >>>>>
> >>>>> --
> >>>>> Jeremy Thomerson
> >>>>> http://www.wickettraining.com
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Fri, May 21, 2010 at 10:53 AM, ekallevig<er...@ekallevig.com>
> >>>>> wrote:
> >>>>>
> >>>>>
> >>>>>> I'm a front-end developer trying to learn Java (total
> >>>>>>
> >>>>> n00b) and working on
> >>>>>
> >>>>>> a
> >>>>>> wicket application at work. ?The whole process
> >>>>>>
> >>>>> feels very slow primarily
> >>>>>
> >>>>>> because I have to recompile and restart JBoss every
> >>>>>>
> >>>>> time I make a change.
> >>>>>
> >>>>>> So I'm wondering what the best way is to avoid having
> >>>>>>
> >>>>> to do this when
> >>>>>
> >>>>>> editing .java/.js/.css/.html files during development?
> >>>>>>
> >>>>> I'd like to just
> >>>>>
> >>>>>> make
> >>>>>> changes and then refresh the browser to test -- is
> >>>>>>
> >>>>> this possible?
> >>>>>
> >>>>>> I've seen in the FAQ that you can change the
> >>>>>>
> >>>>> application settings to
> >>>>>
> >>>>>> auto-reload markup .html files -- where would I insert
> >>>>>>
> >>>>> this setting
> >>>>>
> >>>>>> (remember I'm a total n00b).
> >>>>>>
> >>>>>> As to .css/.js/.java files -- do I need jRebel or
> >>>>>>
> >>>>> something like that to
> >>>>>
> >>>>>> get
> >>>>>> these files to reload automatically?
> >>>>>>
> >>>>>> Thanks for helping out a super-beginner :)
> >>>>>> --
> >>>>>> View this message in context:
> >>>>>> http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html
> >>>>>> Sent from the Wicket - User mailing list archive at
> >>>>>>
> >>>>> Nabble.com.
> >>>>>
> >>>>>>
> >>>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>>
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

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


Re: How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
Thanks for the explanation! All the best.


--- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:

> From: Jeremy Thomerson <je...@wickettraining.com>
> Subject: Re: How to remove css class from a component?
> To: users@wicket.apache.org
> Date: Wednesday, June 16, 2010, 2:10 AM
> On Wed, Jun 16, 2010 at 1:05 AM,
> David Chang <da...@yahoo.com>wrote:
> 
> > >>Use a model like it's intended?
> >
> > You mean I should use AbstractReadOnlyModel?
> >
> > >>protected void onBeforeRender() {
> >    super.onBeforeRender();
> >    inputComponent.add(new
> SimpleAttributeModifier("class", true, new
> > AbstractReadOnlyModel<String>() {
> >        public String getObject()
> {
> >            return
> inputComponent.getFeedbackMessage() != null
> > ? "errorField" : "";
> >        }
> >    });
> > }
> >
> > There is no such constructor
> forSimpleAttributeModifier.
> >
> > Thanks.
> >
> >
> >
> > --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com>
> wrote:
> >
> > > From: Jeremy Thomerson <je...@wickettraining.com>
> > > Subject: Re: How to remove css class from a
> component?
> > > To: users@wicket.apache.org
> > > Date: Wednesday, June 16, 2010, 1:52 AM
> > > On Wed, Jun 16, 2010 at 12:48 AM,
> > > David Chang <da...@yahoo.com>wrote:
> > >
> > > > Jeremy, glad to hear from you!
> > > >
> > > > My situation is a little different. The CSS
> class is
> > > added in the following
> > > > way. Please see the following code.
> > > >
> > > >        protected void
> > > onBeforeRender() {
> > > >
> > > super.onBeforeRender();
> > > >
> > > if (inputComponent.getFeedbackMessage() != null)
> {
> > > >
> > >
> > >    inputComponent.add(new
> > > AttributeAppender("class",
> > > > new Model<String>("errorField"), "
> "));
> > > >
> > >    } else {
> > > >
> > >         // how to
> remove CSS class
> > > here??
> > > >
> > > }
> > > >        }
> > > >
> > > >
> > > > Thanks!
> > > >
> > > >
> > > > --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com>
> > > wrote:
> > > >
> > > > > From: Jeremy Thomerson <je...@wickettraining.com>
> > > > > Subject: Re: How to remove css class
> from a
> > > component?
> > > > > To: users@wicket.apache.org
> > > > > Cc: "John Krasnay" <jo...@krasnay.ca>
> > > > > Date: Wednesday, June 16, 2010, 1:40
> AM
> > > > > onComponentTag(...) {
> > > > > tag.remove("class");
> > > > > }
> > > > >
> > > > > On Wed, Jun 16, 2010 at 12:37 AM, David
> Chang
> > > <david_q_zhang@yahoo.com
> > > > >wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > I add a CSS class to component
> dynamcially
> > > the
> > > > > following way:
> > > > > >
> > > > > > inputComponent.add(new
> > > AttributeAppender("class", new
> > > > > > Model<String>("errorField"),
> " "));
> > > > > >
> > > > > > How can I remove this CSS class in
> java
> > > code?
> > > > > >
> > > > > > Best!
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > > > For additional commands, e-mail:
> users-help@wicket.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Jeremy Thomerson
> > > > > http://www.wickettraining.com
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > > >
> > > Use a model like it's intended?
> > >
> > > protected void onBeforeRender() {
> > >     super.onBeforeRender();
> > >     inputComponent.add(new
> > > SimpleAttributeModifier("class", true, new
> > > AbstractReadOnlyModel<String>() {
> > >         public
> String getObject() {
> > >         
>    return
> > > inputComponent.getFeedbackMessage() != null
> > > ? "errorField" : "";
> > >         }
> > >     });
> > > }
> > >
> > > --
> > > Jeremy Thomerson
> > > http://www.wickettraining.com
> > >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> I wrote the code in gmail, without the benefit of
> autocomplete or compile
> errors.  What I'm really getting at is that you should
> *always* add the
> attribute modifier, which takes a model for the value to
> set the attribute
> to.  The model (either Model or AbstractReadOnlyModel,
> although the latter
> is more appropriate for this) should then return the
> correct value based on
> the logic
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 


      

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


Re: How to remove css class from a component?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Wed, Jun 16, 2010 at 1:05 AM, David Chang <da...@yahoo.com>wrote:

> >>Use a model like it's intended?
>
> You mean I should use AbstractReadOnlyModel?
>
> >>protected void onBeforeRender() {
>    super.onBeforeRender();
>    inputComponent.add(new SimpleAttributeModifier("class", true, new
> AbstractReadOnlyModel<String>() {
>        public String getObject() {
>            return inputComponent.getFeedbackMessage() != null
> ? "errorField" : "";
>        }
>    });
> }
>
> There is no such constructor forSimpleAttributeModifier.
>
> Thanks.
>
>
>
> --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:
>
> > From: Jeremy Thomerson <je...@wickettraining.com>
> > Subject: Re: How to remove css class from a component?
> > To: users@wicket.apache.org
> > Date: Wednesday, June 16, 2010, 1:52 AM
> > On Wed, Jun 16, 2010 at 12:48 AM,
> > David Chang <da...@yahoo.com>wrote:
> >
> > > Jeremy, glad to hear from you!
> > >
> > > My situation is a little different. The CSS class is
> > added in the following
> > > way. Please see the following code.
> > >
> > >        protected void
> > onBeforeRender() {
> > >
> > super.onBeforeRender();
> > >
> > if (inputComponent.getFeedbackMessage() != null) {
> > >
> >
> >    inputComponent.add(new
> > AttributeAppender("class",
> > > new Model<String>("errorField"), " "));
> > >
> >    } else {
> > >
> >         // how to remove CSS class
> > here??
> > >
> > }
> > >        }
> > >
> > >
> > > Thanks!
> > >
> > >
> > > --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com>
> > wrote:
> > >
> > > > From: Jeremy Thomerson <je...@wickettraining.com>
> > > > Subject: Re: How to remove css class from a
> > component?
> > > > To: users@wicket.apache.org
> > > > Cc: "John Krasnay" <jo...@krasnay.ca>
> > > > Date: Wednesday, June 16, 2010, 1:40 AM
> > > > onComponentTag(...) {
> > > > tag.remove("class");
> > > > }
> > > >
> > > > On Wed, Jun 16, 2010 at 12:37 AM, David Chang
> > <david_q_zhang@yahoo.com
> > > >wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I add a CSS class to component dynamcially
> > the
> > > > following way:
> > > > >
> > > > > inputComponent.add(new
> > AttributeAppender("class", new
> > > > > Model<String>("errorField"), " "));
> > > > >
> > > > > How can I remove this CSS class in java
> > code?
> > > > >
> > > > > Best!
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Jeremy Thomerson
> > > > http://www.wickettraining.com
> > > >
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> > Use a model like it's intended?
> >
> > protected void onBeforeRender() {
> >     super.onBeforeRender();
> >     inputComponent.add(new
> > SimpleAttributeModifier("class", true, new
> > AbstractReadOnlyModel<String>() {
> >         public String getObject() {
> >             return
> > inputComponent.getFeedbackMessage() != null
> > ? "errorField" : "";
> >         }
> >     });
> > }
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
I wrote the code in gmail, without the benefit of autocomplete or compile
errors.  What I'm really getting at is that you should *always* add the
attribute modifier, which takes a model for the value to set the attribute
to.  The model (either Model or AbstractReadOnlyModel, although the latter
is more appropriate for this) should then return the correct value based on
the logic

-- 
Jeremy Thomerson
http://www.wickettraining.com

Re: How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
>>Use a model like it's intended?

You mean I should use AbstractReadOnlyModel?

>>protected void onBeforeRender() {
    super.onBeforeRender();
    inputComponent.add(new SimpleAttributeModifier("class", true, new
AbstractReadOnlyModel<String>() {
        public String getObject() {
            return inputComponent.getFeedbackMessage() != null
? "errorField" : "";
        }
    });
}

There is no such constructor forSimpleAttributeModifier.

Thanks.



--- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:

> From: Jeremy Thomerson <je...@wickettraining.com>
> Subject: Re: How to remove css class from a component?
> To: users@wicket.apache.org
> Date: Wednesday, June 16, 2010, 1:52 AM
> On Wed, Jun 16, 2010 at 12:48 AM,
> David Chang <da...@yahoo.com>wrote:
> 
> > Jeremy, glad to hear from you!
> >
> > My situation is a little different. The CSS class is
> added in the following
> > way. Please see the following code.
> >
> >        protected void
> onBeforeRender() {
> >               
> super.onBeforeRender();
> >               
> if (inputComponent.getFeedbackMessage() != null) {
> >               
>      
>    inputComponent.add(new
> AttributeAppender("class",
> > new Model<String>("errorField"), " "));
> >             
>    } else {
> >               
>         // how to remove CSS class
> here??
> >               
> }
> >        }
> >
> >
> > Thanks!
> >
> >
> > --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com>
> wrote:
> >
> > > From: Jeremy Thomerson <je...@wickettraining.com>
> > > Subject: Re: How to remove css class from a
> component?
> > > To: users@wicket.apache.org
> > > Cc: "John Krasnay" <jo...@krasnay.ca>
> > > Date: Wednesday, June 16, 2010, 1:40 AM
> > > onComponentTag(...) {
> > > tag.remove("class");
> > > }
> > >
> > > On Wed, Jun 16, 2010 at 12:37 AM, David Chang
> <david_q_zhang@yahoo.com
> > >wrote:
> > >
> > > > Hello,
> > > >
> > > > I add a CSS class to component dynamcially
> the
> > > following way:
> > > >
> > > > inputComponent.add(new
> AttributeAppender("class", new
> > > > Model<String>("errorField"), " "));
> > > >
> > > > How can I remove this CSS class in java
> code?
> > > >
> > > > Best!
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Jeremy Thomerson
> > > http://www.wickettraining.com
> > >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> Use a model like it's intended?
> 
> protected void onBeforeRender() {
>     super.onBeforeRender();
>     inputComponent.add(new
> SimpleAttributeModifier("class", true, new
> AbstractReadOnlyModel<String>() {
>         public String getObject() {
>             return
> inputComponent.getFeedbackMessage() != null
> ? "errorField" : "";
>         }
>     });
> }
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 


      

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


Re: How to remove css class from a component?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Wed, Jun 16, 2010 at 12:48 AM, David Chang <da...@yahoo.com>wrote:

> Jeremy, glad to hear from you!
>
> My situation is a little different. The CSS class is added in the following
> way. Please see the following code.
>
>        protected void onBeforeRender() {
>                super.onBeforeRender();
>                if (inputComponent.getFeedbackMessage() != null) {
>                         inputComponent.add(new AttributeAppender("class",
> new Model<String>("errorField"), " "));
>                 } else {
>                        // how to remove CSS class here??
>                }
>        }
>
>
> Thanks!
>
>
> --- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:
>
> > From: Jeremy Thomerson <je...@wickettraining.com>
> > Subject: Re: How to remove css class from a component?
> > To: users@wicket.apache.org
> > Cc: "John Krasnay" <jo...@krasnay.ca>
> > Date: Wednesday, June 16, 2010, 1:40 AM
> > onComponentTag(...) {
> > tag.remove("class");
> > }
> >
> > On Wed, Jun 16, 2010 at 12:37 AM, David Chang <david_q_zhang@yahoo.com
> >wrote:
> >
> > > Hello,
> > >
> > > I add a CSS class to component dynamcially the
> > following way:
> > >
> > > inputComponent.add(new AttributeAppender("class", new
> > > Model<String>("errorField"), " "));
> > >
> > > How can I remove this CSS class in java code?
> > >
> > > Best!
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Use a model like it's intended?

protected void onBeforeRender() {
    super.onBeforeRender();
    inputComponent.add(new SimpleAttributeModifier("class", true, new
AbstractReadOnlyModel<String>() {
        public String getObject() {
            return inputComponent.getFeedbackMessage() != null
? "errorField" : "";
        }
    });
}

-- 
Jeremy Thomerson
http://www.wickettraining.com

Re: How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
Zoltan, thanks for your input. The isTemporary works for me!

Best.

--- On Wed, 6/16/10, Zoltan Luspai <zl...@gmail.com> wrote:

> From: Zoltan Luspai <zl...@gmail.com>
> Subject: Re: How to remove css class from a component?
> To: users@wicket.apache.org
> Date: Wednesday, June 16, 2010, 1:59 AM
> Hi,
> 
> Two alternative solutions:
> 
> - If you want the CSS class be appened only in one response
> then set the 
> AttributeAppender as "temporary"
> ...new AttributeAppender(...) {
>      @Override
>      isTemporary() { return true} }
> }...
> - Or disable/enable AttributeAppender as needed by
> overriding 
> isEnabled() method of it:
> ...new AttributeAppender(...) {
>      @Override
>      isEnabled() { return
> inputComponent.getFeedbackMessage() != null }
> }...
> 
> 
> Cheers,
> Zoltan
> 
> 
> On 06/16/2010 07:48 AM, David Chang wrote:
> > Jeremy, glad to hear from you!
> >
> > My situation is a little different. The CSS class is
> added in the following way. Please see the following code.
> >
> >     protected void onBeforeRender() {
> >        
> super.onBeforeRender();
> >         if
> (inputComponent.getFeedbackMessage() != null) {
> >        
>     inputComponent.add(new
> AttributeAppender("class", new
> Model<String>("errorField"), " "));
> >         } else {
> >        
>     // how to remove CSS class
> here??       
>     
> >         }
> >     }
> >
> >
> > Thanks!
> >
> >
> > --- On Wed, 6/16/10, Jeremy Thomerson<je...@wickettraining.com> 
> wrote:
> >
> >    
> >> From: Jeremy Thomerson<je...@wickettraining.com>
> >> Subject: Re: How to remove css class from a
> component?
> >> To: users@wicket.apache.org
> >> Cc: "John Krasnay"<jo...@krasnay.ca>
> >> Date: Wednesday, June 16, 2010, 1:40 AM
> >> onComponentTag(...) {
> >> tag.remove("class");
> >> }
> >>
> >> On Wed, Jun 16, 2010 at 12:37 AM, David
> Chang<da...@yahoo.com>wrote:
> >>
> >>      
> >>> Hello,
> >>>
> >>> I add a CSS class to component dynamcially
> the
> >>>        
> >> following way:
> >>      
> >>> inputComponent.add(new
> AttributeAppender("class", new
> >>> Model<String>("errorField"), " "));
> >>>
> >>> How can I remove this CSS class in java code?
> >>>
> >>> Best!
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>        
> >>
> ---------------------------------------------------------------------
> >>      
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>>        
> >>
> >> -- 
> >> Jeremy Thomerson
> >> http://www.wickettraining.com
> >>
> >>      
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >    
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 


      

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


Re: How to remove css class from a component?

Posted by Zoltan Luspai <zl...@gmail.com>.
Hi,

Two alternative solutions:

- If you want the CSS class be appened only in one response then set the 
AttributeAppender as "temporary"
...new AttributeAppender(...) {
     @Override
     isTemporary() { return true} }
}...
- Or disable/enable AttributeAppender as needed by overriding 
isEnabled() method of it:
...new AttributeAppender(...) {
     @Override
     isEnabled() { return inputComponent.getFeedbackMessage() != null }
}...


Cheers,
Zoltan


On 06/16/2010 07:48 AM, David Chang wrote:
> Jeremy, glad to hear from you!
>
> My situation is a little different. The CSS class is added in the following way. Please see the following code.
>
> 	protected void onBeforeRender() {
> 		super.onBeforeRender();
> 		if (inputComponent.getFeedbackMessage() != null) {
> 			inputComponent.add(new AttributeAppender("class", new Model<String>("errorField"), " "));
> 		} else {
> 			// how to remove CSS class here??			
> 		}
> 	}
>
>
> Thanks!
>
>
> --- On Wed, 6/16/10, Jeremy Thomerson<je...@wickettraining.com>  wrote:
>
>    
>> From: Jeremy Thomerson<je...@wickettraining.com>
>> Subject: Re: How to remove css class from a component?
>> To: users@wicket.apache.org
>> Cc: "John Krasnay"<jo...@krasnay.ca>
>> Date: Wednesday, June 16, 2010, 1:40 AM
>> onComponentTag(...) {
>> tag.remove("class");
>> }
>>
>> On Wed, Jun 16, 2010 at 12:37 AM, David Chang<da...@yahoo.com>wrote:
>>
>>      
>>> Hello,
>>>
>>> I add a CSS class to component dynamcially the
>>>        
>> following way:
>>      
>>> inputComponent.add(new AttributeAppender("class", new
>>> Model<String>("errorField"), " "));
>>>
>>> How can I remove this CSS class in java code?
>>>
>>> Best!
>>>
>>>
>>>
>>>
>>>
>>>        
>> ---------------------------------------------------------------------
>>      
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>        
>>
>> -- 
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>      
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>    


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


Re: How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
Jeremy, glad to hear from you!

My situation is a little different. The CSS class is added in the following way. Please see the following code.

	protected void onBeforeRender() {
		super.onBeforeRender();
		if (inputComponent.getFeedbackMessage() != null) {
			inputComponent.add(new AttributeAppender("class", new Model<String>("errorField"), " "));
		} else {
			// how to remove CSS class here??			
		}
	}


Thanks!


--- On Wed, 6/16/10, Jeremy Thomerson <je...@wickettraining.com> wrote:

> From: Jeremy Thomerson <je...@wickettraining.com>
> Subject: Re: How to remove css class from a component?
> To: users@wicket.apache.org
> Cc: "John Krasnay" <jo...@krasnay.ca>
> Date: Wednesday, June 16, 2010, 1:40 AM
> onComponentTag(...) {
> tag.remove("class");
> }
> 
> On Wed, Jun 16, 2010 at 12:37 AM, David Chang <da...@yahoo.com>wrote:
> 
> > Hello,
> >
> > I add a CSS class to component dynamcially the
> following way:
> >
> > inputComponent.add(new AttributeAppender("class", new
> > Model<String>("errorField"), " "));
> >
> > How can I remove this CSS class in java code?
> >
> > Best!
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 


      

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


Re: How to remove css class from a component?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
onComponentTag(...) {
tag.remove("class");
}

On Wed, Jun 16, 2010 at 12:37 AM, David Chang <da...@yahoo.com>wrote:

> Hello,
>
> I add a CSS class to component dynamcially the following way:
>
> inputComponent.add(new AttributeAppender("class", new
> Model<String>("errorField"), " "));
>
> How can I remove this CSS class in java code?
>
> Best!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://www.wickettraining.com

Re: How to do a multiple page form?

Posted by Pedro Santos <pe...@gmail.com>.
Do you searching for an wizard implementation?
http://www.wicket-library.com/wicket-examples/wizard/

On Fri, Jun 4, 2010 at 11:49 PM, David Chang <da...@yahoo.com>wrote:

> Hi, I would like to do a multiple page form. For example, I have a two-page
> form. Both pages have a few fields that need validation. The first page has
> a button called "Next" and the second page has a "Previous" button and a
> "Submit" button.
>
> Any pointers or how-to info will be greatly appreciated.
>
> Best and have a great weekend!
>
> -David
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

RE: Can I develop without recompiling/restarting after every change?

Posted by Russell Simpkins <ru...@hotmail.com>.
hotmail just destroyed my last post. I apologize. I will try one more time to share my source
import org.mortbay.jetty.Connector;import org.mortbay.jetty.Server;import org.mortbay.jetty.bio.SocketConnector;import org.mortbay.jetty.webapp.WebAppContext;import org.mortbay.jetty.webapp.WebInfConfiguration;import org.mortbay.jetty.webapp.WebXmlConfiguration;
public class Start {
  public static void main(String[] args) throws Exception {    Server server = new Server();    SocketConnector connector = new SocketConnector();         // Set some timeout options to make debugging easier.    connector.setMaxIdleTime(1000 * 60 * 60);    connector.setSoLingerTime(-1);    connector.setPort(8080);    server.setConnectors(new Connector[] { connector });         WebAppContext bb = new WebAppContext();    bb.setServer(server);    bb.setContextPath("/");    bb.setWar("target/MY_APPLICATION");    bb.setConfigurationClasses(new String[] { WebInfConfiguration.class.getName(), WebXmlConfiguration.class.getName() });    bb.setParentLoaderPriority(true);         // START JMX SERVER    // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();    // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);    // server.getContainer().addEventListener(mBeanContainer);    // mBeanContainer.start();         server.addHandler(bb);
    try {      System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS [ENTER] TO STOP");      server.start();      System.in.read();      System.out.println(">>> STOPPING EMBEDDED JETTY SERVER");       server.stop();      server.join();    } catch (Exception e) {      e.printStackTrace();      System.exit(100);    }  }} 		 	   		  
_________________________________________________________________
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Can I develop without recompiling/restarting after every change?

Posted by Russell Simpkins <ru...@hotmail.com>.

I have to thank Martijn for pointing out the Start.java file. I am trying hard not to beat myself up for not using this sooner. I have not gone through the works just yet to move my HTML files to another location. I've left them in with the class files. So, for eclipse love in this situation, I added the HTML files to the eclipse build so that anytime I save a file eclipse moves them to the target folder. I changed the build output location to be target/MY_APPLICATION/WEB-INF/classes and I added the same path to the runtime configuration classpath. So far, I love it! Just as Martijn pointed out earlier, run in debug mode and every time you edit/save a java file or html file the changes are immediately picked up. SO much better than hot deploy for laptop development. This will save me hours, and it has no impact on my current maven project. Its just what I needed. THANK YOU.
If you don't want to use the quickstart, here is the Start.java source I use.

import org.mortbay.jetty.Connector;import org.mortbay.jetty.Server;import org.mortbay.jetty.bio.SocketConnector;import org.mortbay.jetty.webapp.WebAppContext;import org.mortbay.jetty.webapp.WebInfConfiguration;import org.mortbay.jetty.webapp.WebXmlConfiguration;

public class Start {
	public static void main(String[] args) throws Exception {		Server server = new Server();		SocketConnector connector = new SocketConnector();				// Set some timeout options to make debugging easier.		connector.setMaxIdleTime(1000 * 60 * 60);		connector.setSoLingerTime(-1);		connector.setPort(8080);		server.setConnectors(new Connector[] { connector });
		WebAppContext bb = new WebAppContext();		bb.setServer(server);		bb.setContextPath("/");                // CHANGE ME - point to your project path		bb.setWar("target/YOUR_APP");		bb.setConfigurationClasses(new String[] { WebInfConfiguration.class.getName(), WebXmlConfiguration.class.getName() });		bb.setParentLoaderPriority(true);		// START JMX SERVER		// MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();		// MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);		// server.getContainer().addEventListener(mBeanContainer);		// mBeanContainer.start();				server.addHandler(bb);
		try {			System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS [ENTER] TO STOP");			server.start();			System.in.read();			System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); 			server.stop();			server.join();		} catch (Exception e) {			e.printStackTrace();			System.exit(100);		}	}} 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4

RE: Can I develop without recompiling/restarting after every change?

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Our particular web application simply could not exist if wicket did not
allow us to load markup from outside the jar. I think it's fine that the
default is loading markup from the jar.

I our case we have a number of mechanisms by which more skilled end
users can adjust markup so to force an app reload each time an end user
does this would certainly place the policy of 'markup should be stored
in the jar' outside the realms of best practice.


>-----Original Message-----
>From: bht@actrix.gen.nz [mailto:bht@actrix.gen.nz]
>Sent: Monday, 7 June 2010 9:05 AM
>To: users@wicket.apache.org; John Krasnay
>Subject: Re: Can I develop without recompiling/restarting after every
>change?
>
>Hi
>
>>Yes, I understand that. But you have to put the markup for each
>>component somewhere. If it's not on the classpath, then you will not
be
>>able to package that component into a JAR for re-use.
>
>As I wrote, both methods co-exist, and you can put markup on the
>classpath and package it as jar while other markup is separate from
>the classpath. How otherwise would I be able to use Wicket components
>with my scheme? Please accept the good news that your "but" is not
>justified.
>
>>No, we disagree because I think that "doing nothing", i.e. keeping
your
>>component markup on the classpath, *is* the best practice, that is,
the
>>majority opinion on what makes the most sense for most people.
>
>Quoting "majority opinion" and "community consensus" is a very weak
>contribution to innovation, a sign that the speaker is running out of
>genuine ideas. In such context I would typically say that my views
>represent the other 100% of such perceived majority/consensus, just to
>make it absolutely clear what kind of Orwellian bsht this is.
>
>Page developers, especially those who work with markup, and that is
>the majority that Wicket is targeting (not component developers) need
>the markup in the context of their resolvable image, script and other
>resource files which is in the web directory. Otherwise they cannot
>view the markup in the browser. They don't care where these files are
>at runtime as long as they are not broken at design time which they
>currently are. You never seem to comment on this critical point.
>
>>
>>If you feel that the default approach isn't the best practice, then
you
>>are saying that the Wicket designers made a mistake by making this the
>>default. I disagree strongly with that sentiment.
>
>You accept broken markup at design time and I don't accept it because
>I have solved the problem.
>
>I would not go as far as to say they made THAT mistake. As you know,
>they gave us the option. But the non-default option is broken because
>of the missing three lines of Java code, and whenever people try it,
>they become part of your perceived community consensus due to
>frustration. Like prisoners.
>
>>I think perhaps we mean different things by "deploy on save". When I
say
>>"deploy" I mean it in the J2EE sense, where the container re-loads my
>>WAR package. In my case, this re-loads my Spring context and a few
dozen
>>JPA entity beans, which takes up to 15 seconds on my relatively modern
>>laptop. There is no way rearranging my markup (or running it on a
"fully
>>certified J2EE server") would turn this into milliseconds.
>
>True. "deploy on save" is not invented here. It is a term used in
>IDEs. The IDE decides what deployment method to use depending on file
>location etc.. That is one of two reasons why I would recommend to not
>store page markup in Java package directories.
>
>
>>Look, the only reason I took up this (now too long) thread is your use
>>of the words "best practice", which implies a broadly held consensus.
>>Now that you've included "as I see it" I'm happy to let it drop.
>
>Wrong.
>
>Best practice does not imply "broadly held consensus" at all. I am not
>using this as a buzzword as you are. If I invent a better mouse trap
>today that is more effective at delivering the outcome than any other
>technique, while the better mouse trap is not even available or known
>to everyone, then using it becomes best practice overnight.
>
>Regards
>
>Bernard
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org


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


Re: Can I develop without recompiling/restarting after every change?

Posted by bh...@actrix.gen.nz.
Hi

>Yes, I understand that. But you have to put the markup for each
>component somewhere. If it's not on the classpath, then you will not be
>able to package that component into a JAR for re-use.

As I wrote, both methods co-exist, and you can put markup on the
classpath and package it as jar while other markup is separate from
the classpath. How otherwise would I be able to use Wicket components
with my scheme? Please accept the good news that your "but" is not
justified.

>No, we disagree because I think that "doing nothing", i.e. keeping your
>component markup on the classpath, *is* the best practice, that is, the
>majority opinion on what makes the most sense for most people.

Quoting "majority opinion" and "community consensus" is a very weak
contribution to innovation, a sign that the speaker is running out of
genuine ideas. In such context I would typically say that my views
represent the other 100% of such perceived majority/consensus, just to
make it absolutely clear what kind of Orwellian bsht this is.

Page developers, especially those who work with markup, and that is
the majority that Wicket is targeting (not component developers) need
the markup in the context of their resolvable image, script and other
resource files which is in the web directory. Otherwise they cannot
view the markup in the browser. They don't care where these files are
at runtime as long as they are not broken at design time which they
currently are. You never seem to comment on this critical point.

>
>If you feel that the default approach isn't the best practice, then you
>are saying that the Wicket designers made a mistake by making this the
>default. I disagree strongly with that sentiment.

You accept broken markup at design time and I don't accept it because
I have solved the problem.

I would not go as far as to say they made THAT mistake. As you know,
they gave us the option. But the non-default option is broken because
of the missing three lines of Java code, and whenever people try it,
they become part of your perceived community consensus due to
frustration. Like prisoners.

>I think perhaps we mean different things by "deploy on save". When I say
>"deploy" I mean it in the J2EE sense, where the container re-loads my
>WAR package. In my case, this re-loads my Spring context and a few dozen
>JPA entity beans, which takes up to 15 seconds on my relatively modern
>laptop. There is no way rearranging my markup (or running it on a "fully
>certified J2EE server") would turn this into milliseconds.

True. "deploy on save" is not invented here. It is a term used in
IDEs. The IDE decides what deployment method to use depending on file
location etc.. That is one of two reasons why I would recommend to not
store page markup in Java package directories.


>Look, the only reason I took up this (now too long) thread is your use
>of the words "best practice", which implies a broadly held consensus.
>Now that you've included "as I see it" I'm happy to let it drop.

Wrong.

Best practice does not imply "broadly held consensus" at all. I am not
using this as a buzzword as you are. If I invent a better mouse trap
today that is more effective at delivering the outcome than any other
technique, while the better mouse trap is not even available or known
to everyone, then using it becomes best practice overnight.

Regards

Bernard


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


Re: Can I develop without recompiling/restarting after every change?

Posted by John Krasnay <jo...@krasnay.ca>.
On Sun, Jun 06, 2010 at 08:54:18AM +1200, bht@actrix.gen.nz wrote:
> If you study the effects of adding resource paths in Wicket then you
> will find that both methods will co-exist, not negate each other as
> you write.

Yes, I understand that. But you have to put the markup for each
component somewhere. If it's not on the classpath, then you will not be
able to package that component into a JAR for re-use.

> There are environments such as yours and other trivial environments
> where nothing needs to be done at all.

I'm curious as to why you think my environment is trivial. 

> That does not mean that doing
> nothing is best practice. Best practice is something else. A best
> approach in an individual case may be different from best practice,
> and that is why you disagree.

No, we disagree because I think that "doing nothing", i.e. keeping your
component markup on the classpath, *is* the best practice, that is, the
majority opinion on what makes the most sense for most people.

If you feel that the default approach isn't the best practice, then you
are saying that the Wicket designers made a mistake by making this the
default. I disagree strongly with that sentiment.

> Deploy on save would take only milliseconds (with my proposed path
> structure applied) and the session would be preserved if you were
> using GlassFish 3.0 and NetBeans, leading to a performance gain. You
> may not need this functionality, but your setup seems to be slower
> than what is achievable.

I think perhaps we mean different things by "deploy on save". When I say
"deploy" I mean it in the J2EE sense, where the container re-loads my
WAR package. In my case, this re-loads my Spring context and a few dozen
JPA entity beans, which takes up to 15 seconds on my relatively modern
laptop. There is no way rearranging my markup (or running it on a "fully
certified J2EE server") would turn this into milliseconds.

> Yes I am moving markup around. And that (with an additional 3 lines of
> framwork code) leads to a re-definition of best practice for Wicket
> page development as I see it because of two gains:

Look, the only reason I took up this (now too long) thread is your use
of the words "best practice", which implies a broadly held consensus.
Now that you've included "as I see it" I'm happy to let it drop.

jk

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


Re: Can I develop without recompiling/restarting after every change?

Posted by bh...@actrix.gen.nz.
Hi,

>I don't
>agree that it's the best approach in all environments, and I think your
>advice negates one of the best features of Wicket, namely the ability to
>package complete Wicket components (including their markup and other
>resources) into JAR files for convenient re-use across applications.
>

Wrong.

Let me repeat what I wrote in my previos article: "This would not
break the ability of packaging markup of some components in the
classpath because Wicket can handle that at the same time."

If you study the effects of adding resource paths in Wicket then you
will find that both methods will co-exist, not negate each other as
you write.

There are environments such as yours and other trivial environments
where nothing needs to be done at all. That does not mean that doing
nothing is best practice. Best practice is something else. A best
approach in an individual case may be different from best practice,
and that is why you disagree.


>I think perhaps you're missing the point here. In my development
>environment (Eclipse+Tomcat) I *don't* re-deploy on save. That would be
>far too slow. But any markup changes I make (and a good portion of the
>Java changes, too) are usually picked up by the time I Alt-Tab to my
>browser and refresh the page.

With my proposed method, your cycle would not be affected at all. You
would still have all your benefits. My method is inclusive and general
wheteher you chose to deploy on save or not.

Deploy on save would take only milliseconds (with my proposed path
structure applied) and the session would be preserved if you were
using GlassFish 3.0 and NetBeans, leading to a performance gain. You
may not need this functionality, but your setup seems to be slower
than what is achievable.

>I think that was Martijn's point: if you're doing re-deploy on save in
>your development environment (as the OP implied he was) then you're
>doing it wrong. No amount of moving markup around is goint to change
>this.

I am sorry your statement is wrong. You are assuming that I am using
Tomcat. For fully certified J2EE servers, and I wrote that my general
approach includes these, IDE instrumentation is not necessarily the
same as for Tomcat.


Yes I am moving markup around. And that (with an additional 3 lines of
framwork code) leads to a re-definition of best practice for Wicket
page development as I see it because of two gains:

- Markup re-factoring within the scope of the web directory becomes
possible because links are no longer broken

- Application server IDE instrumentation can make better deployment
choices for deploy on save optimisation

I am not claiming that you will personally benefit from this. You seem
to be happy enough with your setup.


Regards,

Bernard


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


Re: Can I develop without recompiling/restarting after every change?

Posted by John Krasnay <jo...@krasnay.ca>.
On Sat, Jun 05, 2010 at 10:13:42AM +1200, bht@actrix.gen.nz wrote:
> Hi,
> 
> My suggestions were meant to be general, and with "best" I actually
> meant in all environments including certified J2EE servers.

I'm aware that's what you meant. That's why I challenged it. I don't
agree that it's the best approach in all environments, and I think your
advice negates one of the best features of Wicket, namely the ability to
package complete Wicket components (including their markup and other
resources) into JAR files for convenient re-use across applications.

Since the OP is a self-confessed "n00b" I wanted to make sure he didn't
miss out on this important point.

> That is because deployment environments may or may not make decisions
> on which way to deploy different file types, or depending on
> directories they are loaded from. Files in the web directory are quite
> obviously candidates for the fastest deployment method.
> 
> If the environment thinks that HTML files need to be deployed in the
> same way as Java files, which is quite likely if they are stored in
> Java packages, then deploy-on-save setups may slow down the
> development process of complex applications due to heavy CPU use.

I think perhaps you're missing the point here. In my development
environment (Eclipse+Tomcat) I *don't* re-deploy on save. That would be
far too slow. But any markup changes I make (and a good portion of the
Java changes, too) are usually picked up by the time I Alt-Tab to my
browser and refresh the page.

I think that was Martijn's point: if you're doing re-deploy on save in
your development environment (as the OP implied he was) then you're
doing it wrong. No amount of moving markup around is goint to change
this.

jk

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


How to do a multiple page form?

Posted by David Chang <da...@yahoo.com>.
Hi, I would like to do a multiple page form. For example, I have a two-page form. Both pages have a few fields that need validation. The first page has a button called "Next" and the second page has a "Previous" button and a "Submit" button.

Any pointers or how-to info will be greatly appreciated.

Best and have a great weekend!

-David


      

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


Re: Can I develop without recompiling/restarting after every change?

Posted by bh...@actrix.gen.nz.
Hi,

My suggestions were meant to be general, and with "best" I actually
meant in all environments including certified J2EE servers.

Any number of environments (Igor suggested Jetty) may work with or
without these suggestions.

That is because deployment environments may or may not make decisions
on which way to deploy different file types, or depending on
directories they are loaded from. Files in the web directory are quite
obviously candidates for the fastest deployment method.

If the environment thinks that HTML files need to be deployed in the
same way as Java files, which is quite likely if they are stored in
Java packages, then deploy-on-save setups may slow down the
development process of complex applications due to heavy CPU use.

Therefore, fetching markup from the web directory not from the
classpath is clearly superior under some of these conditions.

This would not break the ability of packaging markup of some
components in the classpath because Wicket can handle that at the same
time.

There is no need to squeeze my comments into the frame of your
"community consensus". I am perfectly happy if my comments are correct
only for the other 100% of the community that I am targeting.

OT:

If Wicket adds the trivial feature of resolving HTML resource links
differently then finally there will be separation of concerns.
It will be possible to resolve links to resources e.g. css files,
images when loading HTML files from the local file system in the
package structure in the web directory.

And finally one would be able to use markup refactoring that is
available in today's tools. This is cheap stuff and I am perplexed why
it is not happening. Three lines of code -> better practice.

See https://issues.apache.org/jira/browse/WICKET-2881


Regards

Bernard


On Thu, 3 Jun 2010 08:26:45 -0400, you wrote:

>Hrm, perhaps you should have qualified your advice: "If you're using
>NetBeans, then for best performance..."
>
>Also, the packaging of markup on the classpath allows you to create
>re-usable JARs of components and IMHO is one of the best features of
>Wicket. So perhaps the qualification should really be, "If you're using
>NetBeans, and you're not planning on packaging your Wicket components in
>a re-usable JAR, then for best performance..."
>
>The way your original post is phrased makes it sound like a best
>practice, and it implies the Wicket default to fetch markup from the
>classpath is inferior. I don't think this is a consensus among the
>community.
>
>jk
>
>On Thu, Jun 03, 2010 at 08:57:43PM +1200, bht@actrix.gen.nz wrote:
>> Martijn,
>> 
>> You are making a *lot* of assumptions.
>> 
>> Not everybody uses Eclipse.
>> 
>> Nobody in this thread would consider restarts acceptable, still we are
>> using this subject.
>> 
>> HTML files location has to do with performance in the developing
>> process depending on how the IDE handles the files.
>> 
>> Please advise how to configure the NetBeans IDE to redeploy a HTML
>> file in a Java package in a J2EE app server with the same speed as
>> HTML files in the web directory (milliseconds not seconds).
>> 
>> 
>> Thanks
>> 
>> Bernard
>> 
>> 
>> 
>> 
>> On Sun, 30 May 2010 15:23:09 +0200, you wrote:
>> 
>> >Huh?
>> >
>> >Storing the HTML in the packages has *nothing* to do with requiring
>> >restarts. Only wrongly configured IDEs may cause that.
>> >
>> >If your HTML doesn't get reloaded when you change it, then you should
>> >run Wicket in DEVELOPMENT mode. Also make sure you've configured
>> >Eclipse to copy all resources (not just .properties files)
>> >
>> >The Wicket Quickstart project and using Maven to generate your eclipse
>> >project files (mvn eclipse:eclipse) will configure everything
>> >correctly.
>> >
>> >Martijn
>> >
>> >On Sat, May 29, 2010 at 11:18 PM,  <bh...@actrix.gen.nz> wrote:
>> >> Hi,
>> >>
>> >> For best performance of redeploys in Wicket, consider storing HTML not
>> >> in the Java package structure but in the web directory. So if your IDE
>> >> and app server allow for hot deployment, then HTML changes deploy much
>> >> faster, ie instantly. In your application init(), you add one
>> >> statement
>> >>
>> >> getResourceSettings().addResourceFolder("wicket");
>> >>
>> >> where "wicket" matches the url-pattern in your filter-mapping in
>> >> web.xml.
>> >>
>> >> PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
>> >> background on how to take this one step further.
>> >>
>> >> Additionally, with GlassFish V3, you get session preservation on hot
>> >> deployment of Java classes.
>> >>
>> >> You can enable "deploy on save" for convenience.
>> >>
>> >> If that is not fast enough, you can run your app in debug mode and hot
>> >> swap classes after save while you are debugging it.
>> >>
>> >> All this comes with the NetBeans IDE. You really don't have to worry
>> >> about this stuff anymore.
>> >>
>> >> Regards
>> >>
>> >> Bernard
>> >>
>> >>
>> >>
>> >> On Sat, 29 May 2010 16:12:46 +0100, you wrote:
>> >>
>> >>>have you tried JRebel? ?I've not used it myself, but there was an
>> >>>interview on JavaPosse recently, sounds like it'd be an ideal fit for
>> >>>any Wicket developer.
>> >>>
>> >>>Dan
>> >>>
>> >>>On 22/07/28164 20:59, David Chang wrote:
>> >>>> I am using Tomcat, any tips about how to develop out recompiling/restarting after every change?
>> >>>>
>> >>>> Best.
>> >>>>
>> >>>> --- On Fri, 5/21/10, Jeremy Thomerson<je...@wickettraining.com> ?wrote:
>> >>>>
>> >>>>
>> >>>>> From: Jeremy Thomerson<je...@wickettraining.com>
>> >>>>> Subject: Re: Can I develop without recompiling/restarting after every change?
>> >>>>> To: users@wicket.apache.org
>> >>>>> Date: Friday, May 21, 2010, 12:17 PM
>> >>>>> the easiest way to do this is to use
>> >>>>> the Start class (Start.java) from the
>> >>>>> quickstart to run an embedded jetty instance in your
>> >>>>> IDE. ?then, if you run
>> >>>>> it in debug mode, it will hotswap any possible changes (and
>> >>>>> tell you if you
>> >>>>> must restart if it's an incompatible change)
>> >>>>>
>> >>>>> --
>> >>>>> Jeremy Thomerson
>> >>>>> http://www.wickettraining.com
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On Fri, May 21, 2010 at 10:53 AM, ekallevig<er...@ekallevig.com>
>> >>>>> wrote:
>> >>>>>
>> >>>>>
>> >>>>>> I'm a front-end developer trying to learn Java (total
>> >>>>>>
>> >>>>> n00b) and working on
>> >>>>>
>> >>>>>> a
>> >>>>>> wicket application at work. ?The whole process
>> >>>>>>
>> >>>>> feels very slow primarily
>> >>>>>
>> >>>>>> because I have to recompile and restart JBoss every
>> >>>>>>
>> >>>>> time I make a change.
>> >>>>>
>> >>>>>> So I'm wondering what the best way is to avoid having
>> >>>>>>
>> >>>>> to do this when
>> >>>>>
>> >>>>>> editing .java/.js/.css/.html files during development?
>> >>>>>>
>> >>>>> I'd like to just
>> >>>>>
>> >>>>>> make
>> >>>>>> changes and then refresh the browser to test -- is
>> >>>>>>
>> >>>>> this possible?
>> >>>>>
>> >>>>>> I've seen in the FAQ that you can change the
>> >>>>>>
>> >>>>> application settings to
>> >>>>>
>> >>>>>> auto-reload markup .html files -- where would I insert
>> >>>>>>
>> >>>>> this setting
>> >>>>>
>> >>>>>> (remember I'm a total n00b).
>> >>>>>>
>> >>>>>> As to .css/.js/.java files -- do I need jRebel or
>> >>>>>>
>> >>>>> something like that to
>> >>>>>
>> >>>>>> get
>> >>>>>> these files to reload automatically?
>> >>>>>>
>> >>>>>> Thanks for helping out a super-beginner :)
>> >>>>>> --
>> >>>>>> View this message in context:
>> >>>>>> http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html
>> >>>>>> Sent from the Wicket - User mailing list archive at
>> >>>>>>
>> >>>>> Nabble.com.
>> >>>>>
>> >>>>>>
>> >>>>>>
>> >>>>> ---------------------------------------------------------------------
>> >>>>>
>> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org


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


Re: Opening a new modal window when OK is clicked on currently open modal window

Posted by Istvan Jozsa <jo...@gmail.com>.
Yes, by opening the second window *when* the first is closed.
Try something like this:

abstract class Modal1 extends ModalWindow {
   public Modal1(id) {
      // ...
      setWindowClosedCallback(new ModalWindow.CloseButtonCallback() {
         @Override
         public void onClose(AjaxRequestTarget target) {
            Modal1.this.onClose(target);
         }
      });
   }
   protected abstract void onClose(AjaxRequestTarget target);
   public Modal1 showMe(target) {
      // ...
      super.show();
      return this;
   }
}

// somewhere in the page:
ModalWindow modal1, modal2;
// ...
add(modal1 = new Modal1("w1") {
   @Override
   void onClose(AjaxRequestTarget target) {
     modal2.show(target);
   }
});
add(modal2 = new Modal2("w2"));
// ...
modal1.showMe(target);

The more flexible solution is by
setting the close callback *when* the window is shown:

modal1.showMe(target).setWindowClosedCallback(new
ModalWindow.CloseButtonCallback() {
   @Override
   public void onClose(AjaxRequestTarget target) {
       modal2.show(target);
   }
});


On Thu, Jun 3, 2010 at 3:48 PM, Chris Colman
<ch...@stepaheadsoftware.com>wrote:

> Is it possible to replace the currently open Modal window with a
> different modal window from within the OK click handler of the currently
> open modal window?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Opening a new modal window when OK is clicked on currently open modal window

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Is it possible to replace the currently open Modal window with a
different modal window from within the OK click handler of the currently
open modal window?


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


How to remove css class from a component?

Posted by David Chang <da...@yahoo.com>.
Hello,

I add a CSS class to component dynamcially the following way:

inputComponent.add(new AttributeAppender("class", new Model<String>("errorField"), " "));

How can I remove this CSS class in java code?

Best!


      

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