Theme
SlideOut
Advanced example demonstrates using of ajax events, callbacks and interesting settings.

Examples include:
  • Javascript callbacks for "onOpen" and "onClose" events
  • p:ajax server side events for "open" and "close" events
  • CSS styling is different for open vs closed states by check for "ui-slideouttab-open" style.

Javascript Callback Result: Event Result

Source
<pe:slideout id="slideoutFeedback" title="Feedback" icon="fa fa-thumbs-o-up" location="top" widgetVar="slideout"
		handleStyleClass="feedback-handle" panelStyleClass="feedback-panel" offset="475px" bounceTimes="5"
		bounceDistance="100px" onopen="$('#lblOnOpenClose').text('Open Event!');"
		onclose="$('#lblOnOpenClose').text('Close Event!');">
		
		<p:ajax event="open" listener="#{slideOutController.openListener}" update="growl"/> 
		<p:ajax event="close" listener="#{slideOutController.closeListener}" update="growl"/> 
		
		<p:panelGrid styleClass="ui-noborder">
			<p:row>
				<p:column styleClass="ui-widget-header">
					<p:outputLabel for="txtMessage" value="Message"></p:outputLabel>
				</p:column>
			</p:row>
			<p:row>
				<p:column>
					<p:inputTextarea id="txtMessage" rows="5" cols="43" autoResize="false" />
					<p:watermark for="txtMessage" value="Send us a message if you have something to say." />
				</p:column>
			</p:row>
			<p:row>
				<p:column styleClass="ui-widget-header">
					<p:outputLabel for="txtEmail" value="Email address (optional)"></p:outputLabel>
				</p:column>
			</p:row>
			<p:row>
				<p:column>
					<p:inputText id="txtEmail" size="40" />
					<p:watermark for="txtEmail" value="Email address (optional)" />
				</p:column>
			</p:row>
			<p:row>
				<p:column style="font-style: italic;">
             If you provide your email address above, then by submitting<br />
             this form you agree that we may contact you by email<br />
             to follow up on your feedback.<br />
				</p:column>
			</p:row>
			<p:row>
				<p:column>
					<p:outputPanel style="text-align:right;">
						<p:commandButton value="Send" type="button" onclick="PF('slideout').close();" />
					</p:outputPanel>
				</p:column>
			</p:row>
		</p:panelGrid>
	</pe:slideout>

    <p>
        <h:outputText id="lblResult" value="Javascript Callback Result: " />
        <h:outputText id="lblOnOpenClose" value="Event Result" style="font-weight:bold; color: DeepPink;" />
    </p>
            
Components and more
Documentation pe:slideout
Attributes (move mouse over the names to see data types)
Name Description
id Unique identifier of the component in a namingContainer.
rendered Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding An el expression referring to a server side UIComponent instance in a backing bean.
widgetVar Name of the client side widget.
showOn Action which will open the panel, 'hover' or 'click'.
title Text value to display on the handle. Default value is null.
icon Icon image to display on the handle. Default value is null.
location Location on screen either left, right, top or bottom. Default value is right.
animateSpeed Speed of the slide out animation. Default is 300.
bounceTimes How many bounces when 'bounce' is called. Default is 4.
bounceDistance How far bounce event will move everything. Default value is 50px.
sticky True to have the tab follow the scroll of the window.
clickScreenToClose Close the tab when the rest of screen is clicked. Default is true.
autoOpen Automatically open tab on DOM load. Default is false.
offset Panel distance from top or left (bottom or right if offsetReverse is true). Default value is 200px.
offsetReverse Panel is aligned with right or bottom of window. Default is false.
handleOffset Handle distance from top or left. If null, detects panel border to align handle nicely. Default value is NULL.
handleOffsetReverse Handle is aligned with right or bottom of window. Default is false.
handleStyleClass Style class of the tab handle element. Default value is null.
handleStyle Inline style applied to the tab handle element. Default value is null.
panelStyleClass Style class of the slideout container element. Default value is null.
panelStyle Inline style applied to the slideout container element. Default value is null.
onopen Javascript handler to execute when the slideout opens.
onclose Javascript handler to execute when the slideout closes.
onslide Javascript handler called after opening or closing.
onbeforeopen Javascript handler called before opening, return false to cancel.
onbeforeclose Javascript handler called before closing, return false to cancel.
onbeforeslide Javascript handler called before opening or closing, return false to cancel.
Events (move mouse over the names to see classes)
Name Description
openfires when the slideout is opened
closefires when the slideout is closed
PrimeFaces Extensions Showcase - © 2011-2019, PrimeFaces: 7.0, PrimeFaces Extensions: 7.0.1, JSF: mojarra 2.3.2, Server: jetty/9.4.2.v20170220, Build time: 2019-05-21 21:46
occured!
Message:
Timestamp:
StackTrace: