Hi All, how are you?

   I'm new in this list, actually I'm new to wicket and I'm trying to learn
it. So far I hadn't found any issues and it worked great until I came across
this anoying problem, I have as part of my html:
I wanted to add to a page a button with a text, on click the button hits the
sever, performs some action and it should remove the button from the page
(make it not visible)

I added:
<a class="button" wicket:id="ajaxbutton"><label

and then In the java Page I have

(this code is inside a populateItem method from a ListView)
                            protected void populateItem(final ListItem<Poll>
item) {
                                      final AjaxLink<Test> button = new
AjaxLink<Test>("ajaxbutton", item.getModel()) {

public void onClick(AjaxRequestTarget target) {
                                                        //Do whatever I have
to do
this.setEnabled(false); //Also tried removing the label component,

 Label label = new Label("button-text", "AText");
button.setOutputMarkupId(true);//these are desparates attemps to solve it
button.setEnabled(!item.getModelObject().shouldBeDisabled()); //this works,
those that should be disabled do not show a button.

Any idea of what I'm doing wrong?


Reply via email to