In JSF, tag is used to render a dropdown box – HTML select element with “size=1” attribute. The following example will show how to select a City from list of Cities and save the Postal Code for a given user using SEAM . In the above code “userForm.postalCode” refers to model “UserForm” with property postalCode,Continue reading “SEAM and SelectOneMenu example”
Author Archives: anthonykuong
10 Steps to configure a CRUD Web application using Spring,Hibernate, and JSP
Here are the basic steps (broad overview) to create a CRUD (Create,Read,Update,Delete) Web application using Spring, Hibernate and a DB Provider such as MySql. I’ll make another future post to outline the details. 1. Using Eclipse (Juno is the latest as of this post), setup a Dynamic Web Project and convert it to mavenContinue reading “10 Steps to configure a CRUD Web application using Spring,Hibernate, and JSP”
How To Setup Ruby on Rails with Postgres
Introduction Postgres (or PostgreSQL) is an open source database. Ruby on Rails is an open source web framework written in Ruby. Rails is database agnostic, meaning it can be used with a variety of different databases. By default it assumes that MySQL is being used, but it’s quite easy to use with Postgres instead. ThisContinue reading “How To Setup Ruby on Rails with Postgres”
jQuery.hide( ) issue.
I have discovered a small issue in the jQuery hide() and show() methods, doing a $j(#ID_ELEM).hide() will append a <span style > attribute causing possibly layout changes on the element you are trying to transform. This is because the jQuery hide() and show() methods “animate the width, height, and opacity of the matched elements simultaneously” so as the height andContinue reading “jQuery.hide( ) issue.”
Hibernate Saving Collections (using @ElementCollection)
In this example you will learn how to deal with persisting entities that have members that are collections like lists, and maps. We will use the @ElementCollection annotation. to define the collection of Embeddable objects. As a disclaimer, this is not a typical usage of Embeddable objects as the objects are not embedded in theContinue reading “Hibernate Saving Collections (using @ElementCollection)”
Format numbers in Javascript
For those who are trying to format a price in JavaScript given a float, here are two functions that can do this.
jQuery toggle() does not work in IE8
I have discovered today that jQuery toggle() does not working property in Internet Explorer 8 or 9. First I tried using toggle: This works in Chrome and Firefox but not Internet Explorer 8. I then changed it to this:
Rotating Text with CSS
To rotate text using CSS in different browsers , use the css id selector rotateText. Thus the style rule below will be applied any html element with id=”rotateText” ( The id selector uses the id attribute of the HTML element, and is defined with a “#”, if you want to use the class selector forContinue reading “Rotating Text with CSS”
Why do you get a ConcurrentModificationException when using an iterator?
The reason why you would get a ConcurrentModificationException The java.util Collection classes are fail-fast, which means that if one thread changes a collection while another thread is traversing it through with an iterator the iterator.hasNext() or iterator.next() call will throw ConcurrentModificationException . Even the synchronized collection wrapper classes SynchronizedMap and SynchronizedList are only conditionally thread-safe,Continue reading “Why do you get a ConcurrentModificationException when using an iterator?”
Integrating jQuery into an existing SEAM project
If you require jQuery in a Java SEAM project (or a web application using JSF or Struts but embedding Richfaces in it), you’ll need to redefine jQuery’s $() shortcut to avoid conflict with prototype.js which is widely used in Richfaces framework Luckily you can use a4j’s loadScript function since as of Richfaces 3.0, jQuery hasContinue reading “Integrating jQuery into an existing SEAM project”