voyent
ace:ajax onComplete calls Javascript but the outcome is not shown in client  XML
Forum Index -> Components
Author Message
DirkKuzaj_RZF

Joined: 08/Jun/2017 04:25:33
Messages: 1
Offline


Hi!

I've got a ace:dataTable with an ajax-Tag for the deselect-event. onComplete a Javascript function is called which runs through to the end and produces a simple click-event. But this event is not done in the table. I put an alert into the function to see, that it reaches the endpoint.

the ajax looks like this:

<ace:ajax event="deselect" onComplete="return konterkariereUnselectHinweise(event);"
render="@this form:status" execute="@this" />

the javascript:

function konterkariereUnselectHinweise(ev)
{
if (!ev) {
ev = window.event;
}
ev = selectEventGlobal;
var srcElement = ev.srcElement ? ev.srcElement : ev.target;
var srcElementId = ev.srcElement ? ev.srcElement.id : ev.target.id;

if (ev.button != null) {
if (ev.button == 2) {
}
else {
if (ev.button == 0 || ev.button == 1) {
var string = srcElementId;
var treffer = string.search(/.*Tabelle.*/);
if (treffer != -1) {
if (window.addEventListener) {
var evt = document.createEvent("MouseEvents");
evt.initEvent("click", true, true);
srcElement.dispatchEvent(evt);
alert("maus klick!");
}
else {
document.getElementById(ev.srcElement.id).click();
}

return true;
}
}
}
}
selectEventGlobal = null;
}

the selectEventGlobal is set during another javascript call and is correctly initialized

what am i missing here?

Thanks in advance
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team