<!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="modalPanel" resizeable="false">
        <f:facet name="header">#{modalPanelHelper.caption}</f:facet>
        <f:facet name="controls">
            <h:panelGroup>
                <h:graphicImage value="/img/modal/close.png" style="cursor:pointer" id="hidelink"/>
                <rich:componentControl for="modalPanel" attachTo="hidelink" operation="hide" event="onclick"/>
            </h:panelGroup>
        </f:facet>
        <a4j:form id="form2">
        <a4j:region renderRegionOnly="true">
            <h:panelGrid columns="3" id="editContent" rowClasses="prop" columnClasses="name,value, error">
                <h:outputText  value="Name:"/>
                <h:inputText id="name" value="#{album.name}">
                <rich:ajaxValidator event="onchange"/>
                </h:inputText>
                <rich:message for="name" />
                <h:outputText  value="Short description:"/>
                <h:inputTextarea id="description" value="#{album.changedName}">
                <rich:ajaxValidator event="onchange"/>
                </h:inputTextarea>
                <rich:message for="description" />
                <h:outputText value="Shared"/>
				<h:selectBooleanCheckbox styleClass="selectBooleanCheckbox" id="shared" 
					value="#{album.shared}">
				</h:selectBooleanCheckbox>
				<rich:message for="shared" />
				<h:outputText id="owner" value="Owner"/>
				<h:outputText value="#{album.owner.login}"/>
				<rich:message for="owner" />
            </h:panelGrid>
            </a4j:region>
            <a4j:commandButton onclick="if(storeButtonDisabled()){return false;}" oncomplete="#{rich:component('modalPanel')}.hide()" value="Store" actionListener="#{modalPanelHelper[modalPanelHelper.actionName]}" id="storebutton"  reRender="tree, selectedNode"/>
                <button type="button" id="cancelbutton" onclick="#{rich:component('modalPanel')}.hide()">Cancel</button>
        </a4j:form>
    </rich:modalPanel>
    </ui:composition>