You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marc Eckart <ma...@googlemail.com> on 2007/08/30 13:50:46 UTC

Dojo-In-Struts2-Problem: IE works FF not...

Hi,

I have a struts div-Tag with:

This refreshes a jsp when the refreshSelectedCustomer topic is published. If
this happens the sessionContext Action is called (As far as I understand it)

In the selectedCustomer.jsp I have a href where I call a javascript which
publishes the topic as well as a click on a table in the main jsp.

Entfernen

Javascripts:
function mainJspFuntion() {
// update context via ajax
document.getElementById('selectedIpNbr').value = ipNbr;
document.getElementById('contextAction').value = 'SET_SESSION_CONTEXT';
dojo.event.topic.publish("/refreshSelectedCustomer");
}

function removeSelectedIp() {
document.getElementById('selectedIpNbr').value = '';
document.getElementById('contextAction').value = 'REMOVE_SESSION_CONTEXT';
dojo.event.topic.publish("/refreshSelectedCustomer");
}

In IE all works like expceted, but in Firefox I get a error:

TypeError: event has no properties
(no name)(undefined, undefined)search.js (line 206)
run()dojo.js (line 4868)
(no name)()dojo.js (line 4767)
_4a5([Window search.action, "__0", undefined, 4 more...])dojo.js (line 4841)
_4b5()dojo.js (line 4855)
forEach([[Window search.action, "__0", undefined, 4 more...], [[Widget
struts:binddiv, selectedCustomer] children=[1] extraArgs=Object
_styleNodes=[0], "refresh", undefined, 4 more...]], function(),
undefined)dojo.js (line 3127)
run()dojo.js (line 4878)
(no name)()dojo.js (line 4767)
publish(Object topicName=/refreshSelectedCustomer, undefined)dojo.js (line
4975)
removeSelectedIp()search.js (line 105)
onclick(click clientX=0, clientY=0)search.action (line 1)
[Break on this error] throw _13||Error(_12);

I have no clue where I shall look.
Any advice?

Thank you

Re: Dojo-In-Struts2-Problem: IE works FF not...

Posted by Musachy Barroso <mu...@gmail.com>.
If you need to prevent the request you would need it. Topics have
changed quite a bit between releases, if you are using 2.0.9, then the
topic takes 3 parameters, and it is published before the request,
after the request and when there is an error.

http://struts.apache.org/2.x/docs/ajax-tags.html

musachy

On 8/30/07, Marc Eckart <ma...@googlemail.com> wrote:
> 2007/8/30, Musachy Barroso <mu...@gmail.com>:
> >
> > Well, it is on search.js line 206 ;)
> >
> > musachy
> >
>
> Ah, sometimes I'm blind. Firebug hide this info and I didn't take a closer
> look at my pastet content :-)
>
> On line 206 is this:
>
>     // prevent refreshSelectedCustomer AJAX requests, if IpNbr is empty
>     dojo.event.topic.subscribe("/refreshSelectedCustomer", function(event,
> widget) {
>       var ipNbr = document.getElementById("selectedIpNbr").value;
>       if (!ipNbr || ipNbr == "") {
>     //      event.cancel= true;
>       }
>
>     });
>
>
> After I commented out the event.cancel all worked fine. A colleague of mine
> put this there. Is it necessary or can I simply skip it?
>
> Thanx alot :-)
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Dojo-In-Struts2-Problem: IE works FF not...

Posted by Marc Eckart <ma...@googlemail.com>.
2007/8/30, Musachy Barroso <mu...@gmail.com>:
>
> Well, it is on search.js line 206 ;)
>
> musachy
>

Ah, sometimes I'm blind. Firebug hide this info and I didn't take a closer
look at my pastet content :-)

On line 206 is this:

    // prevent refreshSelectedCustomer AJAX requests, if IpNbr is empty
    dojo.event.topic.subscribe("/refreshSelectedCustomer", function(event,
widget) {
      var ipNbr = document.getElementById("selectedIpNbr").value;
      if (!ipNbr || ipNbr == "") {
    //      event.cancel= true;
      }

    });


After I commented out the event.cancel all worked fine. A colleague of mine
put this there. Is it necessary or can I simply skip it?

Thanx alot :-)

Re: Dojo-In-Struts2-Problem: IE works FF not...

Posted by Musachy Barroso <mu...@gmail.com>.
Well, it is on search.js line 206 ;)

musachy

On 8/30/07, Marc Eckart <ma...@googlemail.com> wrote:
> 2007/8/30, Musachy Barroso <mu...@gmail.com>:
> >
> > Any idea what "event" is referring to?
> >
> > musachy
> >
> >
> No not really. How can I find out, which event is used? The dojo.js is not
> really human readable...
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Dojo-In-Struts2-Problem: IE works FF not...

Posted by Marc Eckart <ma...@googlemail.com>.
2007/8/30, Musachy Barroso <mu...@gmail.com>:
>
> Any idea what "event" is referring to?
>
> musachy
>
>
No not really. How can I find out, which event is used? The dojo.js is not
really human readable...

Re: Dojo-In-Struts2-Problem: IE works FF not...

Posted by Musachy Barroso <mu...@gmail.com>.
Any idea what "event" is referring to?

musachy

On 8/30/07, Marc Eckart <ma...@googlemail.com> wrote:
> Hi,
>
> I have a struts div-Tag with:
>
> This refreshes a jsp when the refreshSelectedCustomer topic is published. If
> this happens the sessionContext Action is called (As far as I understand it)
>
> In the selectedCustomer.jsp I have a href where I call a javascript which
> publishes the topic as well as a click on a table in the main jsp.
>
> Entfernen
>
> Javascripts:
> function mainJspFuntion() {
> // update context via ajax
> document.getElementById('selectedIpNbr').value = ipNbr;
> document.getElementById('contextAction').value = 'SET_SESSION_CONTEXT';
> dojo.event.topic.publish("/refreshSelectedCustomer");
> }
>
> function removeSelectedIp() {
> document.getElementById('selectedIpNbr').value = '';
> document.getElementById('contextAction').value = 'REMOVE_SESSION_CONTEXT';
> dojo.event.topic.publish("/refreshSelectedCustomer");
> }
>
> In IE all works like expceted, but in Firefox I get a error:
>
> TypeError: event has no properties
> (no name)(undefined, undefined)search.js (line 206)
> run()dojo.js (line 4868)
> (no name)()dojo.js (line 4767)
> _4a5([Window search.action, "__0", undefined, 4 more...])dojo.js (line 4841)
> _4b5()dojo.js (line 4855)
> forEach([[Window search.action, "__0", undefined, 4 more...], [[Widget
> struts:binddiv, selectedCustomer] children=[1] extraArgs=Object
> _styleNodes=[0], "refresh", undefined, 4 more...]], function(),
> undefined)dojo.js (line 3127)
> run()dojo.js (line 4878)
> (no name)()dojo.js (line 4767)
> publish(Object topicName=/refreshSelectedCustomer, undefined)dojo.js (line
> 4975)
> removeSelectedIp()search.js (line 105)
> onclick(click clientX=0, clientY=0)search.action (line 1)
> [Break on this error] throw _13||Error(_12);
>
> I have no clue where I shall look.
> Any advice?
>
> Thank you
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org