Hi all,
This is my first post and is definately going to show my Javascript inexperience though i hope with a bit of persistance I can become more equipped to program using this language.
Currently i'm having a problem understanding how to retrieve an array of objects (in this case javaFaces SelectItems) within javascript.
I have created a hidden field in my
jsp page because my understanding is you cannot parse through a parameter from
jsp to java:
Code:
<h:form id="test">
<h:inputHidden id="arrayOfSelectItems" value="#{arrayOfSelectItems}" />
</h:form>
The value is obtained from my java page.
My problem is using this ArrayOfSelectItems for use withing my javascript code. I've hunted to find examples without luck. I have tried the following code.
Code:
var list = document.getElementById("test:arrayOfSelectItems");
which will allow me to see an output of (javax.face.model.SelectItem, javax.faces.model.SelectItem, etc) when i use list[0].value. So i can see the objects though cannot access the data within.
Am i on the right track using this javascript method or is there another way objects are supposed to be used?
Any help or push in the right direction would be greatly appreciated.
Thankyou