zwwcn

Just another WordPress.com site

Monthly Archives: September 2012

inconsistent tab height in rich tabs

problem happens in IE, Safari. we should apply same height for all tabs.

<style type=”text/css”>
.rich-tab-header{ height:35px; }
</style>

Get midnight time for a date

Calendar cal = Calendar.getInstance();
cal.setTime(dateTime);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();

 

 

validation on jsf popup model panel

if validation failed , popup should remain open

msgPanel is the output panel inside theĀ  popup model panel

<a4j:commandButton id=”saveActivity” action=”#{createActivity.saveActivity}” value=”Save”
styleClass=”btn alignright btn_green smallFont” reRender=”msgPanel,activitiesList”
oncomplete=”if (#{facesContext.maximumSeverity == null}){closeModalPanel(‘activityPanel’);return false}”/>