-
1. Re: How to write to attributes with the CDK?
blabno Jun 17, 2010 4:49 PM (in response to pjmlp)In renderer for exemple you can do:
ValueExpression valueExpression = getFacesContext().getApplication().getExpressionFactory().createValueExpression(getFacesContext().getELContext(), "#{" + getVar() + "}", Object.class);
List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
for (int i = 0; i < dataModel.getRowCount(); i++) {
dataModel.setRowIndex(i);
valueExpression.setValue(elContext, dataModel.getRowData());//...do something, i.e. render children that have bindings to "var" value
}
-
2. Re: How to write to attributes with the CDK?
pjmlp Jun 18, 2010 3:37 AM (in response to blabno)If I understood it correctly, your suggestion only works if you are giving the output variable to child tags, which is not our use case.
I want to be able to do the following:
{code:xml}
<mytag attribute="value" outputVar1="my_var1" outputVar2="my_var2"/>
<h:outputText value="#{my_var1}"/>
<h:outputText value="#{my_var2}"/>
{code}
I know how to do this with the Facelets API directly, but the CDK generates the Facelets tag handler, so the question is how to handle attribute creation with the CDK?