Hello,

I'm trying to change the src of an image when the user clicking on a 
ajaxLink by this way :

On a panel, I have an icon and a text (a date using DateLabel from 
databinder).

When the user clicks on the link,the panel is refresh by :
public void onClick(AjaxRequestTarget target)
 {
         panel.setModel(new CompoundPropertyModel(photo));
         target.addComponent(panel);
 }

The date is refreshed. It's ok for the date. But the image doesn't change.

My Panel is built like that :

Photo photo = (Photo) getModelObject();

add(new DateLabel("date", "dd/MM/yyyy HH:mm"));

if(photo.getAlarm())
    add(new Image("alarm", "alarm.gif"));
else
      add(new Image("alarm", "blank.png"));

So, It can not work. I extended the CompoundPropertyModel to supply the 
correct filename to the Image component. So, the ajaxLink will work too. 
All will be ok. But It seems the Image doesn't use my model :(

The method onGetObject is called only for the date label.

Do you have any clue, tips or solution ? I think someone I had already 
to change images through ajax Link ? How did you do ?

Thanks by advance...

Robert

-- 
Robert JACOLIN
M2M
ANYWARE TECHNOLOGIES
Tél : +33 (0)5.61.00.06.56
Fax : +33 (0)5 61 00 51 46
www.anyware-tech.com



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to