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 > >

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:

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

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

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

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

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

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

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

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

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

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

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 < >

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

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

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

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

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:

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

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

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

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

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 >

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

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

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?

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)

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") { ..

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

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

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