You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andrew Moore <an...@bigfoot.com> on 2007/12/05 13:17:14 UTC

Using ajax to update a panel

Hi, 
I've got a page, which includes a drop down choice box, and a panel (with a
list of images).

The drop down box holds an id (which ties back to a list of images), what
I'm wanting to be able to do is that if the user changes the drop down
choice, the panel refreshes via ajax with the new images.

Here's a few snippets of code:

-------------------------------------------------------------------------------------------------
//insert the image preview panel
final ImagePreviewPanel imagePreviewPanel = new
ImagePreviewPanel("imagePreviewPanel", generalPage.getImageCollectionId());
imagePreviewPanel.setOutputMarkupId(true);
form.add(imagePreviewPanel);
form.setOutputMarkupId(true);
		
//add the OnChange for the ajax call		
OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior(){
            protected void onUpdate(AjaxRequestTarget target) {
            	FormComponent fc = getFormComponent();
            	fc.getForm();
            	GeneralPage aGeneralPage = (GeneralPage)
fc.getForm().getModelObject();
                //get the drop down image collection id
            	if (aGeneralPage.getImageCollectionOption() != null){
            		String keyValue =
aGeneralPage.getImageCollectionOption().getKey();

            		imagePreviewPanel.setImageCollectionId(new
Long(aGeneralPage.getImageCollectionOption().getKey()));
            	}
                target.addComponent(imagePreviewPanel);
            }
        };

-------------------------------------------------------------------------------------------------

Then I've got the panel (which I've cut down on the details here to make it
a bit easier to understand)

-------------------------------------------------------------------------------------------------
public class ImagePreviewPanel extends Panel
{
	private Long imageCollectionId; 
	private String galleryCounterText = "";
	private List imageList = new ArrayList();
	
	public ImagePreviewPanel(final String componentId, Long
anImageCollectionId){
		super(componentId);
		//set up the instance variable from the constructor
		setImageCollectionId(anImageCollectionId);
		
		//now add the image previews
		//first get the images if there are any
		ImageCollection imageCollection =
imageCollectionDao.findByImageCollectionId(imageCollectionId);
		
		WebMarkupContainer dataImagecontainer = new
WebMarkupContainer("dataimage");
		dataImagecontainer.setOutputMarkupId(true);
	        add(dataImagecontainer);			
	
		//display the total number of images in the list	
        	galleryCounterText = imageCollection.getImages().size();
	        add(new Label("galleryCounter",new PropertyModel(this,
"galleryCounterText")).setOutputMarkupId(true));

		//get the collection of images from the imageCollection object        
	        imageList = imageCollection.getImages();
        
		final PageableListView imageView;
		dataImagecontainer.add(imageView = new PageableListView("galleryList", new
CompoundPropertyModel(imageList), 20){
			public void populateItem(final ListItem listItem){
				final Image image = (Image)listItem.getModelObject();
				
				//set up default image element description
				String imageElementDescription = new
StringResourceModel("noImageElementDescription", this, null).getString();
				
				//set up image element description if a better one exists
				StaticImage staticImage = new StaticImage("previewImage",
image.getImageHref());
				staticImage.setOutputMarkupId(true);
				listItem.add(staticImage);
			}
		});
		imageView.setOutputMarkupId(true);
	}


	public Long getImageCollectionId() {
		return imageCollectionId;
	}

	public void setImageCollectionId(Long imageCollectionId) {
		this.imageCollectionId = imageCollectionId;
	}
}




-------------------------------------------------------------------------------------------------
The only thing is, don't feel like I've got my head completely around the
wicket models and I'm having trouble working out what I need to do to the
page and panel to get the panel to refresh via ajax.

Sorry for the amount of code, but it's the only way I think to try and
describe what I've currently got.
Thanks
Andrew
-- 
View this message in context: http://www.nabble.com/Using-ajax-to-update-a-panel-tf4949239.html#a14170394
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


Re: Using ajax to update a panel

Posted by Igor Vaynberg <ig...@gmail.com>.
look at the markup that is transferred via ajax for your new panel in
the wicket ajax debug console. if the markup contains proper images
but doesnt show up look for javascript errors, if the markup contains
stale images then your models are simply not right yet - try to get
your page working without ajax first.

