> > there (I put it in my submitLinks/buttons)
>> >> >
>> >> > On Thu, Dec 17, 2009 at 2:45 PM, Pieter Degraeuwe <
>> >> > pieter.degrae...@systemworks.be> wrot
Links/buttons)
> >> >
> >> > On Thu, Dec 17, 2009 at 2:45 PM, Pieter Degraeuwe <
> >> > pieter.degrae...@systemworks.be> wrote:
> >> >
> >> >> Use the onSubmit(AjaxRequestTarget target) of your AjaxSubmitLink
> >> instea
arget target) of your AjaxSubmitLink
>> instead
>> >> of your form.
>> >> (Note that if you make use of FeedbackPanel, youd should also override
>> >> the
>> >> onError() method of that ajaxlink to 'refresh' your fee
to 'refresh' your feedback panel)
> >>
> >
>
> At first I wanted to do this in onSubmit of AjaxSubmitLink, but i've
> problem
> to get name and address components inside this method :(
>
> --
> View this message in context:
> http://old.nabble.co
first I wanted to do this in onSubmit of AjaxSubmitLink, but i've problem
to get name and address components inside this method :(
--
View this message in context:
http://old.nabble.com/Accessing-Page-components-tp26824375p26828432.html
Sent from the Wicket - User mailing list archiv
allback;
>>
>>Link link = new Link();
>>this.setModel(new Model(link));
>>add(new TextField("name", new PropertyModel(link,
>> "name")));
>>add(new TextField("address&qu
tyModel(link,
> "address")));
>add(new AjaxSubmitLink("ok"){
>@Override
>protected void onSubmit(AjaxRequestTarget target,
> Form form) {}
>});
>}
);
}
@Override
protected void onSubmit() {
System.out.println("ok");
Link l = (Link)this.getModelObject();
new LinkDAO().save(l);
callback.onAdd(target ); // ?
There are several ways how you can do this...
To encourage losely coupled components folowing is in my opinion the best
solution..
Work with a callback mechanism. let's say you define a callback interface
SaveCallback with a method onSaved(AjaxRequestTarget target).
The component that uses you pa
2009/12/17, Pieter Degraeuwe :
> However, I never do it like this. I always use PropertyModels() to 'map' my
> TextFields to properties of my object. This way your code in the onClick()
> method uses that just the object properties. (Note that the AjaxSubmitLink
> has no onClick(), but a onSubmit()
Just declare them final, should work just fine, but with consequences (you
wont be able to re-reference them in a future).
On Thu, Dec 17, 2009 at 8:45 AM, marioosh.net wrote:
> Is simple possibility to access page components in anonymous onClick
> method like in code below ?
>
> public class New
If you want to access them from a call you need to declare them final
final TextField name = new TextField("name");
But i' m missing a Model that should receive the values from the form
components?
Normally, with wicket you do not access the FormComponets to get the values but
let Wicket handle th
Place your textfields in a Form. Replace your AjaxLink() by a AjaxSubmitLink
(and place that link also in the form)
then, you should be able to get the values by name.getDefaultModelObject() I
think...
However, I never do it like this. I always use PropertyModels() to 'map' my
TextFields to proper
Is simple possibility to access page components in anonymous onClick
method like in code below ?
public class NewLinkPanel extends Panel {
public NewLinkPanel(String id) {
super(id);
TextField name = new TextField("name");
TextField address
14 matches
Mail list logo