-
1. JS function is not working
ilya40umov Feb 14, 2011 8:01 AM (in response to ramram888)As a workaround you can add some specific css style for h:selectOneRadio and use JQuery for adding onclick handler in rich:datascroller's oncomplete event.
-
2. JS function is not working
nbelaevski Feb 14, 2011 6:53 PM (in response to ilya40umov)Hi,
I am not able to locate a4j:jsFunction in the posted code - am I missing something?
-
3. JS function is not working
ramram888 Feb 15, 2011 2:44 AM (in response to nbelaevski)Hi Nick,
the JS function is called when clicking on the radio button (onclick="selectOneRadio(this)") , this is working properly only on the first page of the data table when flipping to the next page the JS function is not working anymore.
Regards,
-
4. JS function is not working
ramram888 Feb 15, 2011 2:49 AM (in response to ilya40umov)Hi Ilya,
I dont know if u got my problem " The JS function is working properly only on the first page of the data table when flipping to the next page the JS function is not working anymore." ( <h:selectOneRadio value="" onclick="selectOneRadio(this)" this is how the JS function is called ). I have this as a general behvior in all the application and i need a general work around to fix it.
Thanks for ur help
-
5. JS function is not working
nbelaevski Feb 15, 2011 3:38 PM (in response to ramram888)Where is jsFunction located: inside table or outside it?
-
6. JS function is not working
ramram888 Feb 16, 2011 3:43 AM (in response to nbelaevski)The jsFunction is located inside the table.(please refer to the code posted above)
-
7. JS function is not working
nbelaevski Feb 16, 2011 3:46 AM (in response to ramram888)But I can't locate a4j:jsFunction there - maybe the code got crippled after paste to the forum?
-
8. JS function is not working
ramram888 Feb 16, 2011 7:39 AM (in response to nbelaevski)OK i got ur point the jsFunction is located in a js file. here is the missing part of the code
<head>
<script type="text/javascript" src="/ipmSuite/javascript/adm/doc/FrmDocumentUpload.js"></script>
</head>
here is the function body (located in FrmDocumentUpload.js)
function selectOneRadio(param) {
cnt = 0;
while (document.getElementById("documentUploadFrm:filesTbl:"+cnt+":fileName") != null)
{
document.getElementById("documentUploadFrm:filesTbl:"+cnt+":checked:0").checked = false;
if (document.getElementById("documentUploadFrm:filesTbl:"+cnt+":checked").id+':0' == param.id)
{
document.getElementById("documentUploadFrm:filesTbl:"+cnt+":checked:0").checked = true;
}
cnt++;
}
}
Thanks for ur help Nick
-
9. JS function is not working
ramram888 Feb 18, 2011 3:43 AM (in response to ramram888)Any updates on the above issue. any help is appreciated
Thanks
-
10. Re: JS function is not working
nbelaevski Feb 18, 2011 4:14 AM (in response to ramram888)Obviously
(document.getElementById("documentUploadFrm:filesTbl:"+cnt+":fileName") != null)
is true for the first page only. Use jQuery/Prototype to traverse the nodes - it will be much more supportable.
BTW, cnt is global variable in your case - should be made local.
-
11. JS function is not working
ramram888 Feb 23, 2011 5:28 AM (in response to nbelaevski)Thanks a lot for your help Nick, i really appreciate it. can you provide me with useful references since i am new to jQuery.
Best Regards,
-
12. JS function is not working
nbelaevski Feb 23, 2011 7:42 AM (in response to ramram888)Sure, http://jquery.com/ has lot of useful documentation.
-
13. JS function is not working
ramram888 Mar 7, 2011 10:04 AM (in response to nbelaevski)Hi Nick,
Let me re-explain what is going wrong with my application. In the datatable i have to select only one row so i added a radio button on each row and manage using a JS function in order to allow only once selection. This function is working well unless the first page is flipped, the JS function is not working anymore on the next pages.
As per your advice i used jQuery and the problem is still reproduced. Jquery function works properly until the first page is flipped.
I was checking JQuery tutorial in Live Demo and i encoutered the same problem that i m facing. I applied "Zebra-styled table with rich:jQuery example". In my application the style was applied correctly to the "rich:dataTable" but when i flipp the page the zebra style is not appliad anymore and the old style appears again.
http://livedemo.exadel.com/richfaces-demo/richfaces/jQuery.jsf
This is exactly the same problem i m facaing now. when I flipp the rich:dataTable page the jQuery is not working anymore it is only applied to the first page.
Please let me know that is ur opinion concerning this problem.
Regards,
-
14. JS function is not working
nbelaevski Mar 7, 2011 10:29 AM (in response to ramram888)How does page code look like now?