hi All,
I am facing an issue in retrieving values from a dynamic table at client side using CAF javascript.
Let me explain my problem with an example:
- In my portlet, I have a table which is binded to a SelectableListTableContentProvider.
- In the table, I have a button (which will be rendered per each row in the dynamic table at run time).
- wrote following code in the ‘on click’ event:
var table = CAF.model("#{activePageBean.clientIds['myTableId']}");
var row = table.get(0);
var sampleTextId= row.getControlId("sampleText");
var sampleTextObj = CAF.model(sampleTextId);
alert(sampleTextObj.getValue());
- I am expecting it to give the ‘sampleText’ value present in the 0th row.
But it is giving javascript error 'Object doesn’t support this property or method’ at line 2 in the above code.
I am suspecting that it is not treating variable ‘table’ as a CAF.Table.Model object.
If I put a button outside of this dynmaic table and put the same javascript in the ‘onclick’ event, then i am able to get the ‘sampleText’ value.
But, as per my requirement, I have to execute this javascript onclick of the button which is rendered on each row present in the table.
Could you please advise why the javascript for the button present inside table is not working?
Please find the attached package which illustrates in detail.
(we are using webMethods 7.1.2 product suite).
Kind regards,
Raja sekhar Kintali
SAGUpload2.zip (16 KB)