wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard W. Adams" <RWADA...@UP.COM>
Subject Re: FormComponent independent from the Model/Model object
Date Tue, 09 Jul 2013 18:15:07 GMT
Well, one approach is create it as a normal HTML control & not render it 
via Wicket. You can just attach a standard Javascript event (such as 
onclick) to get the behavior you want.

Bottom line: You don't have to "Wicketize" everything on your page. Just 
because you have a hammer, it doesn't mean everything is a nail.

From:   Dmitriy Neretin <dmitriy.neretin@googlemail.com>
To:     users@wicket.apache.org
Date:   07/09/2013 12:58 PM
Subject:        FormComponent independent from the Model/Model object

Hi everyone,

I have a dummy question:

If I have a panel with a form (not everything is my code) ->

public class MyPanel{

  public MyPanel(id, IModel<MyObj> model){
        super(id, new CompoundPropertyModel<MyObj>(model);
        Form<MyObj> form = new Form("id", model);
        form.add(new AjaxCheckBox("anyStupidId");



And I want to add a Component (AjaxCheckBox) to the form above, but this
component shouldn't have anything to do with a model object. It's purpose
is just a change the state of the input fields. If I check the box the
field should be deactivated and vice versa. Nothing more.

My problem is, that Wicket thinks (and I even know  why :)) the
"anyStupidId" is a field of MyObj and tries to change the value... Well,
the checkbox should be inside of the form, but I don't know if is it
possible to make this checkbox independent from the Model handling... How
can I tell wicket, "hey dude, anyStupidId has nothing to do with MyObj, it
is really just a stupid id"



This email and any attachments may contain information that is confidential and/or privileged
for the sole use of the intended recipient.  Any use, review, disclosure, copying, distribution
or reliance by others, and any forwarding of this email or its contents, without the express
permission of the sender is strictly prohibited by law.  If you are not the intended recipient,
please contact the sender immediately, delete the e-mail and destroy all copies.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message