You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by fero <fr...@gmail.com> on 2007/09/04 22:29:56 UTC

FeedbackPanel + Link problem

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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel + Link problem

Posted by Kent Tong <ke...@cpttm.org.mo>.


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="id"><label 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 me"><label
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel + Link problem

Posted by fero <fr...@gmail.com>.
I found what was wrong but I can not explain it

In markup of LabelLink I had
<wicket:panel>
	<button wicket:id="id" id="id"><label 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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org