* Sets page request variables
*
* @param ctx
*/
private void exposeVariables(FaceletContext ctx) {
VariableMapper vm = ctx.getVariableMapper();
if (vm == null) {
return;
}
ColumnsHandlerIterationContext itContext = getIterationContext();
if (itContext.getItemId() != null) {
if (value != null) {
ValueExpression srcVE = value.getValueExpression(ctx, Object.class);
ValueExpression ve = itContext.getVarExpression(ctx, srcVE);
vm.setVariable(itContext.getItemId(), ve);
}
}
// Set up index variable
if (itContext.getIndexId() != null) {
ValueExpression ve = new IteratedIndexExpression(itContext.getIndex());
vm.setVariable(itContext.getIndexId(), ve);
}
int componentsCount = itContext.getIndex() - itContext.getBegin();
if (componentsCount != 0) {
ValueExpression ve = ctx.getExpressionFactory().createValueExpression(
UIViewRoot.UNIQUE_ID_PREFIX + componentsCount, String.class);
vm.setVariable(ITERATION_INDEX_VARIABLE, ve);
}
}