Hi Tobias,

My mega bad, my object was null at the page initialization! :/

However, I am wondering why your model is a merged array of models, thus
handling 2 different cases...
Wouldn't had been simpler to leave the "src" as the default model and
"srcSet" as another internal model array or ListModel? It would simplify
the code and definitely ease the CPM case :)

Thanks & best regards,
Sebastien.


On Fri, Nov 27, 2015 at 11:10 PM, Sebastien <[email protected]> wrote:

> Hi Tobias,
>
> Sorry for the delay for testing your new component! As a first feedback:
>
> 1/ Actually, the component works if used with a direct model:
> form.add(new ExternalImage("gravatarImageURL", Model.of("
> http://www.gravatar.com/avatar/13532aede1a04cc766f6ac5c19ef7ff4";)));
>
> 2/ Strangely, it crashes when used with a PropertyModel, like:
> this.add(new ExternalImage("gravatarImageURL", new
> PropertyModel<String>(this.getModel(), "gravatarImageURL")));
>
> java.lang.NullPointerException
>      at 
> org.apache.wicket.markup.html.image.ExternalImage.buildSrcAttribute(ExternalImage.java:168)
>      at 
> org.apache.wicket.markup.html.image.ExternalImage.onComponentTag(ExternalImage.java:142)
>      at 
> org.apache.wicket.Component.internalRenderComponent(Component.java:2521)
>
> 3/ There is no ctor for working with CPM, like: new
> ExternalImage("gravatarImageURL")
>
> Thanks again & best regards :)
> Sebastien.
>
>
> On Tue, Nov 24, 2015 at 6:30 PM, Sebastien <[email protected]> wrote:
>
>> Hi Tobias,
>>
>> Thanks again, I will try to test this tonight...
>>
>> Best regards,
>> Sebastien.
>>
>>
>>
>> On Tue, Nov 24, 2015 at 6:28 PM, Tobias Soloschenko <
>> [email protected]> wrote:
>>
>>> Here they are:
>>>
>>>
>>> https://github.com/klopfdreh/wicket-components-playground/wiki/19.-ExternalImage
>>>
>>> To test only copy them into your classpath and it would be nice to give
>>> me some feedback.
>>>
>>> kind regards
>>>
>>> Tobias
>>>
>>> P.S.: If they fit the requirements I'm going to create a PR.
>>>
>>>

Reply via email to