Skip to content

Commit

Permalink
finished jQuery callback of b:carousel and fixed AJAX with b:tabView
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanrauh committed Sep 20, 2015
1 parent e8f5d55 commit f602e09
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,18 @@ public String onMouseOut() {
return null;
}

public String onMouseOver() {
public void onMouseOver() {
String event = " mouseover";
report(event);
}

public String onMouseOverCarouselItem(Object index) {
String event = " mouseover Carousel Item #" + index;
report(event);
return null;
}


public String onMouseUp() {
String event = " mouseup";
report(event);
Expand Down Expand Up @@ -247,6 +253,17 @@ public String onPanelExpanded() {
return null;
}

public String onCarouselSlideStart() {
String event = " carousel started to slide";
report(event);
return null;
}
public String onCarouselSlid() {
String event = " carousel finished sliding";
report(event);
return null;
}


public String onSelect() {
String event = " select";
Expand Down
Binary file added AJAX/src/main/webapp/Valladolid-parque-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AJAX/src/main/webapp/Valladolid-parque-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AJAX/src/main/webapp/Valladolid-parque-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions AJAX/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<!--param-value>Production</param-value -->
<param-value>Development</param-value>
</context-param>
<!-- <context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bootstrap</param-value>
Expand Down
50 changes: 50 additions & 0 deletions AJAX/src/main/webapp/carousel.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:b="http://bootsfaces.net/ui"
xmlns:f="http://java.sun.com/jsf/core">

<h:form>
<b:row>
<b:column col-sm="6">
<b:panel look="primary" title="AJAXified b:carousel"
update="@form:messages"
onexpand="console.log('expand - start');ajax:AJAXBean.onPanelExpandStart()"
onexpanded="console.log('expand - done');ajax:AJAXBean.onPanelExpanded()"
oncollapse="console.log('expand - start');ajax:AJAXBean.onPanelCollapseStart()"
oncollapsed="console.log('expand - done');ajax:AJAXBean.onPanelCollapsed()">
<b:carousel id="parque" style="width:400px"
onslidestart="console.log('slide start');ajax:AJAXBean.onCarouselSlideStart()"
onslid="console.log('finished sliding');ajax:AJAXBean.onCarouselSlid()"
onmouseout="console.log('mouse out');ajax:AJAXBean.onMouseOut();"
onmouseover="console.log('mouse out');ajax:AJAXBean.onMouseOver();"
startAnimation="false"
update=":**:*messages">
<b:carouselItem onmousover="console.log('mouse over');ajax:AJAXBean.onMouseOverCarouselItem(1);">
<img src="Valladolid-parque-1.jpg"
alt="Valladolid" />
</b:carouselItem>
<b:carouselItem>
<img src="Valladolid-parque-2.jpg"
alt="Valladolid" />
</b:carouselItem>
<b:carouselItem>
<img src="Valladolid-parque-3.jpg"
alt="Valladolid" />
</b:carouselItem>
</b:carousel>
</b:panel>
</b:column>
<b:column col-sm="6">
<b:well id="messages">
Last action:
<ul>
<ui:repeat var="message" value="#{AJAXBean.messages}">
<li>#{message}</li>
</ui:repeat>
</ul>
</b:well>
</b:column>
</b:row>
</h:form>
</ui:fragment>
11 changes: 8 additions & 3 deletions AJAX/src/main/webapp/index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,22 @@

<b:container id="content">
<b:tabView id="tabViewID">
<b:tab title="Navigation"
<b:tab title="Carousel"
onclick="ajax:AJAXBean.clearMessages()" update="**:*messages">
<div style="height: 10px" />
<ui:include src="commandbutton3.xhtml" />
<ui:include src="carousel.xhtml" />
</b:tab>
<b:tab title="Navigation"
onclick="ajax:AJAXBean.clearMessages()" update="**:*messages">
<div style="height: 10px" />
<ui:include src="commandbutton3.xhtml" />
</b:tab>
<b:tab title="command button"
onclick="ajax:AJAXBean.clearMessages()" update="**:*messages">
<div style="height: 10px" />
<ui:include src="commandbutton.xhtml" />
</b:tab>
<b:tab title="command button 2" update="**:*messages"
<b:tab title="command button 2 (unfinished)" update="**:*messages"
onclick="ajax:AJAXBean.clearMessages()">
<div style="height: 10px" />
<ui:include src="commandbutton2.xhtml" />
Expand Down

0 comments on commit f602e09

Please sign in to comment.