-igor


On Dec 5, 2007 4:17 AM, Andrew Moore <an...@bigfoot.com> wrote:
>
> Hi,
> I've got a page, which includes a drop down choice box, and a panel (with a
> list of images).
>
> The drop down box holds an id (which ties back to a list of images), what
> I'm wanting to be able to do is that if the user changes the drop down
> choice, the panel refreshes via ajax with the new images.
>
> Here's a few snippets of code:
>
> -------------------------------------------------------------------------------------------------
> //insert the image preview panel
> final ImagePreviewPanel imagePreviewPanel = new
> ImagePreviewPanel("imagePreviewPanel", generalPage.getImageCollectionId());
> imagePreviewPanel.setOutputMarkupId(true);
> form.add(imagePreviewPanel);
> form.setOutputMarkupId(true);
>
> //add the OnChange for the ajax call
> OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior(){
>             protected void onUpdate(AjaxRequestTarget target) {
>                 FormComponent fc = getFormComponent();
>                 fc.getForm();
>                 GeneralPage aGeneralPage = (GeneralPage)
> fc.getForm().getModelObject();
>                 //get the drop down image collection id
>                 if (aGeneralPage.getImageCollectionOption() != null){
>                         String keyValue =
> aGeneralPage.getImageCollectionOption().getKey();
>
>                         imagePreviewPanel.setImageCollectionId(new
> Long(aGeneralPage.getImageCollectionOption().getKey()));
>                 }
>                 target.addComponent(imagePreviewPanel);
>             }
>         };
>
> -------------------------------------------------------------------------------------------------
>
> Then I've got the panel (which I've cut down on the details here to make it
> a bit easier to understand)
>
> -------------------------------------------------------------------------------------------------
> public class ImagePreviewPanel extends Panel
> {
>         private Long imageCollectionId;
>         private String galleryCounterText = "";
>         private List imageList = new ArrayList();
>
>         public ImagePreviewPanel(final String componentId, Long
> anImageCollectionId){
>                 super(componentId);
>                 //set up the instance variable from the constructor
>                 setImageCollectionId(anImageCollectionId);
>
>                 //now add the image previews
>                 //first get the images if there are any
>                 ImageCollection imageCollection =
> imageCollectionDao.findByImageCollectionId(imageCollectionId);
>
>                 WebMarkupContainer dataImagecontainer = new
> WebMarkupContainer("dataimage");
>                 dataImagecontainer.setOutputMarkupId(true);
>                 add(dataImagecontainer);
>
>                 //display the total number of images in the list
>                 galleryCounterText = imageCollection.getImages().size();
>                 add(new Label("galleryCounter",new PropertyModel(this,
> "galleryCounterText")).setOutputMarkupId(true));
>
>                 //get the collection of images from the imageCollection object
>                 imageList = imageCollection.getImages();
>
>                 final PageableListView imageView;
>                 dataImagecontainer.add(imageView = new PageableListView("galleryList", new
> CompoundPropertyModel(imageList), 20){
>                         public void populateItem(final ListItem listItem){
>                                 final Image image = (Image)listItem.getModelObject();
>
>                                 //set up default image element description
>                                 String imageElementDescription = new
> StringResourceModel("noImageElementDescription", this, null).getString();
>
>                                 //set up image element description if a better one exists
>                                 StaticImage staticImage = new StaticImage("previewImage",
> image.getImageHref());
>                                 staticImage.setOutputMarkupId(true);
>                                 listItem.add(staticImage);
>                         }
>                 });
>                 imageView.setOutputMarkupId(true);
>         }
>
>
>         public Long getImageCollectionId() {
>                 return imageCollectionId;
>         }
>
>         public void setImageCollectionId(Long imageCollectionId) {
>                 this.imageCollectionId = imageCollectionId;
>         }
> }
>
>
>
>
> -------------------------------------------------------------------------------------------------
> The only thing is, don't feel like I've got my head completely around the
> wicket models and I'm having trouble working out what I need to do to the
> page and panel to get the panel to refresh via ajax.
>
> Sorry for the amount of code, but it's the only way I think to try and
> describe what I've currently got.
> Thanks
> Andrew
> --
> View this message in context: http://www.nabble.com/Using-ajax-to-update-a-panel-tf4949239.html#a14170394
> 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


