UIViewRoot viewRoot = FacesContext.getCurrentInstance().getViewRoot();
viewRoot.setLocale(new Locale("de"));
Sunday, December 19, 2010
Setting locale programmatically in jsf
Friday, December 17, 2010
Setting value through EL in JSF
public static void setObject(String expression, Object newValue) {
FacesContext facesContext = getFacesContext();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
ValueExpression valueExp =
elFactory.createValueExpression(elContext, expression,
Object.class);
//Check that the input newValue can be cast to the property type
//expected by the managed bean.
//Rely on Auto-Unboxing if the managed Bean expects a primitive
Class bindClass = valueExp.getType(elContext);
if (bindClass.isPrimitive() || bindClass.isInstance(newValue)) {
valueExp.setValue(elContext, newValue);
}
}
Resolving Method expression programmatically In JSF
public static Object resloveMethodExpression(String expression,
Class returnType,
Class[] argTypes,
Object[] argValues) {
FacesContext facesContext = getFacesContext();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
MethodExpression methodExpression =
elFactory.createMethodExpression(elContext, expression, returnType,
argTypes);
return methodExpression.invoke(elContext, argValues);
}
Resolving EL programmatically to retrieve value
public static Object resolveExpression(String expression) {
FacesContext facesContext = getFacesContext();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
ValueExpression valueExp =
elFactory.createValueExpression(elContext, expression,
Object.class);
return valueExp.getValue(elContext);
}
Wednesday, October 27, 2010
CSS Classes for ADF Faces Component
ADF CSS Selectors
Sunday, October 24, 2010
Android Permissions
http://developer.android.com/reference/android/Manifest.permission.html
Thursday, October 14, 2010
ActionListener versus Action
Tuesday, September 28, 2010
ADF Iterator's RangeSize Property
Tuesday, September 14, 2010
Which Collection Should be used when?
* Use Hashtable if there are multiple threads and HashMap if there is only a single thread.
* Use StringBuffer if there are multiple threads and StringBuilder if there is only a single thread.
For explanation visit Skeleton Coder
Sunday, September 12, 2010
Html Host Page In GWT
Sunday, September 5, 2010
Creating more than one folder as client in GWT
Saturday, August 28, 2010
Static Imports
Wednesday, August 18, 2010
Friday, August 6, 2010
Programmatically Setting Filter for ADF Table
DCBindingContainer bc = (DCBindingContainer)context.getApplication().evaluateExpressionGet(facesContext, "#{bindings}", DCBindingContainer.class); if (bc != null){ DCIteratorBinding ib = (DCIteratorBinding)bc.getIterBindings().get(p_binding); if (ib != null) ViewObject vo = ib.getViewObject(); if (vo != null) vo.setWhereClause('your clause'); }
Tuesday, July 20, 2010
Calling super class method in javascript
Refresh a ADF component programmatically
- Bind that component to some property of bean
- get reference of AdfFacesContext by AdfFacesContext.getInstance()
- add that component as a partial target like adfFacesContext.addPartialTarget(comp_binding)
Wednesday, July 14, 2010
Open-jACOB Draw2D selecting a figure
g_workflow.setCurrentSelection(figure);
g_workflow.showResizeHandles(figure);
Tuesday, July 13, 2010
Use minimal version of javascript to speedup downloading
Saturday, July 10, 2010
IE CSS Compatibility Model
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">