You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alec Swan <al...@gmail.com> on 2010/02/06 18:56:14 UTC

Re: Ajax editable image @L

Juan's approach works, but I found myself reimplementing some of
AxajEditableLabel event-handling code.

So, I tried another approach where I create a panel with two fragments
"pictureFragment" and "uploadFragment". I then add an
AxajEditableLabel to the panel which would ideally override
newLabel(..) to return PictureFragment and override newEditor(..) to
return UploadFragment.

However, the problem is that the return types of these two methods are
not compatible with the Fragment class.

Is it possible to swap an image with an upload form using
AxajEditableLabel and Fragments?

Thanks,

Alec

On Fri, Jan 8, 2010 at 8:39 PM, Juan Carlos Garcia M.
<jc...@gmail.com> wrote:
>
> There isn't such component in wicket to achieve that, but it should be fairly
> easy to build i.e:
>
> 1-Having a Panel with the FileUpload that you want
> 2-Having a Panel with the image tag   that you want
> 3-Having a WebMarkup Container that act as a placeHolder for either 1 or 2
> at a given time.
>
> on you onClick behavior of the image panel you could call something like
> [ImagePanel.this.replaceWith(referenceOfFileUploadPanel)]
>
> To just Swap between panels, take a look at this
> http://pawelzubkiewicz.blogspot.com/2009/06/wicket-swapping-replacing-fragments.html
> example
>
> Hope you get the Idea
>
>
>
> alecswan1 wrote:
>>
>> I am using Wicket to implement an image component which behaves
>> similarly to AjaxEditableLabel.
>>
>> When the component is rendered it should look like a regular image
>>  .. . When the user clicks on the image, it should display
>> a file upload component which will allow the user to replace the
>> image.
>>
>> What is the easiest way to implement this behavior? Is there a
>> component that already does this? If not, which Wicket class should I
>> extend?
>>
>> Thanks,
>>
>> Alec
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Ajax-editable-image-%40L-tp27084451p27085401.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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