Permalink
Browse files

Add remoteNonStopPageScroll tag

  • Loading branch information...
1 parent de0a246 commit 5fce5583b395f78b18026e3c766d799c7fa66dcf Amit Jain committed Jan 6, 2013
View
@@ -0,0 +1,15 @@
+*.iml
+*.ipr
+*.project
+*.classpath
+*.iws
+*.idea
+*/target/*
+*/target-eclipse/*
+.settings/*
+.settings
+*/*.zip
+*/*.sha1
+stacktrace.log
+target/
+**/*.html
View
@@ -1,9 +1,9 @@
#Grails Metadata file
-#Sat Feb 25 12:25:35 IST 2012
-app.grails.version=1.3.7
+#Sat Dec 29 14:20:56 IST 2012
+app.grails.version=2.1.0
app.name=remotePaginationSampleApp
app.servlet.version=2.4
app.version=0.1
-plugins.hibernate=1.3.7
-plugins.tomcat=1.3.7
+plugins.hibernate=2.1.0
plugins.jquery=1.6.1.1
+plugins.tomcat=2.1.0
@@ -1,5 +1,6 @@
import com.intelligrape.Book
import com.intelligrape.Comment
+import com.intelligrape.Content
class BootStrap {
@@ -9,8 +10,9 @@ class BootStrap {
new Book(name: "name$it", author: "author$it",price: 50 +it).save()
}
- (1..51).each{
+ (1..101).each{
new Comment(author: 'Amit', comments:"Hello World! Hello World! Hello World! Hello World! Hello World! ..... $it").save()
+ new Content(description:"Hello World! Hello World! Hello World! Hello World! Hello World! ..... $it").save()
}
}
}
@@ -2,7 +2,7 @@ grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
-//grails.plugin.location."remote-pagination"="../remote-pagination/trunk"
+//grails.plugin.location."remote-pagination"="../remote-pagination/remote-pagination"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
@@ -29,8 +29,9 @@ grails.project.dependency.resolution = {
// runtime 'mysql:mysql-connector-java:5.1.13'
- plugins{
- compile ':remote-pagination:0.3'
- }
+
+ }
+ plugins{
+ compile ':remote-pagination:0.4'
}
}
@@ -1,6 +1,6 @@
dataSource {
pooled = true
- driverClassName = "org.hsqldb.jdbcDriver"
+ driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
@@ -14,19 +14,19 @@ environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
- url = "jdbc:hsqldb:mem:devDB"
+ url = "jdbc:h2:mem:devDB"
}
}
test {
dataSource {
- dbCreate = "update"
- url = "jdbc:hsqldb:mem:testDb"
+ dbCreate = "create-drop" // one of 'create', 'create-drop','update'
+ url = "jdbc:h2:mem:testDB"
}
}
production {
dataSource {
- dbCreate = "update"
- url = "jdbc:hsqldb:file:prodDb;shutdown=true"
+ dbCreate = "create-drop" // one of 'create', 'create-drop','update'
+ url = "jdbc:h2:mem:prodDB"
}
}
}
@@ -4,8 +4,7 @@ class BookController {
def scaffold = true
def list = {
- params.max = Math.min(params.max ? params.int('max') : 5, 100)
- [bookInstanceList: Book.list(params), bookInstanceTotal: Book.count()]
+ [bookInstanceList: Book.list(max:10,offset: 0), bookInstanceTotal: Book.count()]
}
def filter = {
@@ -0,0 +1,14 @@
+package com.intelligrape
+
+class ContentController {
+
+ def list = {
+ params.max = Math.min(params.max ? params.int('max') : 20, 100)
+ render(view:'list', model: [contents: Content.list(params), total: Content.count()])
+ }
+
+ def filter = {
+ params.max = Math.min(params.max ? params.int('max') : 20, 100)
+ render(template: 'filter', model: [contents: Content.list(params), total: Content.count()])
+ }
+}
@@ -0,0 +1,7 @@
+package com.intelligrape
+
+class Content {
+ String description
+ static constraints = {
+ }
+}
@@ -0,0 +1,7 @@
+<g:each in="${contents}" var="content" status="index">
+ <fieldset style="background-color:white;border: #aaaaaa 1px dashed">
+ <span class="text">${content?.description}</span>
+ </fieldset>
+</g:each>
+
+<util:remoteNonStopPageScroll action='filter' controller="content" total="${total}" update="content" />
@@ -0,0 +1,71 @@
+<%@ page import="com.intelligrape.Comment" %>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <meta name="layout" content="main"/>
+ <g:set var="entityName" value="${message(code: 'comment.label', default: 'Content')}"/>
+ <title><g:message code="default.list.label" args="[entityName]"/></title>
+ <g:javascript plugin="remote-pagination" library="remoteNonStopPageScroll"/>
+ <style type="text/css">
+ .commentdate {
+ border-bottom: 1px solid #D7D7D7;
+ color: #999999;
+ font-weight: normal;
+
+ }
+
+ .text {
+ font-size: 11px;
+ }
+
+ .moreLink {
+ display: block !important;
+ font-size: 13px;
+ padding: 5px 10px 4px;
+ text-align: center;
+ cursor: pointer;
+ border-color: #CCC;
+ background: #ECECEC;
+ }
+
+ .paginateButtons, .paginateButtons:hover {
+ width: 94%;
+ /*background: #ECECEC;*/
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0, white), color-stop(100%, #ECECEC));
+ border-color: #CCC;
+ color: #585858 !important;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ font-size: 12px;
+ line-height: 1.35;
+ margin: 0;
+ overflow: visible;
+ padding: 3px 10px 2px;
+ text-decoration: none !important;
+ vertical-align: top;
+ }
+ </style>
+</head>
+
+<body>
+<div class="nav">
+ <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a>
+ </span>
+ <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label"
+ args="[entityName]"/></g:link></span>
+</div>
+
+<div class="body">
+ <h1><g:message code="default.list.label" args="[entityName]"/></h1>
+ <g:if test="${flash.message}">
+ <div class="message">${flash.message}</div>
+ </g:if>
+ <div class="list" id="content">
+ <g:render template="filter"/>
+ </div>
+</div>
+</body>
+</html>
@@ -6,37 +6,28 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
- <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
- <property name="grailsResourceLoader" ref="grailsResourceLoader" />
+ <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
+ <property name="grailsResourceLoader" ref="grailsResourceLoader" />
</bean>
<bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
<description>A bean that manages Grails plugins</description>
- <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
- <property name="application" ref="grailsApplication" />
+ <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
+ <property name="application" ref="grailsApplication" />
</bean>
- <bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
- <constructor-arg>
- <ref bean="grailsApplication" />
- </constructor-arg>
- <property name="pluginManager" ref="pluginManager" />
- </bean>
+ <bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
+ <constructor-arg>
+ <ref bean="grailsApplication" />
+ </constructor-arg>
+ <property name="pluginManager" ref="pluginManager" />
+ </bean>
- <bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean">
- <property name="grailsResourceHolder" ref="grailsResourceHolder" />
- </bean>
+ <bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean" />
- <bean id="grailsResourceHolder" scope="prototype" class="org.codehaus.groovy.grails.commons.spring.GrailsResourceHolder">
- <property name="resources">
- <value>classpath*:**/grails-app/**/*.groovy</value>
- </property>
- </bean>
-
- <bean id="characterEncodingFilter"
- class="org.springframework.web.filter.CharacterEncodingFilter">
- <property name="encoding">
- <value>utf-8</value>
- </property>
- </bean>
+ <bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter">
+ <property name="encoding">
+ <value>utf-8</value>
+ </property>
+ </bean>
</beans>
@@ -5,7 +5,7 @@
<parser content-type="text/html;charset=ISO-8859-1"
class="org.codehaus.groovy.grails.web.sitemesh.GrailsHTMLPageParser" />
<parser content-type="text/html;charset=UTF-8"
- class="org.codehaus.groovy.grails.web.sitemesh.GrailsHTMLPageParser" />
+ class="org.codehaus.groovy.grails.web.sitemesh.GrailsHTMLPageParser" />
</page-parsers>
<decorator-mappers>
View
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- version="2.0">
-
- <description>JSTL 1.1 core library</description>
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ version="2.1">
+
+ <description>JSTL 1.2 core library</description>
<display-name>JSTL core</display-name>
- <tlib-version>1.1</tlib-version>
+ <tlib-version>1.2</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>
@@ -74,7 +74,7 @@ not the body content should be processed.
<description>
Name of the exported scoped variable for the
resulting value of the test condition. The type
-of the scoped variable is Boolean.
+of the scoped variable is Boolean.
</description>
<name>var</name>
<required>false</required>
@@ -174,6 +174,9 @@ Collection of items to iterate over.
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
+ <deferred-value>
+ <type>java.lang.Object</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
@@ -253,6 +256,9 @@ String of tokens to iterate over.
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
+ <deferred-value>
+ <type>java.lang.String</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
@@ -322,7 +328,7 @@ visibility.
<tag>
<description>
Like &lt;%= ... &gt;, but for expressions.
- </description>
+ </description>
<name>out</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>
<body-content>JSP</body-content>
@@ -467,6 +473,9 @@ Expression to be evaluated.
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
+ <deferred-value>
+ <type>java.lang.Object</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- version="2.0">
-
- <description>JSTL 1.1 i18n-capable formatting library</description>
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ version="2.1">
+
+ <description>JSTL 1.2 i18n-capable formatting library</description>
<display-name>JSTL fmt</display-name>
- <tlib-version>1.1</tlib-version>
+ <tlib-version>1.2</tlib-version>
<short-name>fmt</short-name>
<uri>http://java.sun.com/jsp/jstl/fmt</uri>
@@ -55,7 +55,7 @@ and may contain a two-letter (upper-case)
country code (as defined by ISO-3166).
Language and country codes must be
separated by hyphen (-) or underscore
-(_).
+(_).
</description>
<name>value</name>
<required>true</required>
@@ -496,7 +496,7 @@ Date and/or time to be formatted.
<description>
Specifies whether the time, the date, or both
the time and date components of the given
-date are to be formatted.
+date are to be formatted.
</description>
<name>type</name>
<required>false</required>
Oops, something went wrong.

0 comments on commit 5fce558

Please sign in to comment.