<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<f:subview id="componentControlSubviewID">
	<h:form>
		<rich:modalPanel id="ccModalPanelID" onshow="alert(event.parameters.show)" onhide="alert(event.parameters.hide)">
			<h:outputLink id="hideButton1ID" onclick="return false;" value="#">
				<f:verbatim>Close 1</f:verbatim>
			</h:outputLink>
			<f:verbatim>
				<br />
			</f:verbatim>
			<h:outputLink id="hideButton2ID" onclick="return false;" value="#">
				<f:verbatim>Close 2</f:verbatim>
			</h:outputLink>
		</rich:modalPanel>
		
		<h:commandButton id="showButtonID" value="show ModalPanel" >
			<rich:componentControl for="ccModalPanelID" event="onclick" disableDefault="true" operation="show" params="show:'componentControl work(show)'" />
		</h:commandButton>

		<rich:componentControl attachTo="hideButton1ID, hideButton2ID" event="onclick" for="ccModalPanelID" operation="hide"
			params="hide:'componentControl work(hide)'" />

		<ui:remove>
			<f:verbatim>
				<br />
				<br />
			</f:verbatim>

			<rich:panelMenu id="ccPanelMenuID" mode="client">
				<rich:panelMenuGroup label="group1">
					<rich:panelMenuGroup label="group1 1">
						<rich:panelMenuItem label="Item 1 1"></rich:panelMenuItem>
						<rich:panelMenuItem label="Item 1 2"></rich:panelMenuItem>
					</rich:panelMenuGroup>
					<rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
					<rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
				</rich:panelMenuGroup>
			</rich:panelMenu>

			<rich:componentControl attachTo="testPMID" for="ccPanelMenuID" event="onclick" operation="doCollapse" />

			<a href="#" id="testPMID" onclick="return false;">Click text</a>
		</ui:remove>

		<f:verbatim>
			<br />
			<br />
		</f:verbatim>

		<rich:calendar popup="#{componentControl.calendarPopup}" id="ccCalendarID" />
		<h:panelGrid columns="2">
			<h:outputText value="popup calendar" />
			<h:selectBooleanCheckbox id="calendarSelectID" value="#{componentControl.calendarPopup}" onchange="submit();" />
		</h:panelGrid>

		<f:verbatim>
			<br />
			<a href="#" id="doExpandCalendarID">Calendar (doExpand)</a>
			<br />
			<a href="#" id="doNextYearCalendarID">Calendar (nextYear)</a>
			<br />
			<a href="#" id="doPrevYearCalendarID">Calendar (prevYear)</a>
			<br />
			<a href="#" id="doNextMonthCalendarID">Calendar (nextMonth)</a>
			<br />
			<a href="#" id="doPrevMonthCalendarID">Calendar (prevMonth)</a>
			<br />
			<a href="#" id="doTodayCalendarID">Calendar (today)</a>
		</f:verbatim>

		<rich:componentControl attachTo="doExpandCalendarID" for="ccCalendarID" event="onclick" operation="doExpand" />
		<rich:componentControl attachTo="doNextYearCalendarID" for="ccCalendarID" event="onclick" operation="nextYear" />
		<rich:componentControl attachTo="doPrevYearCalendarID" for="ccCalendarID" event="onclick" operation="prevYear" />
		<rich:componentControl attachTo="doNextMonthCalendarID" for="ccCalendarID" event="onclick" operation="nextMonth" />
		<rich:componentControl attachTo="doPrevMonthCalendarID" for="ccCalendarID" event="onclick" operation="prevMonth" />
		<rich:componentControl attachTo="doTodayCalendarID" for="ccCalendarID" event="onclick" operation="today" />

		<f:verbatim>
			<br />
			<br />
		</f:verbatim>

		<rich:panelMenu id="ccContextMenuPanelMenuID">
			<h:outputText value="click text" />
		</rich:panelMenu>

		<rich:contextMenu id="ccContextMenuID" submitMode="ajax">
			<rich:menuItem icon="/pics/header.png" value="tab1" reRender="cmInfoID">
				<f:param name="cmdParam" value="menu" />
			</rich:menuItem>
			<rich:menuSeparator />
			<rich:menuItem icon="/pics/info.gif" value="a" reRender="cmInfoID">
				<f:param name="cmdParam" value="a" />
			</rich:menuItem>
			<rich:menuItem icon="/pics/info.gif" value=" b" reRender="cmInfoID">
				<f:param name="cmdParam" value="b" />
			</rich:menuItem>
			<rich:menuItem icon="/pics/info.gif" value="c" reRender="cmInfoID">
				<f:param name="cmdParam" value="c" />
			</rich:menuItem>
		</rich:contextMenu>
		<rich:componentControl event="oncontextmenu" attachTo="ccContextMenuPanelMenuID" for="ccContextMenuID" operation="doShow" />
	</h:form>
</f:subview>