I want to do an interesting thing and up to now did not find any solution to solve it.
I want to set the focus property of an element.
Given a simple image object with a clientside click event setfocusitem(‘elementid’);
There is a script block on page to handle this click event.
Here is my javascript code:
function setfocusitem(item){
setTimeout(function() {
var elem = CAF.model("#{activePageBean.clientIds['"+item+"']}");
elem.setFocused(true);
}, 1000);
}
It gets binding expression error.
My question is that, how to concatenate the correct expression string in javascript.
I want to use this javascript function from page, from more controls with different parameter, so it means the parameter ‘elementid’ is always different.