Re: Image based on external url model object

2015-12-04 Thread Maxim Solodovnik
unfortunately I was unable to test it or participate in discussion :(
will try it in next available snapshot :)

On Tue, Dec 1, 2015 at 2:17 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi Martin :-D,
>
> and here it is:
>
> https://github.com/apache/wicket/pull/143
>
> kind regards
>
> Tobias
>
> Am 30.11.15 um 21:00 schrieb Martin Grigorov:
>
> Hi,
>>
>> On Nov 30, 2015 4:21 PM, "Sebastien"  wrote:
>>
>>> Hi Tobias,
>>>
>>> As I stated, I would prefer 2 different models so :
>>> - the main model is used for "src"
>>> - the model is not itself an array of models (I don't recall there is a
>>> such case elsewhere in Wicket)
>>> - it is easier to handle the CPM case
>>>
>>> As the other devs are now back from week-end, it would be nice to have
>>>
>> some
>>
>>> other opinions! :)
>>>
>> I usually wait for the PR to be able to comment on the changes.
>>
>>
>>>
>> https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java
>>
>> There is no commenting functionality in such links.
>>
>> I could comment on the original commits but:
>> 1) I have to find them
>> 2) no one else (but Tobias) will see my comments
>>
>> Thanks & best regards,
>>> Sebastien.
>>>
>>>
>>> On Sat, Nov 28, 2015 at 8:10 AM, Tobias Soloschenko <
>>> tobiassolosche...@googlemail.com> wrote:
>>>
>>> Hi Sebastien,

 thanks for testing :-)

 I thought it would be nice to get all models by the default WebComponent
 method and that they are all stored as defaultmodelobject.

 WDTY?

 Anyway it would safe 2 methods.

 kind regards

 Tobias


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


-- 
WBR
Maxim aka solomax


Re: Image based on external url model object

2015-12-04 Thread Tobias Soloschenko

Hi Maxim,

it should be available within the next SNAPSHOT. I pushed the 
corresponding commits to master and to wicket-7.x, now.


ExternalImage and ExternalSource.

Here are some examples:

https://github.com/apache/wicket/blob/master/wicket-core/src/test/java/org/apache/wicket/markup/html/image/ExternalImageTestPage.java

kind regards

Tobias

Am 04.12.15 um 16:08 schrieb Maxim Solodovnik:

unfortunately I was unable to test it or participate in discussion :(
will try it in next available snapshot :)

On Tue, Dec 1, 2015 at 2:17 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:


Hi Martin :-D,

and here it is:

https://github.com/apache/wicket/pull/143

kind regards

Tobias

Am 30.11.15 um 21:00 schrieb Martin Grigorov:

Hi,

On Nov 30, 2015 4:21 PM, "Sebastien"  wrote:


Hi Tobias,

As I stated, I would prefer 2 different models so :
- the main model is used for "src"
- the model is not itself an array of models (I don't recall there is a
such case elsewhere in Wicket)
- it is easier to handle the CPM case

As the other devs are now back from week-end, it would be nice to have


some


other opinions! :)


I usually wait for the PR to be able to comment on the changes.


https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java

There is no commenting functionality in such links.

I could comment on the original commits but:
1) I have to find them
2) no one else (but Tobias) will see my comments

Thanks & best regards,

Sebastien.


On Sat, Nov 28, 2015 at 8:10 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

Hi Sebastien,

thanks for testing :-)

I thought it would be nice to get all models by the default WebComponent
method and that they are all stored as defaultmodelobject.

WDTY?

Anyway it would safe 2 methods.

kind regards

Tobias



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







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



Re: Image based on external url model object

2015-11-30 Thread Sven Meier

Hi,

> the main model is used for "src"

+1, IMHO this is the main usage for this component.

> the model is not itself an array of models

Yeah, that's strange. Why not a separate component for  tags?

Regards
Sven



On 30.11.2015 15:05, Sebastien wrote:

Hi Tobias,

As I stated, I would prefer 2 different models so :
- the main model is used for "src"
- the model is not itself an array of models (I don't recall there is a
such case elsewhere in Wicket)
- it is easier to handle the CPM case

As the other devs are now back from week-end, it would be nice to have some
other opinions! :)

https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java

Thanks & best regards,
Sebastien.


On Sat, Nov 28, 2015 at 8:10 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:


Hi Sebastien,

thanks for testing :-)

I thought it would be nice to get all models by the default WebComponent
method and that they are all stored as defaultmodelobject.

WDTY?

Anyway it would safe 2 methods.

kind regards

Tobias





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



Re: Image based on external url model object

2015-11-30 Thread Tobias Soloschenko
Hi,

there is a separate component for source - even in the current implementation. 
(The default image / default source)

Ok - then I am going to change the model to only contain the src information 
and add another method to get the models for srcset.

kind regards

Tobias

> Am 30.11.2015 um 16:04 schrieb Sven Meier :
> 
> Hi,
> 
> > the main model is used for "src"
> 
> +1, IMHO this is the main usage for this component.
> 
> > the model is not itself an array of models
> 
> Yeah, that's strange. Why not a separate component for  tags?
> 
> Regards
> Sven
> 
> 
> 
>> On 30.11.2015 15:05, Sebastien wrote:
>> Hi Tobias,
>> 
>> As I stated, I would prefer 2 different models so :
>> - the main model is used for "src"
>> - the model is not itself an array of models (I don't recall there is a
>> such case elsewhere in Wicket)
>> - it is easier to handle the CPM case
>> 
>> As the other devs are now back from week-end, it would be nice to have some
>> other opinions! :)
>> 
>> https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java
>> 
>> Thanks & best regards,
>> Sebastien.
>> 
>> 
>> On Sat, Nov 28, 2015 at 8:10 AM, Tobias Soloschenko <
>> tobiassolosche...@googlemail.com> wrote:
>> 
>>> Hi Sebastien,
>>> 
>>> thanks for testing :-)
>>> 
>>> I thought it would be nice to get all models by the default WebComponent
>>> method and that they are all stored as defaultmodelobject.
>>> 
>>> WDTY?
>>> 
>>> Anyway it would safe 2 methods.
>>> 
>>> kind regards
>>> 
>>> Tobias
>>> 
>> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 

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



Re: Image based on external url model object

2015-11-30 Thread Martin Grigorov
Hi,

On Nov 30, 2015 4:21 PM, "Sebastien"  wrote:
>
> Hi Tobias,
>
> As I stated, I would prefer 2 different models so :
> - the main model is used for "src"
> - the model is not itself an array of models (I don't recall there is a
> such case elsewhere in Wicket)
> - it is easier to handle the CPM case
>
> As the other devs are now back from week-end, it would be nice to have
some
> other opinions! :)

I usually wait for the PR to be able to comment on the changes.

>
>
https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java

There is no commenting functionality in such links.

I could comment on the original commits but:
1) I have to find them
2) no one else (but Tobias) will see my comments

>
> Thanks & best regards,
> Sebastien.
>
>
> On Sat, Nov 28, 2015 at 8:10 AM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> > Hi Sebastien,
> >
> > thanks for testing :-)
> >
> > I thought it would be nice to get all models by the default WebComponent
> > method and that they are all stored as defaultmodelobject.
> >
> > WDTY?
> >
> > Anyway it would safe 2 methods.
> >
> > kind regards
> >
> > Tobias
> >


Re: Image based on external url model object

2015-11-30 Thread Tobias Soloschenko

Hi Martin :-D,

and here it is:

https://github.com/apache/wicket/pull/143

kind regards

Tobias

Am 30.11.15 um 21:00 schrieb Martin Grigorov:

Hi,

On Nov 30, 2015 4:21 PM, "Sebastien"  wrote:

Hi Tobias,

As I stated, I would prefer 2 different models so :
- the main model is used for "src"
- the model is not itself an array of models (I don't recall there is a
such case elsewhere in Wicket)
- it is easier to handle the CPM case

As the other devs are now back from week-end, it would be nice to have

some

other opinions! :)

I usually wait for the PR to be able to comment on the changes.




https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java

There is no commenting functionality in such links.

I could comment on the original commits but:
1) I have to find them
2) no one else (but Tobias) will see my comments


