Re: FeedbackPanel + Link problem

2007-09-05 Thread Kent Tong



fero wrote:
 
 I found what was wrong but I can not explain it
 
 In markup of LabelLink I had
 wicket:panel
   button wicket:id=id id=idlabel wicket:id=id/label/button
 /wicket:panel
 
 When I changed button tags to a it was working, but I want my links to
 look like buttons
 
 wicket:panel
label wicket:id=id/label 
 /wicket:panel
 
 

I tried using a button and it works fine. Here is my code (using v1.3
beta2):

LabelLink.html:
wicket:panel
input type=button wicket:id=id value=click melabel
wicket:id=id/label/input
/wicket:panel

LabelLink.java: same as yours.

Test.html:
html
body

form wicket:id=form

/form
/body
/html

Test.java:
public class Test extends WebPage {
public Test() {
add(new FeedbackPanel(fb));
Form form = new Form(form);
add(form);
form.add(new LabelLink(ll, new Model(hello)) {

@Override
public void onClick() {
error(error!);
}

});
}
}



-- 
View this message in context: 
http://www.nabble.com/FeedbackPanel-%2B-Link-problem-tf4380134.html#a12494894
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FeedbackPanel + Link problem

2007-09-04 Thread fero

Hi,
I have a page with feedback panel. As s button I use my own Panel -
LabelLink (Link+Label) but I don't get an error message in feedback, when
operation in onClick() get wrong. When I use another Panel LabelSubmitButton
I get this error. I also tried to change Link to AjaxLing in LabelLink and
added feedback panel to target but it did not help. 

Thanks for your help, I am desperate.

Here is code for both buttons

*LabelSubmitButton.java*
public class LabelSubmitButton extends Panel{


private static final String ID = id;
Button button;

public LabelSubmitButton(String id, IModel model) {
super(id);
button = new Button(ID){
protected void onSubmit() {
LabelSubmitButton.this.onSubmit();
}
};

button.add(new Label(ID, model));
this.add(button);
}

public Form getForm() {
return button.getForm();
}

protected void onSubmit(){};

}


***LabelLink.java**
public abstract class LabelLink extends Panel{

private static final String ID = id;

public LabelLink(String id, IModel model) {
super(id);
Link link = new Link(ID){

public void onClick() {
LabelLink.this.onClick();

}   
};

link.add(new Label(ID, model));

this.add(link);
}

abstract public void onClick();

}

-- 
View this message in context: 
http://www.nabble.com/FeedbackPanel-%2B-Link-problem-tf4380134.html#a12486040
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FeedbackPanel + Link problem

2007-09-04 Thread fero

I found what was wrong but I can not explain it

In markup of LabelLink I had
wicket:panel
button wicket:id=id id=idlabel wicket:id=id/label/button
/wicket:panel

When I changed button tags to a it was working, but I want my links to
look like buttons

wicket:panel
 label wicket:id=id/label 
/wicket:panel

-- 
View this message in context: 
http://www.nabble.com/FeedbackPanel-%2B-Link-problem-tf4380134.html#a12486197
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]