Re: Using ajax to update a panel

Posted by Andrew Moore <an...@bigfoot.com>.
I finally managed to get it working using the replaceWith method to replace
the entire panel.

-- 
View this message in context: http://www.nabble.com/Using-ajax-to-update-a-panel-tf4949239.html#a14190250
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


Re: Using ajax to update a panel

Posted by wicket user <wi...@comley.org>.
is it not possible to post the whole page where you insert the
ImagePreviewPanel ? I don't need the HTML just the java side

On 05/12/2007, Andrew Moore <an...@bigfoot.com> wrote:
>
>
> The ajax stuff is firing (as I can see in the ajax debug window) but the
> panel does not get updated.
>
> I know I'm getting the id from the drop down and the ajax bit itself is
> fine
> as I can get the value of the drop down and append it to a test label on
> the
> form that's used to store the dropdown details.
>
> I think it's mostly my lack of understanding of what actually fires with
> the
> ajax call, as I need to be able to refresh the values from the database.
> Should I be creating a Model overriding the setObject to do this?
>
>
>
> wicket user wrote:
> >
> > Hi Andrew,
> >
> > So what's actually happening? Anything? Exceptions or does the image
> just
> > stay the same?
> >
> >
> >
> > On 05/12/2007, Andrew Moore <an...@bigfoot.com> wrote:
> >>
> >>
> >> Hi,
> >> I've got a page, which includes a drop down choice box, and a panel
> (with
> >> a
> >> list of images).
> >>
> >> The drop down box holds an id (which ties back to a list of images),
> what
> >> I'm wanting to be able to do is that if the user changes the drop down
> >> choice, the panel refreshes via ajax with the new images.
> >>
> >> Here's a few snippets of code:
> >>
> >>
> >>
> -------------------------------------------------------------------------------------------------
> >> //insert the image preview panel
> >> final ImagePreviewPanel imagePreviewPanel = new
> >> ImagePreviewPanel("imagePreviewPanel", generalPage.getImageCollectionId
> >> ());
> >> imagePreviewPanel.setOutputMarkupId(true);
> >> form.add(imagePreviewPanel);
> >> form.setOutputMarkupId(true);
> >>
> >> //add the OnChange for the ajax call
> >> OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior(){
> >>             protected void onUpdate(AjaxRequestTarget target) {
> >>                 FormComponent fc = getFormComponent();
> >>                 fc.getForm();
> >>                 GeneralPage aGeneralPage = (GeneralPage)
> >> fc.getForm().getModelObject();
> >>                 //get the drop down image collection id
> >>                 if (aGeneralPage.getImageCollectionOption() != null){
> >>                         String keyValue =
> >> aGeneralPage.getImageCollectionOption().getKey();
> >>
> >>                         imagePreviewPanel.setImageCollectionId(new
> >> Long(aGeneralPage.getImageCollectionOption().getKey()));
> >>                 }
> >>                 target.addComponent(imagePreviewPanel);
> >>             }
> >>         };
> >>
> >>
> >>
> -------------------------------------------------------------------------------------------------
> >>
> >> Then I've got the panel (which I've cut down on the details here to
> make
> >> it
> >> a bit easier to understand)
> >>
> >>
> >>
> -------------------------------------------------------------------------------------------------
> >> public class ImagePreviewPanel extends Panel
> >> {
> >>         private Long imageCollectionId;
> >>         private String galleryCounterText = "";
> >>         private List imageList = new ArrayList();
> >>
> >>         public ImagePreviewPanel(final String componentId, Long
> >> anImageCollectionId){
> >>                 super(componentId);
> >>                 //set up the instance variable from the constructor
> >>                 setImageCollectionId(anImageCollectionId);
> >>
> >>                 //now add the image previews
> >>                 //first get the images if there are any
> >>                 ImageCollection imageCollection =
> >> imageCollectionDao.findByImageCollectionId(imageCollectionId);
> >>
> >>                 WebMarkupContainer dataImagecontainer = new
> >> WebMarkupContainer("dataimage");
> >>                 dataImagecontainer.setOutputMarkupId(true);
> >>                 add(dataImagecontainer);
> >>
> >>                 //display the total number of images in the list
> >>                 galleryCounterText = imageCollection.getImages
> ().size();
> >>                 add(new Label("galleryCounter",new PropertyModel(this,
> >> "galleryCounterText")).setOutputMarkupId(true));
> >>
> >>                 //get the collection of images from the imageCollection
> >> object
> >>                 imageList = imageCollection.getImages();
> >>
> >>                 final PageableListView imageView;
> >>                 dataImagecontainer.add(imageView = new
> >> PageableListView("galleryList", new
> >> CompoundPropertyModel(imageList), 20){
> >>                         public void populateItem(final ListItem
> >> listItem){
> >>                                 final Image image =
> >> (Image)listItem.getModelObject();
> >>
> >>                                 //set up default image element
> >> description
> >>                                 String imageElementDescription = new
> >> StringResourceModel("noImageElementDescription", this,
> null).getString();
> >>
> >>                                 //set up image element description if a
> >> better one exists
> >>                                 StaticImage staticImage = new
> >> StaticImage("previewImage",
> >> image.getImageHref());
> >>                                 staticImage.setOutputMarkupId(true);
> >>                                 listItem.add(staticImage);
> >>                         }
> >>                 });
> >>                 imageView.setOutputMarkupId(true);
> >>         }
> >>
> >>
> >>         public Long getImageCollectionId() {
> >>                 return imageCollectionId;
> >>         }
> >>
> >>         public void setImageCollectionId(Long imageCollectionId) {
> >>                 this.imageCollectionId = imageCollectionId;
> >>         }
> >> }
> >>
> >>
> >>
> >>
> >>
> >>
> -------------------------------------------------------------------------------------------------
> >> The only thing is, don't feel like I've got my head completely around
> the
> >> wicket models and I'm having trouble working out what I need to do to
> the
> >> page and panel to get the panel to refresh via ajax.
> >>
> >> Sorry for the amount of code, but it's the only way I think to try and
> >> describe what I've currently got.
> >> Thanks
> >> Andrew
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Using-ajax-to-update-a-panel-tf4949239.html#a14170394
> >> 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
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Using-ajax-to-update-a-panel-tf4949239.html#a14171495
> 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
>
>

