I have the following inside a richfaces modalpanel:
<ui:repeat id="al11" var="albumslistvalue1" value="#{AlbumDetailBean.getAlbumImagesList()}"
varStatus="albumslistvalue1Index">
<rich:modalPanel id="panel#{albumslistvalue1Index}" width="850" height="560">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Fotos"/>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="/img/modal/close.png" styleClass="hidelink" id="hidelink"/>
<rich:componentControl for="panel" attachTo="hidelink" operation="hide"
event="onclick" />
</h:panelGroup>
</f:facet>
<!-- content-->
<center>
<h:graphicImage value="img/cart/prior16.png" />
<h:graphicImage value="albums/#{albumslistvalue1.albumImageId}/med_#{albumslistvalue1.albumimagename}"/>
<h:graphicImage value="img/cart/next16.png" />
<h:commandLink id="comp" action="#{AlbumDetailBean.getCartAlbums()}">
<div>
<h:outputText value="Comprar" />
<f:param name="albumproductid" value="#{albumslistvalue1.id}" />
</div>
</h:commandLink>
</center>
</rich:modalPanel>
<h:outputLink value="#" id="link">
<!-- Show Modal Panel -->
<h:graphicImage id="image" url="albums/#{albumslistvalue1.albumImageId}/mini_#{albumslistvalue1.albumimagename}"
width="100px" height="auto" />
<rich:componentControl for="panel#{albumslistvalue1Index}" attachTo="link"
operation="show" event="onclick" />
</h:outputLink>
</ui:repeat>
and getCartAlbums() method:
public List getCartAlbums() {
boolean status = false;
AlbumImpl bean1 = new AlbumImpl();
String productidval = ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getParameter("albumproductid");
AlbumDetailBean albums = (AlbumDetailBean) bean1.bo_getAlbumImageDetails(productidval);
if(albums != null) {
cartAlbumDetails.add(albums);
setId(albums.getId());
setAlbumname(albums.getAlbumname());
setSchoolId(albums.getSchoolId());
setAlbumImageId(albums.getAlbumImageId());
setAlbumimagename(albums.getAlbumimagename());
// setAlbumimage(albums.getAlbumimage());
setListPrice(albums.getListPrice());
setAvailableQty(albums.getAvailableQty());
setTotalAmount(albums.getTotalAmount());
setProductcode(albums.getProductcode());
setListpricevalue(albums.getListpricevalue());
setProductsize(albums.getProductsize());
setQtyvalue(albums.getQtyvalue());
setTotalpricevalue(albums.getTotalpricevalue());
setProductid(albums.getProductid());
setShipPrice(albums.getShipPrice());
}
return cartAlbumDetails;
}
I'm using someone else's code, so i didn't write the getCartAlbums() method, but it basically add the select image to the cart, it's working, the images are added to the cart correctly, but the modalpanel still closes