Skip to main content

Posts

Showing posts from June, 2015

Liferay AlloyUI useful practical user interface

<!-- X characters remaining example http://alloyui.com/tutorials/ -->   <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example</title> <script src="http://cdn.alloyui.com/2.0.0/aui/aui-min.js"></script> <link href="http://cdn.alloyui.com/2.0.0/aui-css/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <input type="text" id="some-input" /> <span id="counter"></span> character(s) remaining <script> YUI().use( 'aui-char-counter', function(Y) { new Y.CharCounter( { counter: '#counter', input: '#some-input', maxLength: 10 } ); } ); </script> </body> </html>   AlloyUI’s character counter reports the number of characters you can enter in the text fie

sorting list of beans

public class Student implements Comparable < Student > { String name ; int age ; public Student ( String name , int age ) { this . name = name ; this . age = age ; } @Override public String toString () { return name + ":" + age ; } @Override public int compareTo ( Student o ) { return Comparators . NAME . compare ( this , o ); } public static class Comparators { public static Comparator < Student > NAME = new Comparator < Student >() { @Override public int compare ( Student o1 , Student o2 ) { return o1 . name . compareTo ( o2 . name ); } }; public static Comparator < Student > AGE = new Comparator < Student >() { @Override public int compare ( Student o1 , Student o2 ) {