Web application R&D notes, from the world of Java, Flex, CSS, XHTML, Flash, .NET, cross-browser compatibility, JavaScript, AJAX, ADA compliance, Photoshop, and any and all things related to Web development!
30 September 2009
29 September 2009
28 September 2009
24 September 2009
22 September 2009
21 September 2009
15 September 2009
Google's Fast Flip
Google's introducing Fast Flip:
Fast Flip is a new reading experience that combines the best elements of print and online articles. Like a print magazine, Fast Flip lets you browse sequentially through bundles of recent news, headlines and popular topics, as well as feeds from individual top publishers. As the name suggests, flipping through content is very fast, so you can quickly look through a lot of pages until you find something interesting.
14 September 2009
TeemingPod provides interaction + collaboration tools
TeemingPod provides some interesting and promising tools to enable collaboration and interaction with web pages. It includes a free version which maxes out at 5 end users.
Some handy Photoshop utilities
John Nack provides another of his great articles on all things Adobe, including a way to make Photoshop setting portable.
Copy Firefox settings to another machine
Recently, I moved to a new machine and needed to copy all my Firefox bookmarks, cookies, and passwords from the old box. A neat little utility does the job: MozBackup by Pavel Cvrcek. It exports the information to a file which can then be used on the new PC to import the settings. It even remembered all the sites I'd visited. The move to the new system was made much less painful thanks to this free utility.
10 September 2009
Show/hide controls dynamically in JSF
We often need to show a set of controls dynamically based on what a user selects in a component in JSF. This example shows how to accomplish this in JSF and Seam, using the JBoss' EL extensions, which make life easier in your XHTML tags.
In this case, we're using an h:selectOneRadio control. We want to show and hide the rich:Panel controls; we wrap them in an a4j:outputPanel and then just re-render that when the user clicks a radio element. Note that for radio buttons, we have to use the onclick event; onchange is for h:selectOneMenu and other select controls.
In this case, we're using an h:selectOneRadio control. We want to show and hide the rich:Panel controls; we wrap them in an a4j:outputPanel and then just re-render that when the user clicks a radio element. Note that for radio buttons, we have to use the onclick event; onchange is for h:selectOneMenu and other select controls.
<h:selectoneradio value="#{webencode.requestType}" id="rdoRequestType" styleclass="radio" layout="pageDirection">We can't call the equalsIgnoreCase() method on a string from within an EL expression, so we use a Seam method call that returns true/false based on string equality:
<f:selectitem itemvalue="program" itemlabel="Series or Program">
<f:selectitem itemvalue="special" itemlabel="Special">
<a4j:support ajaxsingle="true" event="onclick" rerender="program">
</a4j:support>
<a4j:outputpanel id="program">
<rich:panel rendered="#{webencode.checkRequestType('program')}">
program stuff goes here
</rich:panel>
<rich:panel rendered="#{webencode.checkRequestType('special')}">
special stuff goes here
</rich:panel>
</a4j:outputpanel>
public Boolean checkRequestType(String requestType){With the a4j:support tag, we use AJAX to re-render the a4j:outputPanel when the user clicks the radio buttons. Then the custom checkRequestType() bean method is called and returns a Boolean based on the value of the radio button group.
return (this.requestType.equalsIgnoreCase(requestType)) ? true : false;
}
08 September 2009
07 September 2009
02 September 2009
Convert entity to selectItem in Seam
When using entity classes and Hibernate to display data in JBoss Seam, you can easily convert the entity to a selectItem element for use in a dropdown box, radio button group, or checkbox items. Here's an example:
Note the null element to allow users to leave the selection blank. You can also achieve this by using the noSelectionLabel attribute. Also of note is the itemValue attribute on the Seam selectItems tag: This enables a custom value instead of the automatic numeric ID generated by Seam. In this case, the entity's description is used for the value.
Here's what this code generates in HTML:
<h:selectOneMenu >
<f:selectItem itemLabel="" itemValue="#{null}"/>
<s:selectItems var="tape" itemValue="#{tape.description}"
value="#{tapeformatList.resultList}" label="#{tape.description}" />
<s:convertEntity/>
</h:selectOneMenu>
Note the null element to allow users to leave the selection blank. You can also achieve this by using the noSelectionLabel attribute. Also of note is the itemValue attribute on the Seam selectItems tag: This enables a custom value instead of the automatic numeric ID generated by Seam. In this case, the entity's description is used for the value.
Here's what this code generates in HTML:
<select name="tapeformatSearch:j_id14" size="1">
<option></option>
<option value="VHS">VHS</option>
<option value="DVD">DVD</option>
<option value="Beta-SP">Beta-SP</option>
<option value="Digi-Beta">Digi-Beta</option>
<option value="HD-Cam">HD-Cam</option>
<option value="DV-Cam">DV-Cam</option>
<option value="Mini-DV">Mini-DV</option>
<option value="DVC-PRO HD">DVC-PRO HD</option>
</select>
01 September 2009
Fix IE 6 and 7
If you work to make your pages cross-browser compatible, then you need to know about Dean Edwards fantastic script to get earlier versions of IE to behave like IE7 or IE8. Now you can have transparent PNG in IE 6, add minimum width/height, etc. Very neat stuff, and it works! Get the script and details on Dean's site.
Subscribe to:
Posts (Atom)