Hi all,
I have problems setting an Apex item via Javascript. The Value comes from a cookie, so first step by step my code:
1) Create Cookie with encrypted ID
<script type="text/javascript">
document.cookie = 'NACookie=A422313E7F62D04D12347E7DE85DC53E; expires=; domain=&DOMAIN.; path=/';
</script>
2) read Cookie Value and pass it to Varibale (id_per_knd_na)
<script type="text/javascript">
function readNACookie()
{
var name = "NACookie";
var nameEQ = name + "=";
var ca = document.cookie.split( ';');
var retval = "";
for( var i=0;i < ca.length;i++)
{
var c = ca;
while ( c.charAt( 0)==' ') c = c.substring( 1,c.length);
if ( c.indexOf( nameEQ) == 0) return c.substring( nameEQ.length,c.length);
}
return retval;
}
var id_per_knd_na = readNACookie();
Till to this point everything works fine, i see in the dom tree that i_id_per_knd_na is set correctly to the cookie value "A422313E7F62D04D12347E7DE85DC53E".
But now, i was unable to set a hidden apex page item to this value, heres my last code snippet for this:
$s('P1_ID_PER_KND_NA_CRYPT',id_per_knd_na)
Any ideas to set the page item correctly?
Thanks for your help!
- daniel