You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Altuğ B. Altıntaş" <al...@gmail.com> on 2009/09/04 00:57:36 UTC
WebMarkupContainer Ajax update problem
Hi ;
In Panel I have a AjaxButton
In that AjaxButton, I tried to update the background (Parent Pages's
WebMarkupContainer). Here is the simplified code :
AjaxButton vote = new AjaxButton("Vote") {
@Override
protected void onSubmit(AjaxRequestTarget target,
Form<?> form) {
.........
WebMarkupContainer content = (WebMarkupContainer)
super.findPage().get("Content");
content.add(new SimpleAttributeModifier("id",
"content_selected")) ;
target.addComponent(content);
}
....
Also I set WebMarkupContainer.setOutputMarkupId(true); in my parent page
Any suggestions ?
Thanks.
--
Altuğ.
Re: WebMarkupContainer Ajax update problem
Posted by "Altuğ B. Altıntaş" <al...@gmail.com>.
I replaced "Id" with "class" and it worked !
Thanks.
2009/9/4 Jeremy Thomerson <je...@wickettraining.com>
> I'm not sure you can change the ID of an element in an Ajax request.
> Wicket
> depends on the ID to do component replacement. Try using a class instead.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Thu, Sep 3, 2009 at 5:57 PM, Altuğ B. Altıntaş <al...@gmail.com>
> wrote:
>
> > Hi ;
> >
> > In Panel I have a AjaxButton
> >
> > In that AjaxButton, I tried to update the background (Parent Pages's
> > WebMarkupContainer). Here is the simplified code :
> >
> > AjaxButton vote = new AjaxButton("Vote") {
> >
> > @Override
> > protected void onSubmit(AjaxRequestTarget target,
> > Form<?> form) {
> >
> > .........
> > WebMarkupContainer content = (WebMarkupContainer)
> > super.findPage().get("Content");
> > content.add(new SimpleAttributeModifier("id",
> > "content_selected")) ;
> > target.addComponent(content);
> > }
> > ....
> >
> > Also I set WebMarkupContainer.setOutputMarkupId(true); in my parent page
> >
> > Any suggestions ?
> >
> > Thanks.
> >
> > --
> > Altuğ.
> >
>
--
Altuğ.
Re: WebMarkupContainer Ajax update problem
Posted by Jeremy Thomerson <je...@wickettraining.com>.
I'm not sure you can change the ID of an element in an Ajax request. Wicket
depends on the ID to do component replacement. Try using a class instead.
--
Jeremy Thomerson
http://www.wickettraining.com
On Thu, Sep 3, 2009 at 5:57 PM, Altuğ B. Altıntaş <al...@gmail.com> wrote:
> Hi ;
>
> In Panel I have a AjaxButton
>
> In that AjaxButton, I tried to update the background (Parent Pages's
> WebMarkupContainer). Here is the simplified code :
>
> AjaxButton vote = new AjaxButton("Vote") {
>
> @Override
> protected void onSubmit(AjaxRequestTarget target,
> Form<?> form) {
>
> .........
> WebMarkupContainer content = (WebMarkupContainer)
> super.findPage().get("Content");
> content.add(new SimpleAttributeModifier("id",
> "content_selected")) ;
> target.addComponent(content);
> }
> ....
>
> Also I set WebMarkupContainer.setOutputMarkupId(true); in my parent page
>
> Any suggestions ?
>
> Thanks.
>
> --
> Altuğ.
>
RE: WebMarkupContainer Ajax update problem
Posted by Russell Simpkins <ru...@hotmail.com>.
Have you tried:
content..add(new SimpleAttributeModifier("style", "background-image=url(...)"));
I haven't done this, but you might also be able to do:
content.add(new SimpleAttributeModifier("class", "new-class-name"));
> Date: Fri, 4 Sep 2009 01:57:36 +0300
> Subject: WebMarkupContainer Ajax update problem
> From: altuga@gmail.com
> To: users@wicket.apache.org
>
> Hi ;
>
> In Panel I have a AjaxButton
>
> In that AjaxButton, I tried to update the background (Parent Pages's
> WebMarkupContainer). Here is the simplified code :
>
> AjaxButton vote = new AjaxButton("Vote") {
>
> @Override
> protected void onSubmit(AjaxRequestTarget target,
> Form<?> form) {
>
> .........
> WebMarkupContainer content = (WebMarkupContainer)
> super.findPage().get("Content");
> content.add(new SimpleAttributeModifier("id",
> "content_selected")) ;
> target.addComponent(content);
> }
> ....
>
> Also I set WebMarkupContainer.setOutputMarkupId(true); in my parent page
>
> Any suggestions ?
>
> Thanks.
>
> --
> Altuğ.
_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.windowslive.com/Desktop/PhotoGallery