Re: Using ajax to update a panel

Posted by Andrew Moore <an...@bigfoot.com>.
The ajax stuff is firing (as I can see in the ajax debug window) but the
panel does not get updated.

I know I'm getting the id from the drop down and the ajax bit itself is fine
as I can get the value of the drop down and append it to a test label on the
form that's used to store the dropdown details.

I think it's mostly my lack of understanding of what actually fires with the
ajax call, as I need to be able to refresh the values from the database.
Should I be creating a Model overriding the setObject to do this?



wicket user wrote:
> 
> Hi Andrew,
> 
> So what's actually happening? Anything? Exceptions or does the image just
> stay the same?
> 
> 
> 
> On 05/12/2007, Andrew Moore <an...@bigfoot.com> wrote:
>>
>>
>> Hi,
>> I've got a page, which includes a drop down choice box, and a panel (with
>> a
>> list of images).
>>
>> The drop down box holds an id (which ties back to a list of images), what
>> I'm wanting to be able to do is that if the user changes the drop down
>> choice, the panel refreshes via ajax with the new images.
>>
>> Here's a few snippets of code:
>>
>>
>> -------------------------------------------------------------------------------------------------
>> //insert the image preview panel
>> final ImagePreviewPanel imagePreviewPanel = new
>> ImagePreviewPanel("imagePreviewPanel", generalPage.getImageCollectionId
>> ());
>> imagePreviewPanel.setOutputMarkupId(true);
>> form.add(imagePreviewPanel);
>> form.setOutputMarkupId(true);
>>
>> //add the OnChange for the ajax call
>> OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior(){
>>             protected void onUpdate(AjaxRequestTarget target) {
>>                 FormComponent fc = getFormComponent();
>>                 fc.getForm();
>>                 GeneralPage aGeneralPage = (GeneralPage)
>> fc.getForm().getModelObject();
>>                 //get the drop down image collection id
>>                 if (aGeneralPage.getImageCollectionOption() != null){
>>                         String keyValue =
>> aGeneralPage.getImageCollectionOption().getKey();
>>
>>                         imagePreviewPanel.setImageCollectionId(new
>> Long(aGeneralPage.getImageCollectionOption().getKey()));
>>                 }
>>                 target.addComponent(imagePreviewPanel);
>>             }
>>         };
>>
>>
>> -------------------------------------------------------------------------------------------------
>>
>> Then I've got the panel (which I've cut down on the details here to make
>> it
>> a bit easier to understand)
>>
>>
>> -------------------------------------------------------------------------------------------------
>> public class ImagePreviewPanel extends Panel
>> {
>>         private Long imageCollectionId;
>>         private String galleryCounterText = "";
>>         private List imageList = new ArrayList();
>>
>>         public ImagePreviewPanel(final String componentId, Long
>> anImageCollectionId){
>>                 super(componentId);
>>                 //set up the instance variable from the constructor
>>                 setImageCollectionId(anImageCollectionId);
>>
>>                 //now add the image previews
>>                 //first get the images if there are any
>>                 ImageCollection imageCollection =
>> imageCollectionDao.findByImageCollectionId(imageCollectionId);
>>
>>                 WebMarkupContainer dataImagecontainer = new
>> WebMarkupContainer("dataimage");
>>                 dataImagecontainer.setOutputMarkupId(true);
>>                 add(dataImagecontainer);
>>
>>                 //display the total number of images in the list
>>                 galleryCounterText = imageCollection.getImages().size();
>>                 add(new Label("galleryCounter",new PropertyModel(this,
>> "galleryCounterText")).setOutputMarkupId(true));
>>
>>                 //get the collection of images from the imageCollection
>> object
>>                 imageList = imageCollection.getImages();
>>
>>                 final PageableListView imageView;
>>                 dataImagecontainer.add(imageView = new
>> PageableListView("galleryList", new
>> CompoundPropertyModel(imageList), 20){
>>                         public void populateItem(final ListItem
>> listItem){
>>                                 final Image image =
>> (Image)listItem.getModelObject();
>>
>>                                 //set up default image element
>> description
>>                                 String imageElementDescription = new
>> StringResourceModel("noImageElementDescription", this, null).getString();
>>
>>                                 //set up image element description if a
>> better one exists
>>                                 StaticImage staticImage = new
>> StaticImage("previewImage",
>> image.getImageHref());
>>                                 staticImage.setOutputMarkupId(true);
>>                                 listItem.add(staticImage);
>>                         }
>>                 });
>>                 imageView.setOutputMarkupId(true);
>>         }
>>
>>
>>         public Long getImageCollectionId() {
>>                 return imageCollectionId;
>>         }
>>
>>         public void setImageCollectionId(Long imageCollectionId) {
>>                 this.imageCollectionId = imageCollectionId;
>>         }
>> }
>>
>>
>>
>>
>>
>> -------------------------------------------------------------------------------------------------
>> The only thing is, don't feel like I've got my head completely around the
>> wicket models and I'm having trouble working out what I need to do to the
>> page and panel to get the panel to refresh via ajax.
>>
>> Sorry for the amount of code, but it's the only way I think to try and
>> describe what I've currently got.
>> Thanks
>> Andrew
>> --
>> View this message in context:
>> http://www.nabble.com/Using-ajax-to-update-a-panel-tf4949239.html#a14170394
>> 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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-ajax-to-update-a-panel-tf4949239.html#a14171495
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


