// (At which point the self restore overwrites any id set prior.). As this manual
// set is using the already encoded (saved) value we could end up with a doubly
// encoded id until the restore overwrites. To avoid this -- first test if
// its already encoded and don't re-encode.
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
String namespace = ec.encodeNamespace("");
if (!id.startsWith(namespace))
{
id = namespace + "_" + id;
}
// now indicate that this id is encoded