views:

55

answers:

2

Hello, I have a function that allows me a selection from a list to update a table. When I tested in FireFox it works without problem But my application should also run IE6 and when I test any results my table does not update much but I get to put my lines in my table.

My script:

<script type="text/javascript">
function actualiserDLIS(){
 var url = 'administration/gestionUtilisateurs.do?method=actualisationDLIs';
 var params =  'DR='+encodeURIComponent(document.getElementById('selectDR').value);
    var myAjax = new Ajax.Request(
            url, 
            {   method: 'post',
             parameters: params,
                onComplete: majDLIS
            });
}

function majDLIS(retour){
 if (retour.status == 200)
    {
        alert("Retour Status: "+retour.responseText);
        document.getElementById('tableDLI').innerHTML = retour.responseText;
    }else{
      document.getElementById('tableDLI').innerHTML = "uncool";
    }

} 
</script>

My Body:

<table class="tabForm" id="tableDLI">
   <c:forEach var="DLI"   items="${sessionScope['fiscalite.AdministrationGestionUtilisateurForm'].DLISUtilisateur}"  varStatus="status" >
      <tr>
         <td class="label_tableau_type1 width200px" ><c:out value="${DLI.code}"/>
         </td>            
      <td class="width150px" colspan="3"><html:checkbox property="DLI(${status.count-1})"/>
         </td>
      </tr>
       </c:forEach>
      </table>
+2  A: 

In IE table.innerHTML is readonly. Ref: http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx

They have another article for building tables dynamicly: http://msdn.microsoft.com/en-us/library/ms532998(v=VS.85).aspx

Or you could just replace the table.

benjynito
Or you could just replace the table ..?
Mercer
I was thinking outerHTML on the table (you'd need additional markup) or removing the element and creating a replacement element.
benjynito
jQuery does make manipulating tables so nice though: ;) http://stackoverflow.com/questions/171027/jquery-add-table-row
benjynito
i have download jquery (jquery-1.4.2.min.js) how can i integrate this on my java project .?
Mercer
You'll include it in your website. Here is a tutorial on getting started with jquery: http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
benjynito
+2  A: 

The answer here is simple, IE6 is pure, unadulterated evil. Don't support it. Even if you get all your styling and javascript to work in IE6, it will work slowly. In 2010 IE7 should be the minimum required browser.

Mike Cellini