<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	<rich:modalPanel id="albumModalPanel" width="300" height="300" onshow="$('form2:name').focus();">
		<f:facet name="header">Add album</f:facet>
		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage value="/img/modal/close.png" style="cursor:pointer"
					id="hidelink" />
				<rich:componentControl for="albumModalPanel" attachTo="hidelink"
					operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>
		<a4j:form id="form2">
			<a4j:region renderRegionOnly="true">
				<rich:graphValidator>
					<h:panelGrid columns="3" id="editContent" rowClasses="prop"
						columnClasses="name,value, error">
						<h:outputText value="Shelf: " />
						<rich:inplaceSelect id="shelf" value="#{album.shelf}"
							openOnEdit="true" showControls="true" editEvent="onclick"
							layout="block" viewClass="inplace" changedClass="inplace"
							onchange="" changedHoverClass="hover" viewHoverClass="hover">
							<s:selectItems var="shelf"
								value="#{shelfManager.getAvailableShelfs(user)}"
								label="#{shelf.name}" />
							<s:convertEntity></s:convertEntity>
						</rich:inplaceSelect>
						<rich:messages />
						<h:outputText value="#{messages['album.name']}" />
						<h:inputText id="name" value="#{album.name}">
						</h:inputText>
						<rich:message for="name" />
					</h:panelGrid>
				</rich:graphValidator>
			</a4j:region>
			<a4j:commandButton oncomplete="#{albumManager.oncomplete}"
				value="#{messages['album.store']}"
				actionListener="#{albumManager.addAlbum(album)}" id="storebutton"
				reRender="tree, mainArea, my_album_div_id, form2" />
			<button type="button" id="cancelbutton"
				onclick="#{rich:component('albumModalPanel')}.hide()">#{messages['album.cancel']}</button>
		</a4j:form>
	</rich:modalPanel>
</ui:composition>