Thanks & best regards,
Sebastien.


On Sat, Nov 28, 2015 at 8:10 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:


Hi Sebastien,

thanks for testing :-)

I thought it would be nice to get all models by the default WebComponent
method and that they are all stored as defaultmodelobject.

WDTY?

Anyway it would safe 2 methods.

kind regards

Tobias




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



Re: Image based on external url model object

2015-11-30 Thread Sebastien
Hi Tobias,

As I stated, I would prefer 2 different models so :
- the main model is used for "src"
- the model is not itself an array of models (I don't recall there is a
such case elsewhere in Wicket)
- it is easier to handle the CPM case

As the other devs are now back from week-end, it would be nice to have some
other opinions! :)

https://github.com/klopfdreh/wicket-components-playground/blob/master/wicket-components-playground/src/main/java/org/apache/wicket/markup/html/image/ExternalImage.java

Thanks & best regards,
Sebastien.


On Sat, Nov 28, 2015 at 8:10 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi Sebastien,
>
> thanks for testing :-)
>
> I thought it would be nice to get all models by the default WebComponent
> method and that they are all stored as defaultmodelobject.
>
> WDTY?
>
> Anyway it would safe 2 methods.
>
> kind regards
>
> Tobias
>


Re: Image based on external url model object

2015-11-27 Thread Sebastien
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(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  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 <
> tobiassolosche...@googlemail.com> 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.
>>
>>


Re: Image based on external url model object

2015-11-27 Thread Tobias Soloschenko
Hi Sebastien,

thanks for testing :-) 

I thought it would be nice to get all models by the default WebComponent method 
and that they are all stored as defaultmodelobject. 

WDTY?

Anyway it would safe 2 methods.

kind regards

Tobias

> Am 28.11.2015 um 01:15 schrieb Sebastien :
> 
> 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  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(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  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 <
>>> tobiassolosche...@googlemail.com> 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.
 
 

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



Re: Image based on external url model object

2015-11-27 Thread Sebastien
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  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(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  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 <
>> tobiassolosche...@googlemail.com> 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.
>>>
>>>


Re: Image based on external url model object

2015-11-24 Thread Sebastien
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 <
tobiassolosche...@googlemail.com> 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.
>
> Am 24.11.15 um 14:59 schrieb Sebastien:
>
> "new Image(String, IModel)" does not work with external urls and do
>> not support compound model :)
>>
>>
>> On Tue, Nov 24, 2015 at 2:29 PM, Martin Grigorov 
>> wrote:
>>
>> I am pretty sure "new Image(String, IModel)" was for such use
>>> case.
>>> Looking at the code in 6.x+ I don't see how it could work though.
>>> So it is either my mistake that it ever worked, or it has been broken at
>>> some point.
>>>
>>> I just want to avoid having more than one way to do the same thing. This
>>> will lead to confusion and bad reputation.
>>> I don't have time to investigate deeply the history of this right now.
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Tue, Nov 24, 2015 at 2:20 PM, Tobias Soloschenko <
>>> tobiassolosche...@googlemail.com> wrote:
>>>
>>> Good point - mhh but the issue here is that the information are not

>>> stored
>>>
 within the model Sebastien and Maxim wanted it to be - or am I wrong?

 kind regards

 Tobias

 Am 24.11.2015 um 14:11 schrieb Martin Grigorov :
>
> Hi,
>
> Just to make it a little bit confusing: have you considered "new
> Image("id", new UrlResourceReference("...")) ?
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> I finished it, yesterday.
>>
>> Going to push it this evening. (First to my repo and create a pull
>>
> request)

> kind regards
>>
>> Tobias
>>
>> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik <
>>>
>> solomax...@gmail.com
>>>
 :
>
>> Also thanks from me :)
>>>
>>> On Mon, Nov 23, 2015 at 9:17 PM, Sebastien 

>>> wrote:
>>>
 Thanks a million Tobias! :)

 On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:

 Hi,
>
> sounds good - I am going to change the ticket description soon and
>
 try

> to
>>
>>> implement it.
>
> kind regards
>
> Tobias
>
> Am 23.11.2015 um 15:45 schrieb Sebastien :
>>
>> Hi Tobias,
>>
>> Sorry for the late reply, busy day...
>>
>> Actually Image(String id, IModel model, String url) will not help
>>
> in
>>>
 this

> case, I need the url to be in the model, but external url doesn't
>>
> work

> with
>
>> Image... I was more thinking about an ExternalImage component
>>
>> Does it make sense to you?
>>
>> Thanks & best regards,
>> Sebastien.
>>
>>
>> On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
>> tobiassolosche...@googlemail.com> wrote:
>>
>> Hi,
>>>
>>> maybe we can extend the normal image and add a constructor
>>>
>> Image(String

> id, IModel model, String url) so that the url is used in the src
>>>
>> attribute
>
>> (like in MediaComponents)
>>>
>>> WDYT?
>>>
>>> kind regards
>>>
>>> Tobias
>>>
>>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <

>>> solomax...@gmail.com

