Recent Notes

Displaying keyword search results 21 - 30
Created by Fang on December 06, 2011 19:03:25    Last update: December 07, 2011 08:54:11
Our custom tag, as implemented in the previous note , is broken when a template is used. Create a template file ( home-template.xhtml ): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... and a test page that uses it ( home.xhtml ): <?xml version="1.0" encoding="UTF-8"?> <ui:comp... Then request the page with URL: http://localhost:8080/facelet-demo/home.jsf?name=Jack . You'll find that our hello tag works inside ui:repeat but fails to get the value defined by ui:param ! What's the problem? Our hello tag implementation evaluated the EL with the wrong EL context! This is the corrected implementation: package com.example; import java.io.IOExcep...
Created by Fang on December 03, 2011 12:31:20    Last update: December 03, 2011 12:33:23
The <h:outputText> tag generates different output for body text and value attribute. I tested the following with Apache MyFaces 2.1.3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... With value attribute, the output was: <table border='1' cellspacing='0' cellpadding='4'>... With text in body, the output was (i.e., the text was escaped despite escape="false" ): &lt;table border='1' cellspacing='0' cellpadding='...
Created by James on November 27, 2011 16:02:11    Last update: November 27, 2011 16:02:11
This is an example that uses the XSLTProcessor jQuery plugin for client side XSLT. Unfortunately it didn't work in IE or Chrome. It worked in Firefox but somehow disable-output-escaping="yes" was ignored. <!DOCTYPE html> <html xmlns="http://www.w3.org/...
Created by Fang on November 22, 2011 10:40:16    Last update: November 22, 2011 10:40:16
This is an example that uses tag handler, UI component and renderer together to support a custom taglib. The main purpose is to show how these components play together. The tag renders <ui:param name="extra" value="el interpreted"/> ... as <h3>my:foreach</h3> <ul class="css class" extra... These are the files: The tag handler ( src/main/java/com/example/ForeachTagHandler.java ): package com.example; import java.util.Map; ... The UI component ( src/main/java/com/example/UIForeach.java ): package com.example; import java.io.IOExcep... The renderer ( src/main/java/com/example/ForeachRenderer.java ): package com.example; import java.io.IOExcep... Faces config ( src/main/resources/META-INF/faces-config.xml ): <?xml version="1.0" encoding="UTF-8"?> <faces-c... Taglib config ( src/main/resources/META-INF/foreach.taglib.xml ): <?xml version="1.0" encoding="UTF-8"?> <facelet...
Created by Fang on November 08, 2011 20:55:00    Last update: November 21, 2011 18:19:44
In the simple taglib example , I used a tag handler class to implement a taglib. This is an example to implement a taglib with a UI component. The purpose is to use a custom tag to split a string and print each part in a separate paragraph, i.e., print <p>john</p> <p>steve</p> <p>mike</p> with custom tag <my:foreach> : <my:foreach var="who" value="john steve mike"> ... These are the files: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0"... src/main/java/com/example/UIForeash.java : package com.example; import java.io.IOExcep... src/main/resources/META-INF/faces-config.xml : <?xml version="1.0" encoding="UTF-8"?> <faces-c... src/main/resources/META-INF/foreach.taglib.xml : <?xml version="1.0" encoding="UTF-8"?> <facelet... How to use: Put the JAR file generated by the above project in the WEB-INF/lib folder of the web app. If the web app is a Maven project, just add the taglib project as a dependency:...
Created by mee2 on November 20, 2011 21:00:58    Last update: November 20, 2011 21:10:22
Alfresco community-4.0.b has only 64-bit installer for Linux. These are the steps to manually install it on 32-bit Ubuntu Linux. Download alfresco-community-4.0.b.zip from http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco . Install dependencies: $ sudo apt-get install imagemagick swftools postgr... Note: swftools was not available as a package for Ubuntu 11.10, I installed it with source . Create alfresco database: $ sudo bash [sudo] password for alfresco: ... Copy everything from the Alfresco web-server folder to Tomcat: $ cp -R alfresco-community-4.0.b/web-server/* apac... Edit $TOMCAT_HOME/conf/catalina.properties , change shared.loader to: shared.loader=${catalina.base}/shared/classes,${ca... Edit Tomcat conf file conf/server.xml , add URIEncoding="UTF-8" : <Connector port="8080" protocol="HTTP/1.1" ... Customize alfresco-global.properties : $ mv shared/classes/alfresco-global.properties.sam... Edit shared/classes/alfresco-global.properties : ############################### ## Common A... Copy keystore files from alfresco.war : expand alfresco.war , grab the whole keystore directory from...
Created by James on September 23, 2010 20:30:55    Last update: November 16, 2011 14:51:23
jQuery button set where one button can be pressed "down" at a time. <!DOCTYPE html> <html> <head> <title>jQu...
Created by Fang on November 10, 2011 11:27:37    Last update: November 10, 2011 11:28:25
This has been tested working with Apache MyFaces 2.1.3 running Tomcat 7. Managed bean code: package com.example; import javax.faces.bea... Facelet page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric...
Created by Fang on November 10, 2011 09:26:12    Last update: November 10, 2011 09:26:12
Syntax highlighted XML schema for JSF 2.0 Application Configuration Resource File ( faces-config.xml ). Almost 3000 lines! <?xml version="1.0" encoding="UTF-8"?> <xsd:sch...
Created by James on January 10, 2011 12:35:53    Last update: November 04, 2011 19:28:03
The events mouseover and mouseout are fired when the mouse enters/leaves the element where the event handlers are registered, and any nested elements which do not handle these events (because of event bubbling ). The events mouseenter and mouseleave are fired only when the mouse enters/leaves the specified element. Nested elements do not come into play. This following is a test page. You need Firebug to view the console output. Or use the JavaScript Executor bookmarklet. If none of these are available, an alert will popup (but you won't be able to fully test with alert.). <!DOCTYPE HTML> <html> <head> <title>jQu... For the above test page, when you move the mouse through both the outer and inner areas of the mouseover/mouseout rectangle, the output is...
Previous  1 2 3 4 5 6 7 8 9 10 Next