Re: Custom XHTML tag

2012-07-13 Thread Decebal Suiu
Hi

First, is it a good question.
My solution use jqwicket tooltip and I touch both java and html files but
it's ok for me.

 InlineHelp.java
public class InlineHelp extends Panel {

   private static final long serialVersionUID = 1L;

   public InlineHelp(String id, IModelString messageModel) {
  super(id, messageModel);
   }

   public InlineHelp(String id, String message) {
 super(id, Model.Stringof(message));
   }

   @Override
   protected void onInitialize() {
  super.onInitialize();

  setRenderBodyOnly(true);

  WebComponent image = new ContextImage(image, /images/help.png) {

 private static final long serialVersionUID = 1L;

 @Override
 protected void onComponentTag(ComponentTag tag) {
tag.put(title, (String)
InlineHelp.this.getDefaultModelObject());
}

};
image.add(new TipTipBehavior(new TipTipOptions().maxWidth(auto)));
add(image);
   }

}

 InlineHelp.html
?xml version=1.0 encoding=utf-8?
html xmlns:wicket=http://wicket.apache.org/;
wicket:panel
 
/wicket:panel
/html

 How to use
 java
form.add(new InlineHelp(emailHelp, If you want some notifications));
 html

Email notifications
input type=checkbox wicket:id=emailNotification/


Best regards,
Decebal




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-XHTML-tag-tp4650489p4650506.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Custom XHTML tag

2012-07-13 Thread Jered Myers

This seems to be getting me where I want to go with the xhtml tag:
http://sanityresort.blogspot.com/2011/08/creating-custom-wicket-tag-resolver.html

On 07/13/2012 01:40 AM, Decebal Suiu wrote:

Hi

First, is it a good question.
My solution use jqwicket tooltip and I touch both java and html files but
it's ok for me.


InlineHelp.java

public class InlineHelp extends Panel {

private static final long serialVersionUID = 1L;

public InlineHelp(String id, IModelString messageModel) {
   super(id, messageModel);
}

public InlineHelp(String id, String message) {
  super(id, Model.Stringof(message));
}

@Override
protected void onInitialize() {
   super.onInitialize();

   setRenderBodyOnly(true);

   WebComponent image = new ContextImage(image, /images/help.png) {

  private static final long serialVersionUID = 1L;

 @Override
  protected void onComponentTag(ComponentTag tag) {
 tag.put(title, (String)
InlineHelp.this.getDefaultModelObject());
 }

 };
image.add(new TipTipBehavior(new TipTipOptions().maxWidth(auto)));
add(image);
}

}


InlineHelp.html

?xml version=1.0 encoding=utf-8?
html xmlns:wicket=http://wicket.apache.org/;
wicket:panel
  
/wicket:panel

/html


How to use

java

form.add(new InlineHelp(emailHelp, If you want some notifications));

html

Email notifications
input type=checkbox wicket:id=emailNotification/


Best regards,
Decebal




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-XHTML-tag-tp4650489p4650506.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org