> :
>>
>>> Actually I'm using "hacky" way:

 if (absolute) {
 profile.add(new
 WebMarkupContainer("img").add(AttributeModifier.append("alt",
 Application.getString(5L)), AttributeModifier.append("src",

>>> uri)));

> } else {
 profile.add(new Image("img", new

>>> ByteArrayResource("image/jpeg") {
>>>
 ..

 Would love to know if is there any better way

 On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
>
 wrote:

> Forgot to mention I've read the following wiki, but as it was a
>
 little

> bit
>>>
 old I 

Re: Image based on external url model object

2015-11-24 Thread Tobias Soloschenko

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.

Am 24.11.15 um 14:59 schrieb Sebastien:

"new Image(String, IModel)" does not work with external urls and do
not support compound model :)


On Tue, Nov 24, 2015 at 2:29 PM, Martin Grigorov 
wrote:


I am pretty sure "new Image(String, IModel)" was for such use case.
Looking at the code in 6.x+ I don't see how it could work though.
So it is either my mistake that it ever worked, or it has been broken at
some point.

I just want to avoid having more than one way to do the same thing. This
will lead to confusion and bad reputation.
I don't have time to investigate deeply the history of this right now.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Nov 24, 2015 at 2:20 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:


Good point - mhh but the issue here is that the information are not

stored

within the model Sebastien and Maxim wanted it to be - or am I wrong?

kind regards

Tobias


Am 24.11.2015 um 14:11 schrieb Martin Grigorov :

Hi,

Just to make it a little bit confusing: have you considered "new
Image("id", new UrlResourceReference("...")) ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:


I finished it, yesterday.

Going to push it this evening. (First to my repo and create a pull

request)

kind regards

Tobias


Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik <

solomax...@gmail.com

:

Also thanks from me :)


On Mon, Nov 23, 2015 at 9:17 PM, Sebastien 

wrote:

Thanks a million Tobias! :)

On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:


Hi,

sounds good - I am going to change the ticket description soon and

try

to

implement it.

kind regards

Tobias


Am 23.11.2015 um 15:45 schrieb Sebastien :

Hi Tobias,

Sorry for the late reply, busy day...

Actually Image(String id, IModel model, String url) will not help

in

this

case, I need the url to be in the model, but external url doesn't

work

with

Image... I was more thinking about an ExternalImage component

Does it make sense to you?

Thanks & best regards,
Sebastien.


On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:


Hi,

maybe we can extend the normal image and add a constructor

Image(String

id, IModel model, String url) so that the url is used in the src

attribute

(like in MediaComponents)

WDYT?

kind regards

Tobias


Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <

solomax...@gmail.com

:

Actually I'm using "hacky" way:

if (absolute) {
profile.add(new
WebMarkupContainer("img").add(AttributeModifier.append("alt",
Application.getString(5L)), AttributeModifier.append("src",

uri)));

} else {
profile.add(new Image("img", new

ByteArrayResource("image/jpeg") {

..

Would love to know if is there any better way


On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 

wrote:

Forgot to mention I've read the following wiki, but as it was a

little

bit

old I was wondering if there was nothing newer...

https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image



On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 

Re: Image based on external url model object

2015-11-24 Thread Maxim Solodovnik
Will try to check the code this week

On Tue, Nov 24, 2015 at 11:30 PM, Sebastien  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 <
> tobiassolosche...@googlemail.com> 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.
> >
> > Am 24.11.15 um 14:59 schrieb Sebastien:
> >
> > "new Image(String, IModel)" does not work with external urls and
> do
> >> not support compound model :)
> >>
> >>
> >> On Tue, Nov 24, 2015 at 2:29 PM, Martin Grigorov 
> >> wrote:
> >>
> >> I am pretty sure "new Image(String, IModel)" was for such use
> >>> case.
> >>> Looking at the code in 6.x+ I don't see how it could work though.
> >>> So it is either my mistake that it ever worked, or it has been broken
> at
> >>> some point.
> >>>
> >>> I just want to avoid having more than one way to do the same thing.
> This
> >>> will lead to confusion and bad reputation.
> >>> I don't have time to investigate deeply the history of this right now.
> >>>
> >>> Martin Grigorov
> >>> Wicket Training and Consulting
> >>> https://twitter.com/mtgrigorov
> >>>
> >>> On Tue, Nov 24, 2015 at 2:20 PM, Tobias Soloschenko <
> >>> tobiassolosche...@googlemail.com> wrote:
> >>>
> >>> Good point - mhh but the issue here is that the information are not
> 
> >>> stored
> >>>
>  within the model Sebastien and Maxim wanted it to be - or am I wrong?
> 
>  kind regards
> 
>  Tobias
> 
>  Am 24.11.2015 um 14:11 schrieb Martin Grigorov  >:
> >
> > Hi,
> >
> > Just to make it a little bit confusing: have you considered "new
> > Image("id", new UrlResourceReference("...")) ?
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> > I finished it, yesterday.
> >>
> >> Going to push it this evening. (First to my repo and create a pull
> >>
> > request)
> 
> > kind regards
> >>
> >> Tobias
> >>
> >> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik <
> >>>
> >> solomax...@gmail.com
> >>>
>  :
> >
> >> Also thanks from me :)
> >>>
> >>> On Mon, Nov 23, 2015 at 9:17 PM, Sebastien 
> 
> >>> wrote:
> >>>
>  Thanks a million Tobias! :)
> 
>  On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
>  tobiassolosche...@googlemail.com> wrote:
> 
>  Hi,
> >
> > sounds good - I am going to change the ticket description soon
> and
> >
>  try
> 
> > to
> >>
> >>> implement it.
> >
> > kind regards
> >
> > Tobias
> >
> > Am 23.11.2015 um 15:45 schrieb Sebastien :
> >>
> >> Hi Tobias,
> >>
> >> Sorry for the late reply, busy day...
> >>
> >> Actually Image(String id, IModel model, String url) will not
> help
> >>
> > in
> >>>
>  this
> 
> > case, I need the url to be in the model, but external url doesn't
> >>
> > work
> 
> > with
> >
> >> Image... I was more thinking about an ExternalImage
> component
> >>
> >> Does it make sense to you?
> >>
> >> Thanks & best regards,
> >> Sebastien.
> >>
> >>
> >> On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> >> tobiassolosche...@googlemail.com> wrote:
> >>
> >> Hi,
> >>>
> >>> maybe we can extend the normal image and add a constructor
> >>>
> >> Image(String
> 
> > id, IModel model, String url) so that the url is used in the src
> >>>
> >> attribute
> >
> >> (like in MediaComponents)
> >>>
> >>> WDYT?
> >>>
> >>> kind regards
> >>>
> >>> Tobias
> >>>
> >>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
> 
> >>> solomax...@gmail.com
> 
> > :
> >>
> >>> Actually I'm using "hacky" way:
> 
>  if (absolute) {
>  profile.add(new
>  WebMarkupContainer("img").add(AttributeModifier.append("alt",
>  Application.getString(5L)), AttributeModifier.append("src",
> 
> >>> uri)));
> 
> > } else {
>  

Re: Image based on external url model object

2015-11-24 Thread Tobias Soloschenko
Pre 6.x the model is not used, too.

kind regards

Tobias

> Am 24.11.2015 um 14:59 schrieb Sebastien :
> 
> "new Image(String, IModel)" does not work with external urls and do
> not support compound model :)
> 
> 
> On Tue, Nov 24, 2015 at 2:29 PM, Martin Grigorov 
> wrote:
> 
>> I am pretty sure "new Image(String, IModel)" was for such use case.
>> Looking at the code in 6.x+ I don't see how it could work though.
>> So it is either my mistake that it ever worked, or it has been broken at
>> some point.
>> 
>> I just want to avoid having more than one way to do the same thing. This
>> will lead to confusion and bad reputation.
>> I don't have time to investigate deeply the history of this right now.
>> 
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>> 
>> On Tue, Nov 24, 2015 at 2:20 PM, Tobias Soloschenko <
>> tobiassolosche...@googlemail.com> wrote:
>> 
>>> Good point - mhh but the issue here is that the information are not
>> stored
>>> within the model Sebastien and Maxim wanted it to be - or am I wrong?
>>> 
>>> kind regards
>>> 
>>> Tobias
>>> 
 Am 24.11.2015 um 14:11 schrieb Martin Grigorov :
 
 Hi,
 
 Just to make it a little bit confusing: have you considered "new
 Image("id", new UrlResourceReference("...")) ?
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:
 
> I finished it, yesterday.
> 
> Going to push it this evening. (First to my repo and create a pull
>>> request)
> 
> kind regards
> 
> Tobias
> 
>> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik <
>> solomax...@gmail.com
 :
>> 
>> Also thanks from me :)
>> 
>>> On Mon, Nov 23, 2015 at 9:17 PM, Sebastien 
>> wrote:
>>> 
>>> Thanks a million Tobias! :)
>>> 
>>> On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
>>> tobiassolosche...@googlemail.com> wrote:
>>> 
 Hi,
 
 sounds good - I am going to change the ticket description soon and
>>> try
> to
 implement it.
 
 kind regards
 
 Tobias
 
> Am 23.11.2015 um 15:45 schrieb Sebastien :
> 
> Hi Tobias,
> 
> Sorry for the late reply, busy day...
> 
> Actually Image(String id, IModel model, String url) will not help
>> in
>>> this
> case, I need the url to be in the model, but external url doesn't
>>> work
 with
> Image... I was more thinking about an ExternalImage component
> 
> Does it make sense to you?
> 
> Thanks & best regards,
> Sebastien.
> 
> 
> On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi,
>> 
>> maybe we can extend the normal image and add a constructor
>>> Image(String
>> id, IModel model, String url) so that the url is used in the src
 attribute
