Code Monkey home page Code Monkey logo

tapestry-extensions's Introduction

ci

Tapestry Extensions

Join the chat at https://gitter.im/eddyson-de/tapestry-extensions

Collection of useful(?) components and mixins for Apache Tapestry. Disclaimer: Some may not be ready for production. Use at your own risk.

General Usage

  • Add the dependency to your build.gradle
  • Declare library as xml namespace and
  • use the components with your defined prefix.

build.gradle

repositories {
  maven { url "https://jitpack.io" }
}

dependencies {
  implementation "com.github.eddyson-de:tapestry-extensions:0.3.0"
}

Page.tml

<html xmlns:etc="tapestry-library:EddysonTapestryExtensions">
    <etc:multiselect></etc:multiselect>
</html>

Examples

For examples see the test app under src/test. You can run the test app manually via gradle runTestApp.

Components

MultiSelect

Multiple selections based on Select2.

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"
      xmlns:etc="tapestry-library:EddysonTapestryExtensions">
    <etc:multiselect blankLabel="Select..." model="model" 
    encoder="encoder" selected="selected" multiple="true"></etc:multiselect>
</html>

Tagging

Tagging component with ajax search based on Select2.

Template (initialTags parameter optional)

<t:form>
	<etc:tagging t:id="tagging1" tags="tags" initialTags="['First','Second']" ></etc:tagging>
	<t:submit />
</t:form>

Containing Page

public class TaggingDemo {
  //Bound "tags" parameter will contain submitted tags.
  @Property
  @Persist
  List<String> tags;

  //Event gets fired while typing into the field.
  //Evalutate query string and return suggestions.
  @OnEvent(value = "completeTags")
  Object completions(String query){
    //Return Strings based on query
    //List<String> list = dao.search(query);
    return list;
  }
}

##Mixins

PaletteFilter

Filter mixin for the "Palette" core component.

small

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
    <t:palette t:id="palette" t:mixins="EddysonTapestryExtensions/PaletteFilter" 
    t:selected="selected" model="model" t:encoder="encoder"/>
</html>

DefaultGridSort

Sort a Grid by a specific column by default

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
    <t:grid source="..." t:mixins="EddysonTapestryExtensions/DefaultGridSort" DefaultGridSort.sortColumn="firstName" DefaultGridSort.sortOrder="ascending"/>
</html>

UnsortableGrid

Make a grid unsortable

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
    <t:grid source="..." t:mixins="EddysonTapestryExtensions/UnsortableGrid" />
</html>

InfiniGrid

Use AJAX to load new Grid rows dynamically while scrolling, requires pagerPosition="none" and inplace="true" parameters to be set for the Grid.

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
    <t:grid source="..." inplace="true" pagerPosition="none" t:mixins="EddysonTapestryExtensions/InfiniGrid" />
</html>

FadeOnRefresh

Fade out a zone when it is updating and fade it back in afterwards.

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
    <t:zone t:id="zone" t:mixins="ZoneRefresh,EddysonTapestryExtensions/FadeOnRefresh" ZoneRefresh.period="2" >
				I am a zone
    </t:zone>
</html>

tapestry-extensions's People

Contributors

fkretzer avatar gitter-badger avatar jochenberger avatar ydylla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.