Quick replies :) Thanks people

The onComponentTag works perfect.
(I only had to change getModelObjectAsString to
getDefaultModelObjectAsString; the first one didn't exist.)



Vit Rozkovec wrote:
> 
> That was too easy :)
> 
> 
> Vit Rozkovec wrote:
>>
>>
>> Try this:
>>
>> public class ExternalImage extends WebComponent
>> {
>>
>>    /**
>>     * Construct.
>>     *
>>     * @param id
>>     * @param url
>>     */
>>    public ExternalImage(String id, String url)
>>    {
>>        this(id, new Model(url));
>>    }
>>
>>    /**
>>     * Construct.
>>     *
>>     * @param id
>>     * @param model
>>     */
>>    public ExternalImage(String id, IModel model)
>>    {
>>        super(id, model);
>>    }
>>
>>    @Override
>>    protected void onComponentTag(ComponentTag tag)
>>    {
>>        super.onComponentTag(tag);
>>        checkComponentTag(tag, "img");
>>        tag.put("src", getModelObjectAsString());
>>    }
>>
>> }
>>
>> Vitek
>>
>>
>> Prag wrote:
>>> I have a DB table that contains plain URL's in text like
>>> http://someExternalServer/blabla/1.jpg.
>>>
>>> How can I put this plain text URL in a HTML IMG elements' SRC attribute
>>> without Wicket making modifications to the URL?
>>>   
>>
>>
>> ---------------------------------------------------------------------
>> 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/Plain-IMG-src-urls-tp21547371p21548444.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