>> (like in MediaComponents)
>> 
>> WDYT?
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
>>> solomax...@gmail.com
> :
>>> 
>>> Actually I'm using "hacky" way:
>>> 
>>> if (absolute) {
>>> profile.add(new
>>> WebMarkupContainer("img").add(AttributeModifier.append("alt",
>>> Application.getString(5L)), AttributeModifier.append("src",
>>> uri)));
>>> } else {
>>> profile.add(new Image("img", new
>> ByteArrayResource("image/jpeg") {
>>> ..
>>> 
>>> Would love to know if is there any better way
>>> 
 On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
>>> wrote:
 
 Forgot to mention I've read the following wiki, but as it was a
>>> little
>> bit
 old I was wondering if there was nothing newer...
>> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
 
 
> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien >> 
 wrote:
> 
> Hi all,
> 
> I cannot find an Image component that could display an image
>>> from
>>> an
> *external* url, supplied by the model object. My use-case is
>>> that
> I
>> have
 a
> user object, which have a gravatarUrl property, and I would
>> like
> to
 do
> something like "this.add(new
>> ExternalImage("gravatarUrl"));"...
> 
> 

Re: Image based on external url model object

2015-11-24 Thread Tobias Soloschenko
I just looked into the Image impl. - the issue here is that the image resource 
automatically creates a resource reference if only the model is provided. It 
would be bad to change this behavior.

Anyway I am going to upload the two new components and may you can try / review 
it.

kind regards

Tobias

> Am 24.11.2015 um 14:59 schrieb Sebastien :
> 
> "new Image(String, IModel)" does not work with external urls and do
> not support compound model :)
> 
> 
> On Tue, Nov 24, 2015 at 2:29 PM, Martin Grigorov 
> wrote:
> 
>> I am pretty sure "new Image(String, IModel)" was for such use case.
>> Looking at the code in 6.x+ I don't see how it could work though.
>> So it is either my mistake that it ever worked, or it has been broken at
>> some point.
>> 
>> I just want to avoid having more than one way to do the same thing. This
>> will lead to confusion and bad reputation.
>> I don't have time to investigate deeply the history of this right now.
>> 
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>> 
>> On Tue, Nov 24, 2015 at 2:20 PM, Tobias Soloschenko <
>> tobiassolosche...@googlemail.com> wrote:
>> 
>>> Good point - mhh but the issue here is that the information are not
>> stored
>>> within the model Sebastien and Maxim wanted it to be - or am I wrong?
>>> 
>>> kind regards
>>> 
>>> Tobias
>>> 
 Am 24.11.2015 um 14:11 schrieb Martin Grigorov :
 
 Hi,
 
 Just to make it a little bit confusing: have you considered "new
 Image("id", new UrlResourceReference("...")) ?
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:
 
> I finished it, yesterday.
> 
> Going to push it this evening. (First to my repo and create a pull
>>> request)
> 
> kind regards
> 
> Tobias
> 
>> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik <
>> solomax...@gmail.com
 :
>> 
>> Also thanks from me :)
>> 
>>> On Mon, Nov 23, 2015 at 9:17 PM, Sebastien 
>> wrote:
>>> 
>>> Thanks a million Tobias! :)
>>> 
>>> On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
>>> tobiassolosche...@googlemail.com> wrote:
>>> 
 Hi,
 
 sounds good - I am going to change the ticket description soon and
>>> try
> to
 implement it.
 
 kind regards
 
 Tobias
 
> Am 23.11.2015 um 15:45 schrieb Sebastien :
> 
> Hi Tobias,
> 
> Sorry for the late reply, busy day...
> 
> Actually Image(String id, IModel model, String url) will not help
>> in
>>> this
> case, I need the url to be in the model, but external url doesn't
>>> work
 with
> Image... I was more thinking about an ExternalImage component
> 
> Does it make sense to you?
> 
> Thanks & best regards,
> Sebastien.
> 
> 
> On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi,
>> 
>> maybe we can extend the normal image and add a constructor
>>> Image(String
>> id, IModel model, String url) so that the url is used in the src
 attribute
>> (like in MediaComponents)
>> 
>> WDYT?
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
>>> solomax...@gmail.com
> :
>>> 
>>> Actually I'm using "hacky" way:
>>> 
>>> if (absolute) {
>>> profile.add(new
>>> WebMarkupContainer("img").add(AttributeModifier.append("alt",
>>> Application.getString(5L)), AttributeModifier.append("src",
>>> uri)));
>>> } else {
>>> profile.add(new Image("img", new
>> ByteArrayResource("image/jpeg") {
>>> ..
>>> 
>>> Would love to know if is there any better way
>>> 
 On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
>>> wrote:
 
 Forgot to mention I've read the following wiki, but as it was a
>>> little
>> bit
 old I was wondering if there was nothing newer...
>> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
 
 
> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien >> 
 wrote:
> 
> Hi all,
> 
> I cannot find an Image component that could display an image
>>> from
>>> an
> *external* url, supplied by the model object. My use-case is
>>> that
> I

Re: Image based on external url model object

2015-11-24 Thread Martin Grigorov
Hi,

Just to make it a little bit confusing: have you considered "new
Image("id", new UrlResourceReference("...")) ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> I finished it, yesterday.
>
> Going to push it this evening. (First to my repo and create a pull request)
>
> kind regards
>
> Tobias
>
> > Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik :
> >
> > Also thanks from me :)
> >
> >> On Mon, Nov 23, 2015 at 9:17 PM, Sebastien  wrote:
> >>
> >> Thanks a million Tobias! :)
> >>
> >> On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
> >> tobiassolosche...@googlemail.com> wrote:
> >>
> >>> Hi,
> >>>
> >>> sounds good - I am going to change the ticket description soon and try
> to
> >>> implement it.
> >>>
> >>> kind regards
> >>>
> >>> Tobias
> >>>
>  Am 23.11.2015 um 15:45 schrieb Sebastien :
> 
>  Hi Tobias,
> 
>  Sorry for the late reply, busy day...
> 
>  Actually Image(String id, IModel model, String url) will not help in
> >> this
>  case, I need the url to be in the model, but external url doesn't work
> >>> with
>  Image... I was more thinking about an ExternalImage component
> 
>  Does it make sense to you?
> 
>  Thanks & best regards,
>  Sebastien.
> 
> 
>  On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
>  tobiassolosche...@googlemail.com> wrote:
> 
> > Hi,
> >
> > maybe we can extend the normal image and add a constructor
> >> Image(String
> > id, IModel model, String url) so that the url is used in the src
> >>> attribute
> > (like in MediaComponents)
> >
> > WDYT?
> >
> > kind regards
> >
> > Tobias
> >
> >> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
> >> solomax...@gmail.com
>  :
> >>
> >> Actually I'm using "hacky" way:
> >>
> >> if (absolute) {
> >> profile.add(new
> >> WebMarkupContainer("img").add(AttributeModifier.append("alt",
> >> Application.getString(5L)), AttributeModifier.append("src", uri)));
> >> } else {
> >> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
> >> ..
> >>
> >> Would love to know if is there any better way
> >>
> >>> On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
> >> wrote:
> >>>
> >>> Forgot to mention I've read the following wiki, but as it was a
> >> little
> > bit
> >>> old I was wondering if there was nothing newer...
> >>
> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
> >>>
> >>>
>  On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 
> >>> wrote:
> 
>  Hi all,
> 
>  I cannot find an Image component that could display an image from
> >> an
>  *external* url, supplied by the model object. My use-case is that
> I
> > have
> >>> a
>  user object, which have a gravatarUrl property, and I would like
> to
> >>> do
>  something like "this.add(new ExternalImage("gravatarUrl"));"...
> 
>  Isn't there any component that actually exists which could do
> this?
> 
>  Many thanks in advance,
>  Sebastien
> >>
> >>
> >>
> >> --
> >> WBR
> >> Maxim aka solomax
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >>> For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Image based on external url model object

2015-11-24 Thread Martin Grigorov
I am pretty sure "new Image(String, IModel)" was for such use case.
Looking at the code in 6.x+ I don't see how it could work though.
So it is either my mistake that it ever worked, or it has been broken at
some point.

I just want to avoid having more than one way to do the same thing. This
will lead to confusion and bad reputation.
I don't have time to investigate deeply the history of this right now.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Nov 24, 2015 at 2:20 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Good point - mhh but the issue here is that the information are not stored
> within the model Sebastien and Maxim wanted it to be - or am I wrong?
>
> kind regards
>
> Tobias
>
> > Am 24.11.2015 um 14:11 schrieb Martin Grigorov :
> >
> > Hi,
> >
> > Just to make it a little bit confusing: have you considered "new
> > Image("id", new UrlResourceReference("...")) ?
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> I finished it, yesterday.
> >>
> >> Going to push it this evening. (First to my repo and create a pull
> request)
> >>
> >> kind regards
> >>
> >> Tobias
> >>
> >>> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik  >:
> >>>
> >>> Also thanks from me :)
> >>>
>  On Mon, Nov 23, 2015 at 9:17 PM, Sebastien  wrote:
> 
>  Thanks a million Tobias! :)
> 
>  On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
>  tobiassolosche...@googlemail.com> wrote:
> 
> > Hi,
> >
> > sounds good - I am going to change the ticket description soon and
> try
> >> to
> > implement it.
> >
> > kind regards
> >
> > Tobias
> >
> >> Am 23.11.2015 um 15:45 schrieb Sebastien :
> >>
> >> Hi Tobias,
> >>
> >> Sorry for the late reply, busy day...
> >>
> >> Actually Image(String id, IModel model, String url) will not help in
>  this
> >> case, I need the url to be in the model, but external url doesn't
> work
> > with
> >> Image... I was more thinking about an ExternalImage component
> >>
> >> Does it make sense to you?
> >>
> >> Thanks & best regards,
> >> Sebastien.
> >>
> >>
> >> On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> >> tobiassolosche...@googlemail.com> wrote:
> >>
> >>> Hi,
> >>>
> >>> maybe we can extend the normal image and add a constructor
>  Image(String
> >>> id, IModel model, String url) so that the url is used in the src
> > attribute
> >>> (like in MediaComponents)
> >>>
> >>> WDYT?
> >>>
> >>> kind regards
> >>>
> >>> Tobias
> >>>
>  Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
>  solomax...@gmail.com
> >> :
> 
>  Actually I'm using "hacky" way:
> 
>  if (absolute) {
>  profile.add(new
>  WebMarkupContainer("img").add(AttributeModifier.append("alt",
>  Application.getString(5L)), AttributeModifier.append("src",
> uri)));
>  } else {
>  profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
>  ..
> 
>  Would love to know if is there any better way
> 
> > On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
>  wrote:
> >
> > Forgot to mention I've read the following wiki, but as it was a
>  little
> >>> bit
> > old I was wondering if there was nothing newer...
> >>
> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
> >
> >
> >> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 
> > wrote:
> >>
> >> Hi all,
> >>
> >> I cannot find an Image component that could display an image
> from
>  an
> >> *external* url, supplied by the model object. My use-case is
> that
> >> I
> >>> have
> > a
> >> user object, which have a gravatarUrl property, and I would like
> >> to
> > do
> >> something like "this.add(new ExternalImage("gravatarUrl"));"...
> >>
> >> Isn't there any component that actually exists which could do
> >> this?
> >>
> >> Many thanks in advance,
> >> Sebastien
> 
> 
> 
>  --
>  WBR
>  Maxim aka solomax
> >>>
> >>>
> -
> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >>> For additional commands, e-mail: users-h...@wicket.apache.org
> >
> > -
> > To unsubscribe, 

Re: Image based on external url model object

2015-11-24 Thread Tobias Soloschenko
Good point - mhh but the issue here is that the information are not stored 
within the model Sebastien and Maxim wanted it to be - or am I wrong?

kind regards

Tobias

> Am 24.11.2015 um 14:11 schrieb Martin Grigorov :
> 
> Hi,
> 
> Just to make it a little bit confusing: have you considered "new
> Image("id", new UrlResourceReference("...")) ?
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> I finished it, yesterday.
>> 
>> Going to push it this evening. (First to my repo and create a pull request)
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik :
>>> 
>>> Also thanks from me :)
>>> 
 On Mon, Nov 23, 2015 at 9:17 PM, Sebastien  wrote:
 
 Thanks a million Tobias! :)
 
 On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:
 
