Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

preInvokeJS does not work for <a> tag

Célio Cidral Junior

2007-01-02

Replies:

Hi,

The preInvokeJS attribute does not work for the <a> tag as described
in the example from <http://struts.apache.org/2.x/docs/a.html>. That
feature seems to be originated from the issue
<http://issues.apache.org/struts/browse/WW-912>. Below is a snippet of
my source JSP code.

<s:a href="%{delete}" preInvokeJS="confirm('%{getText('confirm-delete')}')">
 <s:text name="record.delete"/>
</s:a>

The anchor works properly, except that it does not call the confirm()
method. The generated HTML gives me this code:

<a href="/sed/listUsers!delete.do?id=1">Deletar</a>

And there's no occurrence of the word "confirm" in the whole HTML code
nor there's any reference to an external JS file.

I presume I'm not missing anything. Any guess whether this feature is
actually working or not?

Célio.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.