You need to sign in to do that
Don't have an account?
Not able to pass the list of objects to javascript from the controller.
Hi,
I am not able to send the List of Objects to javascript to generate the bar or pie chart.
Here is the scenario. There is an apex controller class 'Agents' in that there is a method gettopNAgents() which returns List of Objects(Agents) .
I am calling this method in <apex:Pageblocktable id="table" value="{!topnAgents}" var="com">......</a..:pbt> component to display all the agents with their respective commission. The data is getting displayed in the table properly but I am not able to send the List to the javascript. I tried calling onRowClick event on pageBlocktable component and oncomplete event on commandbutton component both were not working.
In javascript I have used var m = document.getElementById(" {!$component.table}"), var e = "{!topnAgents}" both were not working. Can any one help me in this.
<script>
var m = document.getElementById(" {!$Component.block.table}");
</script>
<apex:pageBlock id='block'>
<apex:pageBlockTable id='table'>
Notice how the full path from the javascript to the table is given using id's and dot notation. If this does not solve the problem you may want to try posting more of your code.
-David
If the component you want to access is a direct descendant or a sibling of the $Component variable in the DOM hierarchy
should read something more like:
If the component you want to access is a direct descendant or a sibling of the $Component variable in the visualforce component hierarchy
$Component is a server side (page formula) concept is not DOM related directly - rather it is visualforce component id centric and it value is the client id (DOM id).
I'll see about getting the documentation corrected.
Message Edited by dchasman on 07-11-2008 12:29 PM