> Hi,
> 
> sounds good - I am going to change the ticket description soon and try
>> to
> implement it.
> 
> kind regards
> 
> Tobias
> 
>> Am 23.11.2015 um 15:45 schrieb Sebastien :
>> 
>> Hi Tobias,
>> 
>> Sorry for the late reply, busy day...
>> 
>> Actually Image(String id, IModel model, String url) will not help in
 this
>> case, I need the url to be in the model, but external url doesn't work
> with
>> Image... I was more thinking about an ExternalImage component
>> 
>> Does it make sense to you?
>> 
>> Thanks & best regards,
>> Sebastien.
>> 
>> 
>> On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
>> tobiassolosche...@googlemail.com> wrote:
>> 
>>> Hi,
>>> 
>>> maybe we can extend the normal image and add a constructor
 Image(String
>>> id, IModel model, String url) so that the url is used in the src
> attribute
>>> (like in MediaComponents)
>>> 
>>> WDYT?
>>> 
>>> kind regards
>>> 
>>> Tobias
>>> 
 Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
 solomax...@gmail.com
>> :
 
 Actually I'm using "hacky" way:
 
 if (absolute) {
 profile.add(new
 WebMarkupContainer("img").add(AttributeModifier.append("alt",
 Application.getString(5L)), AttributeModifier.append("src", uri)));
 } else {
 profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
 ..
 
 Would love to know if is there any better way
 
> On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
 wrote:
> 
> Forgot to mention I've read the following wiki, but as it was a
 little
>>> bit
> old I was wondering if there was nothing newer...
>> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
> 
> 
>> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 
> wrote:
>> 
>> Hi all,
>> 
>> I cannot find an Image component that could display an image from
 an
>> *external* url, supplied by the model object. My use-case is that
>> I
>>> have
> a
>> user object, which have a gravatarUrl property, and I would like
>> to
> do
>> something like "this.add(new ExternalImage("gravatarUrl"));"...
>> 
>> Isn't there any component that actually exists which could do
>> this?
>> 
>> Many thanks in advance,
>> Sebastien
 
 
 
 --
 WBR
 Maxim aka solomax
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>>> 
>>> 
>>> 
>>> --
>>> WBR
>>> Maxim aka solomax
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 

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



Re: Image based on external url model object

2015-11-24 Thread Tobias Soloschenko
The default model is not used anywhere - even before the responsive image 
refactoring - in my first suggestion I wanted to improve Image that the model 
is read and set as src if no reference is given - in addition to that I wanted 
to add a constructor to also support srcset (also in the source class) e.g. 
IModel... srcSetModels.

But as we discussed in the ticket I build up two new components to not handle 
this in the normal Image class.

kind regards

Tobias

> Am 24.11.2015 um 14:29 schrieb Martin Grigorov :
> 
> I am pretty sure "new Image(String, IModel)" was for such use case.
> Looking at the code in 6.x+ I don't see how it could work though.
> So it is either my mistake that it ever worked, or it has been broken at
> some point.
> 
> I just want to avoid having more than one way to do the same thing. This
> will lead to confusion and bad reputation.
> I don't have time to investigate deeply the history of this right now.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Tue, Nov 24, 2015 at 2:20 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Good point - mhh but the issue here is that the information are not stored
>> within the model Sebastien and Maxim wanted it to be - or am I wrong?
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 24.11.2015 um 14:11 schrieb Martin Grigorov :
>>> 
>>> Hi,
>>> 
>>> Just to make it a little bit confusing: have you considered "new
>>> Image("id", new UrlResourceReference("...")) ?
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
>>> tobiassolosche...@googlemail.com> wrote:
>>> 
 I finished it, yesterday.
 
 Going to push it this evening. (First to my repo and create a pull
>> request)
 
 kind regards
 
 Tobias
 
> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik >> :
> 
> Also thanks from me :)
> 
>> On Mon, Nov 23, 2015 at 9:17 PM, Sebastien  wrote:
>> 
>> Thanks a million Tobias! :)
>> 
>> On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
>> tobiassolosche...@googlemail.com> wrote:
>> 
>>> Hi,
>>> 
>>> sounds good - I am going to change the ticket description soon and
>> try
 to
>>> implement it.
>>> 
>>> kind regards
>>> 
>>> Tobias
>>> 
 Am 23.11.2015 um 15:45 schrieb Sebastien :
 
 Hi Tobias,
 
 Sorry for the late reply, busy day...
 
 Actually Image(String id, IModel model, String url) will not help in
>> this
 case, I need the url to be in the model, but external url doesn't
>> work
>>> with
 Image... I was more thinking about an ExternalImage component
 
 Does it make sense to you?
 
 Thanks & best regards,
 Sebastien.
 
 
 On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:
 
> Hi,
> 
> maybe we can extend the normal image and add a constructor
>> Image(String
> id, IModel model, String url) so that the url is used in the src
>>> attribute
> (like in MediaComponents)
> 
> WDYT?
> 
> kind regards
> 
> Tobias
> 
>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
>> solomax...@gmail.com
 :
