~~ Licensed to the Apache Software Foundation (ASF) under one or more ~~ contributor license agreements. See the NOTICE file distributed with ~~ this work for additional information regarding copyright ownership. ~~ The ASF licenses this file to You under the Apache License, Version 2.0 ~~ (the "License"); you may not use this file except in compliance with ~~ the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, software ~~ distributed under the License is distributed on an "AS IS" BASIS, ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~~ See the License for the specific language governing permissions and ~~ limitations under the License. ------ Features ------ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New JSF Components During the limited 3 month GSoC period, 10+ components are developed: * Html5 input: * hx:inputText * hx:inputColor * hx:inputDateTime * hx:inputEmail * hx:inputNumberSlider * hx:inputNumberSpinner * hx:dataList (not a real input component, related to input components) * fx:validateDateTimeRange * Html5 behavior: * fx:dragSource * fx:dropTarget * Html5 media: * hx:audio * hx:video * fx:mediaSource * fx:mediaSources * Misc: * hx:div Documentation of components delivered with this project can be found <<{{{../../html5-comp-lib-core/target/site/tlddoc-facelets/index.html}here}}>>. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Independent of JSF Implementation Even if the project name Html5 support for MyFacecs 2, the components work with Mojarra too. Components and other things are not dependent on MyFaces Core. Instead of extending or being dependent on MyFaces core, the project elements use MyFaces shared which should be provided on run-time. Unlike MyFaces Core and Tomahawk, binaries of this project do not contain the MyFaces shared. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for new input types With Html5, some new input types are defined. All of these types are supported. * number, range, color, email, URL. tel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Driving Client-Side Validation with JSF validators and converters Html5 inputs have implicit validations like pattern, min, max etc. The information required for validation is rendered by input renderers automatically if there is any applicable attached converters/validators for the component. You can see the running example <<{{{http://html5-comp-lib-showcase-snapshot.latest.aliok-com-tr-test.appspot.com/inputText/inputText04.jsf}here}}>>. +----------------------------------------------+ +----------------------------------------------+ will render +----------------------------------------------+ +----------------------------------------------+ and that is all the necessary information for client-side validation. Custom validators and converters are supported too. The only thing they need to do is implementing <> interface and implementing the pattern. For driving the properties other than pattern, and etc. will be used (work in progress). +----------------------------------------------+ @FacesValidator(value="partNumberValidator") public class PartNumberValidator implements Validator, ClientSidePatternProvider { public String getPattern() { return "[0-9][A-Z]{3}"; } ... +----------------------------------------------+ +----------------------------------------------+ +----------------------------------------------+ Work in progress: Using the same validation error message on both server and client sides. ie: +----------------------------------------------+ +----------------------------------------------+ will render +----------------------------------------------+ +----------------------------------------------+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Drag and Drop and are JSF behaviors, which provide Html5 drag and drop support. Main features of DnD are: * Partial Page Rendering and triggering a listener on drop ( {{{http://html5-comp-lib-showcase-snapshot.latest.aliok-com-tr-test.appspot.com/dnd/dnd01.jsf}running example}} ): +----------------------------------------------+ ... ... +----------------------------------------------+ * Allowing/restricting specific types ( {{{http://html5-comp-lib-showcase-snapshot.latest.aliok-com-tr-test.appspot.com/dnd/dnd02.jsf}running example}} ): +----------------------------------------------+ ... ... ... +----------------------------------------------+ * Sending parameter on drop ( {{{http://html5-comp-lib-showcase-snapshot.latest.aliok-com-tr-test.appspot.com/dnd/dnd01.jsf}running example}} ): +----------------------------------------------+ ... ... public class DndBean ...{ ... public void processDropBehavior(DropEvent event) ...{ String parameterFromDragSorce = event.getParam(); ... } } +----------------------------------------------+ * Sending data with specified content-type on drop ( {{{http://html5-comp-lib-showcase-snapshot.latest.aliok-com-tr-test.appspot.com/dnd/dnd03.jsf}running example}} ): +----------------------------------------------+ public class DndBean ...{ ... public void processDropBehavior(DropEvent event) ...{ String droppedText = event.getDropDataMap().get('text/plain'); ... } } +----------------------------------------------+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Other Input Features * Client-side validation is shown already at the top of this page. [] * Placeholders ( {{{http://html5-comp-lib-showcase-snapshot.latest.aliok-com-tr-test.appspot.com/inputText/inputText05.jsf}running example}} ): Ability to show some watermark on the input, while it is empty. [] * Suggestions ( {{{http://html5-comp-lib-showcase-snapshot.latest.aliok-com-tr-test.appspot.com/inputText/inputText03.jsf}running example}} ): There are a lot of ways to provide suggestions * Providing collection or array of of javax.faces.model.SelectItem +----------------------------------------------+ +----------------------------------------------+ * Providing comma seperated suggestion values: +----------------------------------------------+ +----------------------------------------------+ * Using of hx:dataList: +----------------------------------------------+ +----------------------------------------------+ With hx:dataList, we can use the same suggestion values for more than one component. * New events ( {{{http://html5-comp-lib-showcase-snapshot.latest.aliok-com-tr-test.appspot.com/dnd/dnd03.jsf}running example}} ): * oninput * oninvalid * onforminput * ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Html5 Video-Audio support Html5 video, audio and media sources are supported in a convenient way. See the Facelets Tag Doc for more.