[HTML_AJAX-devel] Problem with method replaceNode in IE, please help
Rafael Avaria G
ravaria at multiecast.com
Tue Oct 16 08:32:18 MST 2007
$response->replaceNode('main', 'table', array('innerHTML' =>
$tpl->fetch("screen.tpl"), 'id' => 'main'));
this method work fine in firefox but in IE 6 give an unkown error at
compile time -2146827688, when innerHTML have a big HTML source, see attach.
this is the complete source:
public function drawHtml($param = '%'){
$tpl = new MecTr_Smarty();
$response = new HTML_AJAX_Action();
$lista = $this->listUser($param); // this method is a SQL call
if ( is_array($lista) ){
$action = Array( "edit" => true,
"delete" => true,
"activar" => true,
"reglas" => false );
$tpl->assign('action',$action);
$tpl->assign('lista',$lista);
$tpl->assign('user',true);
// $response->insertAlert($tpl->fetch("screen.tpl")); // debug,
work fine in IE and Firefox
$response->replaceNode('main', 'table', array('innerHTML' =>
$tpl->fetch("screen.tpl"), 'id' => 'main')); // fail in IE 6
}else{
$response->insertAlert('No se ha podido ejecutar esta accion'); //
work fine in Firefox and IE
}
return $response;
}// fin funcion drawHtml
here is screen.tpl.
{literal}
<script type="text/javascript">
function wsubjet (ele,str){
ele.subjet = str;
getRemoteClass(ele);
}
</script>
{/literal}
<table id="main">
{* Seccion de listar elementos *}
{foreach key=llave item=elemento from=$lista name=list}
<tr>
{if $action.edit eq "true"}
<td style="width:50px;">
<a href=""><img src="images/edit.gif" alt="Editar"/></a>
</td>
{/if}
<td style="width:auto;text-align:left;">
{if $user eq "true" }
<form name="form{$smarty.foreach.list.iteration}"
id="userform{$smarty.foreach.list.iteration}" >
<input name="idUser" type="hidden" value="{$elemento[0]}" >
<input name="subjet" type="hidden" value="" >
<span>Nombre de Usuario: {$elemento[1]}</span>
</form>
{/if}
</td>
{if $action.delete eq "true"}
<td style="width:50px;">
<a
href="javascript:wsubjet(document.form{$smarty.foreach.list.iteration},'Borrar')">
<img src="images/delete.gif" alt="Borrar"/></a>
</td>
{/if}
{if $action.activar eq "true"}
<td style="width:50px;">
<a
href="javascript:wsubjet(document.form{$smarty.foreach.list.iteration},'Activar')"
>
<img src="images/active.gif" alt="Activar"/>
</a>
</td>
{/if}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dibujo.GIF
Type: image/gif
Size: 7416 bytes
Desc: not available
Url : http://lists.bluga.net/pipermail/html_ajax-devel/attachments/20071016/326064bc/attachment.gif
More information about the Html_ajax-devel
mailing list