>> 
>> Actually I'm using "hacky" way:
>> 
>> if (absolute) {
>> profile.add(new
>> WebMarkupContainer("img").add(AttributeModifier.append("alt",
>> Application.getString(5L)), AttributeModifier.append("src",
>> uri)));
>> } else {
>> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
>> ..
>> 
>> Would love to know if is there any better way
>> 
>>> On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
>> wrote:
>>> 
>>> Forgot to mention I've read the following wiki, but as it was a
>> little
> bit
>>> old I was wondering if there was nothing newer...
>> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
>>> 
>>> 
 On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 
>>> wrote:
 
 Hi all,
 
 I cannot find an Image component that could display an image
>> from
>> an
 *external* url, supplied by the model object. My use-case is
>> that
 I
> have
>>> a
 user object, which have a gravatarUrl property, and I would like
 to
>>> do
 something like "this.add(new 

Re: Image based on external url model object

2015-11-24 Thread Tobias Soloschenko
I finished it, yesterday. 

Going to push it this evening. (First to my repo and create a pull request)

kind regards

Tobias

> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik :
> 
> Also thanks from me :)
> 
>> On Mon, Nov 23, 2015 at 9:17 PM, Sebastien  wrote:
>> 
>> Thanks a million Tobias! :)
>> 
>> On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
>> tobiassolosche...@googlemail.com> wrote:
>> 
>>> Hi,
>>> 
>>> sounds good - I am going to change the ticket description soon and try to
>>> implement it.
>>> 
>>> kind regards
>>> 
>>> Tobias
>>> 
 Am 23.11.2015 um 15:45 schrieb Sebastien :
 
 Hi Tobias,
 
 Sorry for the late reply, busy day...
 
 Actually Image(String id, IModel model, String url) will not help in
>> this
 case, I need the url to be in the model, but external url doesn't work
>>> with
 Image... I was more thinking about an ExternalImage component
 
 Does it make sense to you?
 
 Thanks & best regards,
 Sebastien.
 
 
 On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:
 
> Hi,
> 
> maybe we can extend the normal image and add a constructor
>> Image(String
> id, IModel model, String url) so that the url is used in the src
>>> attribute
> (like in MediaComponents)
> 
> WDYT?
> 
> kind regards
> 
> Tobias
> 
>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
>> solomax...@gmail.com
 :
>> 
>> Actually I'm using "hacky" way:
>> 
>> if (absolute) {
>> profile.add(new
>> WebMarkupContainer("img").add(AttributeModifier.append("alt",
>> Application.getString(5L)), AttributeModifier.append("src", uri)));
>> } else {
>> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
>> ..
>> 
>> Would love to know if is there any better way
>> 
>>> On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
>> wrote:
>>> 
>>> Forgot to mention I've read the following wiki, but as it was a
>> little
> bit
>>> old I was wondering if there was nothing newer...
>> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
>>> 
>>> 
 On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 
>>> wrote:
 
 Hi all,
 
 I cannot find an Image component that could display an image from
>> an
 *external* url, supplied by the model object. My use-case is that I
> have
>>> a
 user object, which have a gravatarUrl property, and I would like to
>>> do
 something like "this.add(new ExternalImage("gravatarUrl"));"...
 
 Isn't there any component that actually exists which could do this?
 
 Many thanks in advance,
 Sebastien
>> 
>> 
>> 
>> --
>> WBR
>> Maxim aka solomax
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 
> -- 
> WBR
> Maxim aka solomax

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



Re: Image based on external url model object

2015-11-24 Thread Sebastien
Hi Martin,

Yes, but UrlResourceReference does not work with/like a [compound]model...

Thanks & best regards,
Sebastien.


On Tue, Nov 24, 2015 at 2:11 PM, Martin Grigorov 
wrote:

> Hi,
>
> Just to make it a little bit confusing: have you considered "new
> Image("id", new UrlResourceReference("...")) ?
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> > I finished it, yesterday.
> >
> > Going to push it this evening. (First to my repo and create a pull
> request)
> >
> > kind regards
> >
> > Tobias
> >
> > > Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik  >:
> > >
> > > Also thanks from me :)
> > >
> > >> On Mon, Nov 23, 2015 at 9:17 PM, Sebastien  wrote:
> > >>
> > >> Thanks a million Tobias! :)
> > >>
> > >> On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
> > >> tobiassolosche...@googlemail.com> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> sounds good - I am going to change the ticket description soon and
> try
> > to
> > >>> implement it.
> > >>>
> > >>> kind regards
> > >>>
> > >>> Tobias
> > >>>
> >  Am 23.11.2015 um 15:45 schrieb Sebastien :
> > 
> >  Hi Tobias,
> > 
> >  Sorry for the late reply, busy day...
> > 
> >  Actually Image(String id, IModel model, String url) will not help in
> > >> this
> >  case, I need the url to be in the model, but external url doesn't
> work
> > >>> with
> >  Image... I was more thinking about an ExternalImage component
> > 
> >  Does it make sense to you?
> > 
> >  Thanks & best regards,
> >  Sebastien.
> > 
> > 
> >  On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> >  tobiassolosche...@googlemail.com> wrote:
> > 
> > > Hi,
> > >
> > > maybe we can extend the normal image and add a constructor
> > >> Image(String
> > > id, IModel model, String url) so that the url is used in the src
> > >>> attribute
> > > (like in MediaComponents)
> > >
> > > WDYT?
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > >> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
> > >> solomax...@gmail.com
> >  :
> > >>
> > >> Actually I'm using "hacky" way:
> > >>
> > >> if (absolute) {
> > >> profile.add(new
> > >> WebMarkupContainer("img").add(AttributeModifier.append("alt",
> > >> Application.getString(5L)), AttributeModifier.append("src",
> uri)));
> > >> } else {
> > >> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
> > >> ..
> > >>
> > >> Would love to know if is there any better way
> > >>
> > >>> On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
> > >> wrote:
> > >>>
> > >>> Forgot to mention I've read the following wiki, but as it was a
> > >> little
> > > bit
> > >>> old I was wondering if there was nothing newer...
> > >>
> >
> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
> > >>>
> > >>>
> >  On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 
> > >>> wrote:
> > 
> >  Hi all,
> > 
> >  I cannot find an Image component that could display an image
> from
> > >> an
> >  *external* url, supplied by the model object. My use-case is
> that
> > I
> > > have
> > >>> a
> >  user object, which have a gravatarUrl property, and I would like
> > to
> > >>> do
> >  something like "this.add(new ExternalImage("gravatarUrl"));"...
> > 
> >  Isn't there any component that actually exists which could do
> > this?
> > 
> >  Many thanks in advance,
> >  Sebastien
> > >>
> > >>
> > >>
> > >> --
> > >> WBR
> > >> Maxim aka solomax
> > >
> > >
> -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >>>
> > >>> -
> > >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > >>> For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>


Re: Image based on external url model object

2015-11-24 Thread Sebastien
"new Image(String, IModel)" does not work with external urls and do
not support compound model :)


On Tue, Nov 24, 2015 at 2:29 PM, Martin Grigorov 
wrote:

