Collection of useful(?) components and mixins for Apache Tapestry. Disclaimer: Some may not be ready for production. Use at your own risk.
- Add the dependency to your
build.gradle
- Declare library as xml namespace and
- use the components with your defined prefix.
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation "com.github.eddyson-de:tapestry-extensions:0.3.0"
}
<html xmlns:etc="tapestry-library:EddysonTapestryExtensions">
<etc:multiselect></etc:multiselect>
</html>
For examples see the test app under src/test.
You can run the test app manually via gradle runTestApp
.
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 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
Filter mixin for the "Palette" core component.
<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>
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>
Make a grid unsortable
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
<t:grid source="..." t:mixins="EddysonTapestryExtensions/UnsortableGrid" />
</html>
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>
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>