Re: Using ajax to update a panel

Posted by wicket user <wi...@comley.org>.
Hi Andrew,

So what's actually happening? Anything? Exceptions or does the image just
stay the same?



On 05/12/2007, Andrew Moore <an...@bigfoot.com> wrote:
>
>
> Hi,
> I've got a page, which includes a drop down choice box, and a panel (with
> a
> list of images).
>
> The drop down box holds an id (which ties back to a list of images), what
> I'm wanting to be able to do is that if the user changes the drop down
> choice, the panel refreshes via ajax with the new images.
>
> Here's a few snippets of code:
>
>
> -------------------------------------------------------------------------------------------------
> //insert the image preview panel
> final ImagePreviewPanel imagePreviewPanel = new
> ImagePreviewPanel("imagePreviewPanel", generalPage.getImageCollectionId
> ());
> imagePreviewPanel.setOutputMarkupId(true);
> form.add(imagePreviewPanel);
> form.setOutputMarkupId(true);
>
> //add the OnChange for the ajax call
> OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior(){
>             protected void onUpdate(AjaxRequestTarget target) {
>                 FormComponent fc = getFormComponent();
>                 fc.getForm();
>                 GeneralPage aGeneralPage = (GeneralPage)
> fc.getForm().getModelObject();
>                 //get the drop down image collection id
>                 if (aGeneralPage.getImageCollectionOption() != null){
>                         String keyValue =
> aGeneralPage.getImageCollectionOption().getKey();
>
>                         imagePreviewPanel.setImageCollectionId(new
> Long(aGeneralPage.getImageCollectionOption().getKey()));
>                 }
>                 target.addComponent(imagePreviewPanel);
>             }
>         };
>
>
> -------------------------------------------------------------------------------------------------
>
> Then I've got the panel (which I've cut down on the details here to make
> it
> a bit easier to understand)
>
>
> -------------------------------------------------------------------------------------------------
> public class ImagePreviewPanel extends Panel
> {
>         private Long imageCollectionId;
>         private String galleryCounterText = "";
>         private List imageList = new ArrayList();
>
>         public ImagePreviewPanel(final String componentId, Long
> anImageCollectionId){
>                 super(componentId);
>                 //set up the instance variable from the constructor
>                 setImageCollectionId(anImageCollectionId);
>
>                 //now add the image previews
>                 //first get the images if there are any
>                 ImageCollection imageCollection =
> imageCollectionDao.findByImageCollectionId(imageCollectionId);
>
>                 WebMarkupContainer dataImagecontainer = new
> WebMarkupContainer("dataimage");
>                 dataImagecontainer.setOutputMarkupId(true);
>                 add(dataImagecontainer);
>
>                 //display the total number of images in the list
>                 galleryCounterText = imageCollection.getImages().size();
>                 add(new Label("galleryCounter",new PropertyModel(this,
> "galleryCounterText")).setOutputMarkupId(true));
>
>                 //get the collection of images from the imageCollection
> object
>                 imageList = imageCollection.getImages();
>
>                 final PageableListView imageView;
>                 dataImagecontainer.add(imageView = new
> PageableListView("galleryList", new
> CompoundPropertyModel(imageList), 20){
>                         public void populateItem(final ListItem listItem){
>                                 final Image image =
> (Image)listItem.getModelObject();
>
>                                 //set up default image element description
>                                 String imageElementDescription = new
> StringResourceModel("noImageElementDescription", this, null).getString();
>
>                                 //set up image element description if a
> better one exists
>                                 StaticImage staticImage = new
> StaticImage("previewImage",
> image.getImageHref());
>                                 staticImage.setOutputMarkupId(true);
>                                 listItem.add(staticImage);
>                         }
>                 });
>                 imageView.setOutputMarkupId(true);
>         }
>
>
>         public Long getImageCollectionId() {
>                 return imageCollectionId;
>         }
>
>         public void setImageCollectionId(Long imageCollectionId) {
>                 this.imageCollectionId = imageCollectionId;
>         }
> }
>
>
>
>
>
> -------------------------------------------------------------------------------------------------
> The only thing is, don't feel like I've got my head completely around the
> wicket models and I'm having trouble working out what I need to do to the
> page and panel to get the panel to refresh via ajax.
>
> Sorry for the amount of code, but it's the only way I think to try and
> describe what I've currently got.
> Thanks
> Andrew
> --
> View this message in context:
> http://www.nabble.com/Using-ajax-to-update-a-panel-tf4949239.html#a14170394
> 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
>
>