> I am pretty sure "new Image(String, IModel)" was for such use case.
> Looking at the code in 6.x+ I don't see how it could work though.
> So it is either my mistake that it ever worked, or it has been broken at
> some point.
>
> I just want to avoid having more than one way to do the same thing. This
> will lead to confusion and bad reputation.
> I don't have time to investigate deeply the history of this right now.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Nov 24, 2015 at 2:20 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> > Good point - mhh but the issue here is that the information are not
> stored
> > within the model Sebastien and Maxim wanted it to be - or am I wrong?
> >
> > kind regards
> >
> > Tobias
> >
> > > Am 24.11.2015 um 14:11 schrieb Martin Grigorov :
> > >
> > > Hi,
> > >
> > > Just to make it a little bit confusing: have you considered "new
> > > Image("id", new UrlResourceReference("...")) ?
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Tue, Nov 24, 2015 at 1:43 PM, Tobias Soloschenko <
> > > tobiassolosche...@googlemail.com> wrote:
> > >
> > >> I finished it, yesterday.
> > >>
> > >> Going to push it this evening. (First to my repo and create a pull
> > request)
> > >>
> > >> kind regards
> > >>
> > >> Tobias
> > >>
> > >>> Am 24.11.2015 um 03:31 schrieb Maxim Solodovnik <
> solomax...@gmail.com
> > >:
> > >>>
> > >>> Also thanks from me :)
> > >>>
> >  On Mon, Nov 23, 2015 at 9:17 PM, Sebastien 
> wrote:
> > 
> >  Thanks a million Tobias! :)
> > 
> >  On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
> >  tobiassolosche...@googlemail.com> wrote:
> > 
> > > Hi,
> > >
> > > sounds good - I am going to change the ticket description soon and
> > try
> > >> to
> > > implement it.
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > >> Am 23.11.2015 um 15:45 schrieb Sebastien :
> > >>
> > >> Hi Tobias,
> > >>
> > >> Sorry for the late reply, busy day...
> > >>
> > >> Actually Image(String id, IModel model, String url) will not help
> in
> >  this
> > >> case, I need the url to be in the model, but external url doesn't
> > work
> > > with
> > >> Image... I was more thinking about an ExternalImage component
> > >>
> > >> Does it make sense to you?
> > >>
> > >> Thanks & best regards,
> > >> Sebastien.
> > >>
> > >>
> > >> On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> > >> tobiassolosche...@googlemail.com> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> maybe we can extend the normal image and add a constructor
> >  Image(String
> > >>> id, IModel model, String url) so that the url is used in the src
> > > attribute
> > >>> (like in MediaComponents)
> > >>>
> > >>> WDYT?
> > >>>
> > >>> kind regards
> > >>>
> > >>> Tobias
> > >>>
> >  Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
> >  solomax...@gmail.com
> > >> :
> > 
> >  Actually I'm using "hacky" way:
> > 
> >  if (absolute) {
> >  profile.add(new
> >  WebMarkupContainer("img").add(AttributeModifier.append("alt",
> >  Application.getString(5L)), AttributeModifier.append("src",
> > uri)));
> >  } else {
> >  profile.add(new Image("img", new
> ByteArrayResource("image/jpeg") {
> >  ..
> > 
> >  Would love to know if is there any better way
> > 
> > > On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
> >  wrote:
> > >
> > > Forgot to mention I've read the following wiki, but as it was a
> >  little
> > >>> bit
> > > old I was wondering if there was nothing newer...
> > >>
> >
> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
> > >
> > >
> > >> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien  >
> > > wrote:
> > >>
> > >> Hi all,
> > >>
> > >> I cannot find an Image component that could display an image
> > from
> >  an
> > >> *external* url, supplied by the model object. My use-case is
> > that
> > >> I
> > >>> have
> > > a
> > >> user object, which have a gravatarUrl property, and I would
> like
> > >> to
> > > do
> > >> something like "this.add(new
> ExternalImage("gravatarUrl"));"...
> > >>
> > >> Isn't there any component that actually exists which could do
> > >> this?
> > 

Re: Image based on external url model object

2015-11-23 Thread Tobias Soloschenko
https://issues.apache.org/jira/plugins/servlet/mobile#issue/WICKET-6042

kind regards

Tobias

> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik :
> 
> Actually I'm using "hacky" way:
> 
> if (absolute) {
> profile.add(new
> WebMarkupContainer("img").add(AttributeModifier.append("alt",
> Application.getString(5L)), AttributeModifier.append("src", uri)));
> } else {
> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
> ..
> 
> Would love to know if is there any better way
> 
>> On Mon, Nov 23, 2015 at 4:34 AM, Sebastien  wrote:
>> 
>> Forgot to mention I've read the following wiki, but as it was a little bit
>> old I was wondering if there was nothing newer...
>> 
>> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
>> 
>> 
>>> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien  wrote:
>>> 
>>> Hi all,
>>> 
>>> I cannot find an Image component that could display an image from an
>>> *external* url, supplied by the model object. My use-case is that I have
>> a
>>> user object, which have a gravatarUrl property, and I would like to do
>>> something like "this.add(new ExternalImage("gravatarUrl"));"...
>>> 
>>> Isn't there any component that actually exists which could do this?
>>> 
>>> Many thanks in advance,
>>> Sebastien
> 
> 
> 
> -- 
> WBR
> Maxim aka solomax

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



Re: Image based on external url model object

2015-11-23 Thread Maxim Solodovnik
Also thanks from me :)

On Mon, Nov 23, 2015 at 9:17 PM, Sebastien  wrote:

> Thanks a million Tobias! :)
>
> On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> > Hi,
> >
> > sounds good - I am going to change the ticket description soon and try to
> > implement it.
> >
> > kind regards
> >
> > Tobias
> >
> > > Am 23.11.2015 um 15:45 schrieb Sebastien :
> > >
> > > Hi Tobias,
> > >
> > > Sorry for the late reply, busy day...
> > >
> > > Actually Image(String id, IModel model, String url) will not help in
> this
> > > case, I need the url to be in the model, but external url doesn't work
> > with
> > > Image... I was more thinking about an ExternalImage component
> > >
> > > Does it make sense to you?
> > >
> > > Thanks & best regards,
> > > Sebastien.
> > >
> > >
> > > On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> > > tobiassolosche...@googlemail.com> wrote:
> > >
> > >> Hi,
> > >>
> > >> maybe we can extend the normal image and add a constructor
> Image(String
> > >> id, IModel model, String url) so that the url is used in the src
> > attribute
> > >> (like in MediaComponents)
> > >>
> > >> WDYT?
> > >>
> > >> kind regards
> > >>
> > >> Tobias
> > >>
> > >>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik <
> solomax...@gmail.com
> > >:
> > >>>
> > >>> Actually I'm using "hacky" way:
> > >>>
> > >>> if (absolute) {
> > >>> profile.add(new
> > >>> WebMarkupContainer("img").add(AttributeModifier.append("alt",
> > >>> Application.getString(5L)), AttributeModifier.append("src", uri)));
> > >>> } else {
> > >>> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
> > >>> ..
> > >>>
> > >>> Would love to know if is there any better way
> > >>>
> >  On Mon, Nov 23, 2015 at 4:34 AM, Sebastien 
> wrote:
> > 
> >  Forgot to mention I've read the following wiki, but as it was a
> little
> > >> bit
> >  old I was wondering if there was nothing newer...
> > >>
> >
> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
> > 
> > 
> > > On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 
> > wrote:
> > >
> > > Hi all,
> > >
> > > I cannot find an Image component that could display an image from
> an
> > > *external* url, supplied by the model object. My use-case is that I
> > >> have
> >  a
> > > user object, which have a gravatarUrl property, and I would like to
> > do
> > > something like "this.add(new ExternalImage("gravatarUrl"));"...
> > >
> > > Isn't there any component that actually exists which could do this?
> > >
> > > Many thanks in advance,
> > > Sebastien
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> WBR
> > >>> Maxim aka solomax
> > >>
> > >> -
> > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > >> For additional commands, e-mail: users-h...@wicket.apache.org
> > >>
> > >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>



-- 
WBR
Maxim aka solomax


Re: Image based on external url model object

2015-11-23 Thread Sebastien
Thanks a million Tobias! :)

On Mon, Nov 23, 2015 at 4:09 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> sounds good - I am going to change the ticket description soon and try to
> implement it.
>
> kind regards
>
> Tobias
>
> > Am 23.11.2015 um 15:45 schrieb Sebastien :
> >
> > Hi Tobias,
> >
> > Sorry for the late reply, busy day...
> >
> > Actually Image(String id, IModel model, String url) will not help in this
> > case, I need the url to be in the model, but external url doesn't work
> with
> > Image... I was more thinking about an ExternalImage component
> >
> > Does it make sense to you?
> >
> > Thanks & best regards,
> > Sebastien.
> >
> >
> > On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> maybe we can extend the normal image and add a constructor Image(String
> >> id, IModel model, String url) so that the url is used in the src
> attribute
> >> (like in MediaComponents)
> >>
> >> WDYT?
> >>
> >> kind regards
> >>
> >> Tobias
> >>
> >>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik  >:
> >>>
> >>> Actually I'm using "hacky" way:
> >>>
> >>> if (absolute) {
> >>> profile.add(new
> >>> WebMarkupContainer("img").add(AttributeModifier.append("alt",
> >>> Application.getString(5L)), AttributeModifier.append("src", uri)));
> >>> } else {
> >>> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
> >>> ..
> >>>
> >>> Would love to know if is there any better way
> >>>
>  On Mon, Nov 23, 2015 at 4:34 AM, Sebastien  wrote:
> 
>  Forgot to mention I've read the following wiki, but as it was a little
> >> bit
>  old I was wondering if there was nothing newer...
> >>
> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
> 
> 
> > On Sun, Nov 22, 2015 at 11:31 PM, Sebastien 
> wrote:
> >
> > Hi all,
> >
> > I cannot find an Image component that could display an image from an
> > *external* url, supplied by the model object. My use-case is that I
> >> have
>  a
> > user object, which have a gravatarUrl property, and I would like to
> do
> > something like "this.add(new ExternalImage("gravatarUrl"));"...
> >
> > Isn't there any component that actually exists which could do this?
> >
> > Many thanks in advance,
> > Sebastien
> >>>
> >>>
> >>>
> >>> --
> >>> WBR
> >>> Maxim aka solomax
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Image based on external url model object

2015-11-23 Thread Sebastien
Hi Tobias,

Sorry for the late reply, busy day...

Actually Image(String id, IModel model, String url) will not help in this
case, I need the url to be in the model, but external url doesn't work with
Image... I was more thinking about an ExternalImage component

Does it make sense to you?

Thanks & best regards,
Sebastien.


On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> maybe we can extend the normal image and add a constructor Image(String
> id, IModel model, String url) so that the url is used in the src attribute
> (like in MediaComponents)
>
> WDYT?
>
> kind regards
>
> Tobias
>
> > Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik :
> >
> > Actually I'm using "hacky" way:
> >
> > if (absolute) {
> > profile.add(new
> > WebMarkupContainer("img").add(AttributeModifier.append("alt",
> > Application.getString(5L)), AttributeModifier.append("src", uri)));
> > } else {
> > profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
> > ..
> >
> > Would love to know if is there any better way
> >
> >> On Mon, Nov 23, 2015 at 4:34 AM, Sebastien  wrote:
> >>
> >> Forgot to mention I've read the following wiki, but as it was a little
> bit
> >> old I was wondering if there was nothing newer...
> >>
> >>
> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
> >>
> >>
> >>> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien  wrote:
> >>>
> >>> Hi all,
> >>>
> >>> I cannot find an Image component that could display an image from an
> >>> *external* url, supplied by the model object. My use-case is that I
> have
> >> a
> >>> user object, which have a gravatarUrl property, and I would like to do
> >>> something like "this.add(new ExternalImage("gravatarUrl"));"...
> >>>
> >>> Isn't there any component that actually exists which could do this?
> >>>
> >>> Many thanks in advance,
> >>> Sebastien
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Image based on external url model object

2015-11-23 Thread Tobias Soloschenko
Hi,

sounds good - I am going to change the ticket description soon and try to 
implement it.

kind regards

Tobias

> Am 23.11.2015 um 15:45 schrieb Sebastien :
> 
> Hi Tobias,
> 
> Sorry for the late reply, busy day...
> 
> Actually Image(String id, IModel model, String url) will not help in this
> case, I need the url to be in the model, but external url doesn't work with
> Image... I was more thinking about an ExternalImage component
> 
> Does it make sense to you?
> 
> Thanks & best regards,
> Sebastien.
> 
> 
> On Mon, Nov 23, 2015 at 6:05 AM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi,
>> 
>> maybe we can extend the normal image and add a constructor Image(String
>> id, IModel model, String url) so that the url is used in the src attribute
>> (like in MediaComponents)
>> 
>> WDYT?
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik :
>>> 
>>> Actually I'm using "hacky" way:
>>> 
>>> if (absolute) {
>>> profile.add(new
>>> WebMarkupContainer("img").add(AttributeModifier.append("alt",
>>> Application.getString(5L)), AttributeModifier.append("src", uri)));
>>> } else {
>>> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
>>> ..
>>> 
>>> Would love to know if is there any better way
>>> 
 On Mon, Nov 23, 2015 at 4:34 AM, Sebastien  wrote:
 
 Forgot to mention I've read the following wiki, but as it was a little
>> bit
 old I was wondering if there was nothing newer...
>> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
 
 
> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien  wrote:
> 
> Hi all,
> 
> I cannot find an Image component that could display an image from an
> *external* url, supplied by the model object. My use-case is that I
>> have
 a
> user object, which have a gravatarUrl property, and I would like to do
> something like "this.add(new ExternalImage("gravatarUrl"));"...
> 
> Isn't there any component that actually exists which could do this?
> 
> Many thanks in advance,
> Sebastien
>>> 
>>> 
>>> 
>>> --
>>> WBR
>>> Maxim aka solomax
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 

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



Re: Image based on external url model object

2015-11-22 Thread Maxim Solodovnik
Actually I'm using "hacky" way:

if (absolute) {
profile.add(new
WebMarkupContainer("img").add(AttributeModifier.append("alt",
Application.getString(5L)), AttributeModifier.append("src", uri)));
} else {
profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
..

Would love to know if is there any better way

On Mon, Nov 23, 2015 at 4:34 AM, Sebastien  wrote:

> Forgot to mention I've read the following wiki, but as it was a little bit
> old I was wondering if there was nothing newer...
>
> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
>
>
> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien  wrote:
>
> > Hi all,
> >
> > I cannot find an Image component that could display an image from an
> > *external* url, supplied by the model object. My use-case is that I have
> a
> > user object, which have a gravatarUrl property, and I would like to do
> > something like "this.add(new ExternalImage("gravatarUrl"));"...
> >
> > Isn't there any component that actually exists which could do this?
> >
> > Many thanks in advance,
> > Sebastien
> >
> >
>



-- 
WBR
Maxim aka solomax


Re: Image based on external url model object

2015-11-22 Thread Tobias Soloschenko
Hi,

maybe we can extend the normal image and add a constructor Image(String id, 
IModel model, String url) so that the url is used in the src attribute (like in 
MediaComponents)

WDYT?

kind regards

Tobias

> Am 23.11.2015 um 03:45 schrieb Maxim Solodovnik :
> 
> Actually I'm using "hacky" way:
> 
> if (absolute) {
> profile.add(new
> WebMarkupContainer("img").add(AttributeModifier.append("alt",
> Application.getString(5L)), AttributeModifier.append("src", uri)));
> } else {
> profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
> ..
> 
> Would love to know if is there any better way
> 
>> On Mon, Nov 23, 2015 at 4:34 AM, Sebastien  wrote:
>> 
>> Forgot to mention I've read the following wiki, but as it was a little bit
>> old I was wondering if there was nothing newer...
>> 
>> https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image
>> 
>> 
>>> On Sun, Nov 22, 2015 at 11:31 PM, Sebastien  wrote:
>>> 
>>> Hi all,
>>> 
>>> I cannot find an Image component that could display an image from an
>>> *external* url, supplied by the model object. My use-case is that I have
>> a
>>> user object, which have a gravatarUrl property, and I would like to do
>>> something like "this.add(new ExternalImage("gravatarUrl"));"...
>>> 
>>> Isn't there any component that actually exists which could do this?
>>> 
>>> Many thanks in advance,
>>> Sebastien
> 
> 
> 
> -- 
> WBR
> Maxim aka solomax

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



Re: Image based on external url model object

2015-11-22 Thread Sebastien
Forgot to mention I've read the following wiki, but as it was a little bit
old I was wondering if there was nothing newer...
https://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image


On Sun, Nov 22, 2015 at 11:31 PM, Sebastien  wrote:

> Hi all,
>
> I cannot find an Image component that could display an image from an
> *external* url, supplied by the model object. My use-case is that I have a
> user object, which have a gravatarUrl property, and I would like to do
> something like "this.add(new ExternalImage("gravatarUrl"));"...
>
> Isn't there any component that actually exists which could do this?
>
> Many thanks in advance,
> Sebastien
>
>


Image based on external url model object

2015-11-22 Thread Sebastien
Hi all,

I cannot find an Image component that could display an image from an
*external* url, supplied by the model object. My use-case is that I have a
user object, which have a gravatarUrl property, and I would like to do
something like "this.add(new ExternalImage("gravatarUrl"));"...

Isn't there any component that actually exists which could do this?

Many thanks in advance,
Sebastien