Thank you, Serkan, for posting this solution.  It's very slick.  I have been
wrestling with trying to figure out how to slip a link into a panel when I
don't know until runtime what the link will be and you've just told me how
to slip in HTML at runtime.  I love it!

Shelah


Serkan Camurcuoglu-3 wrote:
> 
> Peter means that you can put html as the string content of a label like
> this:
> 
> Label l = new Label("myLabel", "<ul><li>Some html here</li></ul>");
> l.setEscapeModelStrings(false);
> l.setRenderBodyOnly(true);
> 
> this way the label will display only the html that you've given..
> 
> 
> 
> -----Original Message-----
> From: miro [mailto:[EMAIL PROTECTED]
> Sent: Fri 10/10/2008 12:20 AM
> To: users@wicket.apache.org
> Subject: Re: html code in component class
>  
> 
> here the html again
> 
> 
>               <spant wicket:id="custmenu">
>                  <ult>
>                               <lit wicket:id="repater">
>                               </lit>
>                  </ult>
>               </spant>
> hml for repeater
> 
>                                       <spant wicket:id="customlink">
>                                               <At href="#" 
> wicket:id="link"><labelt wicket:id="lbl"></label> 
>                                               
> please ignore t with every tag its just to show actual html
> 
> miro wrote:
>> 
>> Its not just label   here is the html
>> 
>>              
>>                 <ul>
>>                              <li wicket:id="repater">
>>                              </li>
>>                 </ul>
>>              
>> hml for repeater
>> 
>>                                      
>>                                               # <label 
>> wicket:id="lbl"></label> 
>>                                              
>> 
>> 
>> instead of writing the same html  at 10 paqlces  i want to write it once
>> and reuse it in the please twell me how ?
>> 
>> 
>> 
>> Peter Ertl-3 wrote:
>>> 
>>> If it's just a line use Label
>>> 
>>> Am 09.10.2008 um 21:01 schrieb miro:
>>> 
>>>>
>>>> Using panel I have to write a .html   file which I dont want to do  
>>>> becasue my
>>>> html code is very little just a line   ,
>>>> next option is Fragment but this is not clear, neither the api doc  
>>>> nor the
>>>> wicket examples  please can you give me small example  using  
>>>> fragment   ?
>>>>
>>>> jwcarman wrote:
>>>>>
>>>>> What's wrong with using a panel?  If this is to be done in only one
>>>>> class, have you thought about using a Fragment?
>>>>>
>>>>> On Thu, Oct 9, 2008 at 2:28 PM, miro <[EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>> the label appears complex i looking for a simple solution
>>>>>>
>>>>>> My custom component    uses wicket components internally  here is an
>>>>>> example
>>>>>>
>>>>>>       protected class CustomLinkComponent extends   
>>>>>> WebMarkupContainer  {
>>>>>>               String displayName;
>>>>>>               Class  clazz;
>>>>>>               public CustomLinkComponent(String displayName, Class
>>>>>> clazz) {
>>>>>>                       super("customlink");
>>>>>>                       this.displayName=displayName;
>>>>>>                       this.clazz=clazz;
>>>>>>                       add(getBookmarkablePageLink());
>>>>>>                       add(getDisplayNameLabel());
>>>>>>               }
>>>>>>               protected BookmarkablePageLink   
>>>>>> getBookmarkablePageLink(){
>>>>>>                       return new BookmarkablePageLink("link",  
>>>>>> clazz);
>>>>>>               }
>>>>>>               protected  Label  getDisplayNameLabel(){
>>>>>>                       return new Label("lbl",displayName);
>>>>>>               }
>>>>>>
>>>>>>       }
>>>>>>
>>>>>>     the html  for this is
>>>>>> # <label wicket:id="lbl"></label>
>>>>>>
>>>>>> so instead of writing a html page  i want my component to render  
>>>>>> this
>>>>>> html
>>>>>> and further wicket should replace the child components  link and  
>>>>>> lbl with
>>>>>> actual values  ,  can I do this ?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> jwcarman wrote:
>>>>>>>
>>>>>>> Sure.  Look at what the Label class does.  It doesn't have an HTML
>>>>>>> template.
>>>>>>>
>>>>>>> On Thu, Oct 9, 2008 at 1:49 PM, miro <[EMAIL PROTECTED]> wrote:
>>>>>>>>
>>>>>>>> like I have  very little html and I dont want a write a  new .html
>>>>>>>> file
>>>>>>>> and
>>>>>>>> just in my component i want to override some method  which  
>>>>>>>> returns html
>>>>>>>> as
>>>>>>>> string  for the component .Is  this possible ?
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/html-code-in-component-class-tp19903944p19903944.html
>>>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/html-code-in-component-class-tp19903944p19904618.html
>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>>>
>>>>
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/html-code-in-component-class-tp19903944p19905223.html
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>> 
>>> 
>>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/html-code-in-component-class-tp19903944p19907604.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
View this message in context: 
http://www.nabble.com/html-code-in-component-class-tp19903944p19916050.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to