You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Francisco Exposito <fc...@hotmail.com> on 2008/09/09 12:58:09 UTC
Sorting with displaytag issue due to theme="ajax"
I am trying to show a table with some data using displaytag. I have a main page which contains the div which will contain the table with the data. Therefore I have in the main page <s:head theme="ajax">.
Then in the results page I have the display:table which shows the data.
But when I click over a column to sort or over a pagination number, I receive the error "Nothing to display" in the complete page, not in the div. How can I get the next results in the same div?
Also I've tried to use displayTagAjax. In order to use it, I define in the main page:
<script src="src/javascript/displayTagAjax.js" type="text/javascript"/>
<script src="src/javascript/jquery.js" type="text/javascript"/>
But when I reload this page, I receive the error "jQuery is not defined" and the error seems to be in the line of displayTagAjax.js:
jQuery(function($) {
changeLinks();
});
Thanks in advance.
_________________________________________________________________
Llega la nueva temporada. Consulta las nuevas tendencias en MSN Estilo
http://estilo.es.msn.com/moda/
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Martin Gainty <mg...@hotmail.com>.
the referencing jsp page is including the jquery javascript file
../../src/javascript/jquery.js
did you deploy all of your javascript libraries ..such as jquery.js to the struts webapp so the jsp can locate the js?
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Tue, 9 Sep 2008 05:38:26 -0700
> From: newton.dave@yahoo.com
> Subject: RE: Sorting with displaytag issue due to theme="ajax"
> To: user@struts.apache.org
>
> --- On Tue, 9/9/08, Francisco Exposito wrote:
> > Yes, it uses jquery. If I don't use struts2 ajax, it
> > works properly. But when I use it, I receive the error
> > jquery is not defined.
> >
> > This code works properly:
> > [...] <script language='javascript'
> > src="../../src/javascript/jquery.js"
> > type="text/javascript"></script>
> > <script src="../../src/javascript/displayTagAjax.js">
> > </script>
> > [...]
> >
> > but not this one:
> > [...] <script language='javascript'
> > src="src/javascript/jquery.js"
> > type="text/javascript"></script>
> > <script src="src/javascript/displayTagAjax.js">
>
> You should build the URLs for the JS files using JSTL or <s:url...>, if nothing else.
>
> Under Firebug is it clear that the jQuery file is even being loaded? It doesn't sound like it.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Dave Newton <ne...@yahoo.com>.
--- On Tue, 9/9/08, Francisco Exposito wrote:
> Yes, it uses jquery. If I don't use struts2 ajax, it
> works properly. But when I use it, I receive the error
> jquery is not defined.
>
> This code works properly:
> [...] <script language='javascript'
> src="../../src/javascript/jquery.js"
> type="text/javascript"></script>
> <script src="../../src/javascript/displayTagAjax.js">
> </script>
> [...]
>
> but not this one:
> [...] <script language='javascript'
> src="src/javascript/jquery.js"
> type="text/javascript"></script>
> <script src="src/javascript/displayTagAjax.js">
You should build the URLs for the JS files using JSTL or <s:url...>, if nothing else.
Under Firebug is it clear that the jQuery file is even being loaded? It doesn't sound like it.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Francisco Exposito <fc...@hotmail.com>.
Yes, it uses jquery. If I don't use struts2 ajax, it works properly. But when I use it, I receive the error jquery is not defined.
This code works properly:
<%@ page import="ads.web.action.UsuarioAction"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%
Object result = session.getAttribute( "result" );
//if( result == null )
{
UsuarioAction ac = new UsuarioAction();
System.out.println(ac.getTodosUsuarios());
session.setAttribute( "result", ac.getTodosUsuarios() );
}
%>
<html>
<head>
<script language='javascript' src="../../src/javascript/jquery.js" type="text/javascript"></script>
<script src="../../src/javascript/displayTagAjax.js">
</script>
</head>
<body>
<div id="ajxDspId">
<display:table name="sessionScope.result" pagesize="2" htmlId="dispTable" sort="list">
<display:column property="idUsuario" title="ID" />
<display:column property="nombre" sortable="true"/>
<display:column property="mail" sortable="true"/>
</display:table>
</div>
<!--- end display tag -->
<script>
</script>
</body>
</html>
but not this one:
<html>
<head>
<script src="src/javascript/optiontransferselect.js" type="text/javascript"/>
<script language='javascript' src="src/javascript/jquery.js" type="text/javascript"></script>
<script src="src/javascript/displayTagAjax.js">
<s:head theme="ajax"/>
<link rel="stylesheet" media="all" type="text/css" href="src/css/default.css" />
<script src="src/javascript/stuHover.js" type="text/javascript"></script>
</head>
<body>
CODE TO GO TO THE TABLE PAGE INSIDE THE DIV divContenedor
<s:div id="divContenedor" theme="ajax">
<s:actionerror/>
<s:actionmessage/>
</s:div>
</body>
> Date: Tue, 9 Sep 2008 04:14:50 -0700
> From: newton.dave@yahoo.com
> Subject: Re: Sorting with displaytag issue due to theme="ajax"
> To: user@struts.apache.org
>
> --- On Tue, 9/9/08, Francisco Exposito wrote:
> > But when I reload this page, I receive the error
> > "jQuery is not defined" and the error seems to be
> > in the line of displayTagAjax.js:
> >
> > jQuery(function($) {
> > changeLinks();
> > });
>
> It looks like the Ajax version of displaytag uses jQuery. Are you loading jQuery? Have you tried asking on a displaytag site/list/forum or wherever this tag lives?
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
¡Entra en el Club oficial de Messenger y te enterarás de todas las novedades!
http://www.vivelive.com/ilovemessenger
RE: struts2 tiles not work with s:submit - SOLVED
Posted by Francisco Exposito <fc...@hotmail.com>.
Changing s:submit like that works properly:
<s:submit action="EliminarUsuario"
value="Eliminar"
showLoadingText="false"
formId="datosUsuario"></s:submit>
> From: fcoexposito@hotmail.com
> To: user@struts.apache.org
> Subject: struts2 tiles not work with s:submit
> Date: Tue, 16 Sep 2008 10:26:10 +0000
>
>
> Hi,
>
> I've configured tiles2 with struts2 and I am trying to use some buttons with the same form, but when I click on it, the new page is not shown.
>
> I have done a test:
>
> This s:a access to the java class configured in the struts.xml file and goes to the results page, but with no info of the form.
>
>
> <s:url id="eliminarUsuario" action='EliminarUsuario'/>
> <s:a id="linkDatosPersonales"
> href="%{eliminarUsuario}"
> showLoadingText="false"
> formId="datosUsuario">Test</s:a>
>
>
> But if I define a s:submit, it access to the same java class but it doesn't go to the results page. It reloads the same page
>
> <s:submit theme="ajax"
> href="%{eliminarUsuario}"
> value="Eliminar"
> showLoadingText="false"
> formId="datosUsuario"></s:submit>
>
>
> Thanks in advance
>
> _________________________________________________________________
> ¿Eres un cotilla? Disfruta de todas las novedades en MSN Corazón
> http://entretenimiento.es.msn.com/corazon/
_________________________________________________________________
¡Entra en el Club oficial de Messenger y te enterarás de todas las novedades!
http://www.vivelive.com/ilovemessenger
struts2 tiles not work with s:submit
Posted by Francisco Exposito <fc...@hotmail.com>.
Hi,
I've configured tiles2 with struts2 and I am trying to use some buttons with the same form, but when I click on it, the new page is not shown.
I have done a test:
This s:a access to the java class configured in the struts.xml file and goes to the results page, but with no info of the form.
<s:url id="eliminarUsuario" action='EliminarUsuario'/>
<s:a id="linkDatosPersonales"
href="%{eliminarUsuario}"
showLoadingText="false"
formId="datosUsuario">Test</s:a>
But if I define a s:submit, it access to the same java class but it doesn't go to the results page. It reloads the same page
<s:submit theme="ajax"
href="%{eliminarUsuario}"
value="Eliminar"
showLoadingText="false"
formId="datosUsuario"></s:submit>
Thanks in advance
_________________________________________________________________
¿Eres un cotilla? Disfruta de todas las novedades en MSN Corazón
http://entretenimiento.es.msn.com/corazon/
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Francisco Exposito <fc...@hotmail.com>.
I am trying also to use doubleselect struts tag and its javascript code is not executed. It is only executed in main page, not in ajax result page... I think the issue is that javascript code is not executed in ajax results page. Therefore I can't use anything with javascript code... Anybody knows how do it?
> From: fcoexposito@hotmail.com
> To: user@struts.apache.org
> Subject: RE: Sorting with displaytag issue due to theme="ajax"
> Date: Fri, 12 Sep 2008 08:56:38 +0000
>
>
> This is not the issue because I've tried deleting optiontransferselect and stuHover... I think I only need to execute javascript in result page, but I don't know how. I don't know if executeScripts and separateScripts attributes in struts ajax tags could be a solution, but I can't implement because this tags will be on next release of struts2.
>
> Also, could it be a solution to change this ajax functionality by tiles plugin (then the javascript will be loaded in the page I need, I guess...)? Or anybody has a better solution?
>
>
>
> > Date: Thu, 11 Sep 2008 14:13:30 +1000
> > Subject: Re: Sorting with displaytag issue due to theme="ajax"
> > From: zoran@sparecreative.com
> > To: user@struts.apache.org; fcoexposito@hotmail.com
> >
> > I¹m not certain, but could this be a conflict between jquery and whatever
> > new js libraries you¹ve added:
> >
> > <script src="src/javascript/optiontransferselect.js"
> > type="text/javascript"/>
> > <s:head theme="ajax"/>
> > <script src="src/javascript/stuHover.js" type="text/javascript"></script>
> >
> >
> > I¹d look into these 3. That¹s probably where the issue lies.
> >
> > Z.
>
> _________________________________________________________________
> ¿Sigue el calor? Consulta MSN El tiempo
> http://eltiempo.es.msn.com/
_________________________________________________________________
¿Eres un cotilla? Disfruta de todas las novedades en MSN Corazón
http://entretenimiento.es.msn.com/corazon/
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Francisco Exposito <fc...@hotmail.com>.
This is not the issue because I've tried deleting optiontransferselect and stuHover... I think I only need to execute javascript in result page, but I don't know how. I don't know if executeScripts and separateScripts attributes in struts ajax tags could be a solution, but I can't implement because this tags will be on next release of struts2.
Also, could it be a solution to change this ajax functionality by tiles plugin (then the javascript will be loaded in the page I need, I guess...)? Or anybody has a better solution?
> Date: Thu, 11 Sep 2008 14:13:30 +1000
> Subject: Re: Sorting with displaytag issue due to theme="ajax"
> From: zoran@sparecreative.com
> To: user@struts.apache.org; fcoexposito@hotmail.com
>
> I¹m not certain, but could this be a conflict between jquery and whatever
> new js libraries you¹ve added:
>
> <script src="src/javascript/optiontransferselect.js"
> type="text/javascript"/>
> <s:head theme="ajax"/>
> <script src="src/javascript/stuHover.js" type="text/javascript"></script>
>
>
> I¹d look into these 3. That¹s probably where the issue lies.
>
> Z.
_________________________________________________________________
¿Sigue el calor? Consulta MSN El tiempo
http://eltiempo.es.msn.com/
Re: Sorting with displaytag issue due to theme="ajax"
Posted by Zoran Avtarovski <zo...@sparecreative.com>.
I¹m not certain, but could this be a conflict between jquery and whatever
new js libraries you¹ve added:
<script src="src/javascript/optiontransferselect.js"
type="text/javascript"/>
<s:head theme="ajax"/>
<script src="src/javascript/stuHover.js" type="text/javascript"></script>
I¹d look into these 3. That¹s probably where the issue lies.
Z.
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Francisco Exposito <fc...@hotmail.com>.
I've removed it (I thought it was mandatory the theme="ajax" in the s:div due to the previous code
<s:a id="linkBuscarUsuario"
theme="ajax"
href="%{buscarUsuario}"
targets="divContenedor"
showLoadingText="false">Buscar usuario</s:a>
It does the same, the results page is loaded but after sorting or pagination the results page is not opened in the div.
In fact, the scripts should be loaded only in the results page, not in the menu, but no javascripts are loadable in the results. I don't understand your last question:
return the relevant HTML plus the display taglib directive? How can I do it?
> Date: Wed, 10 Sep 2008 05:09:30 -0700
> From: newton.dave@yahoo.com
> Subject: RE: Sorting with displaytag issue due to theme="ajax"
> To: user@struts.apache.org
>
> --- On Wed, 9/10/08, Francisco Exposito wrote:
> > <s:div id="divContenedor" theme="ajax">
> > </s:div>
>
> Does it work if you remove *this* <s:div...>? Again--if the div itself isn't doing anything but is just a placeholder there's no reason to use <s:div...>, although I don't know if it would break anything.
>
> > <script language='javascript' src="src/javascript/jquery.js"
> > type="text/javascript"></script>
> > <script
> > src="src/javascript/displayTagAjax.js"></script>
> > <s:head theme="ajax"
> > debug="true"/>
> > </head>
>
> I would be wary of re-loading all the JavaScript. Does it work if you just return the relevant HTML plus the display taglib directive?
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Prueba los prototipos de los últimos en MSN Motor
http://motor.es.msn.com/
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Dave Newton <ne...@yahoo.com>.
--- On Wed, 9/10/08, Francisco Exposito wrote:
> <s:div id="divContenedor" theme="ajax">
> </s:div>
Does it work if you remove *this* <s:div...>? Again--if the div itself isn't doing anything but is just a placeholder there's no reason to use <s:div...>, although I don't know if it would break anything.
> <script language='javascript' src="src/javascript/jquery.js"
> type="text/javascript"></script>
> <script
> src="src/javascript/displayTagAjax.js"></script>
> <s:head theme="ajax"
> debug="true"/>
> </head>
I would be wary of re-loading all the JavaScript. Does it work if you just return the relevant HTML plus the display taglib directive?
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Francisco Exposito <fc...@hotmail.com>.
Dave, I'm lost... I don't see any difference but the ajax (between two executions I only change the struts.xml file). I'll try to explain again and please, if after my explanation you think there are too much differences, please tell me which differences do you see. But I think I've isolated all I can the issue...
I have the new menu modified deleting the s:div:
<%@ page pageEncoding="ISO-8859-1" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<script language='javascript' src="src/javascript/jquery.js" type="text/javascript"></script>
<script src="src/javascript/displayTagAjax.js"></script>
<s:head theme="ajax"/>
<link rel="stylesheet" media="all" type="text/css" href="src/css/default.css" />
</head>
<body>
<div id="divPagina">
<s:url id="buscarUsuario" action='IrBuscarUsuario'/>
<div id="divMenu">
<ul id="menu">
<li class="sub">Usuarios
<ul>
<li><s:a id="linkBuscarUsuario"
theme="ajax"
href="%{buscarUsuario}"
targets="divContenedor"
showLoadingText="false">Buscar usuario</s:a></li>
</ul>
</li>
</ul>
</div>
<s:div id="divContenedor" theme="ajax">
</s:div>
</div>
</body>
</html>
When I open the menu, the results page with the display tag must be loaded in the divContenedor defined in the menu page. The results page is:
<%@ page import="ads.web.action.UsuarioAction"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%
Object result = session.getAttribute( "result" );
UsuarioAction ac = new UsuarioAction();
System.out.println(ac.getTodosUsuarios());
session.setAttribute( "result", ac.getTodosUsuarios() );
%>
<html>
<head>
<script language='javascript' src="src/javascript/jquery.js" type="text/javascript"></script>
<script src="src/javascript/displayTagAjax.js"></script>
<s:head theme="ajax" debug="true"/>
</head>
<body>
<div id="ajxDspId">
<display:table name="sessionScope.result" pagesize="2" htmlId="dispTable" sort="list">
<display:column property="idUsuario" title="ID" />
<display:column property="nombre" sortable="true"/>
<display:column property="mail" sortable="true"/>
</display:table>
</div>
</body>
</html>
The unique thing I change between the two examples is the struts-xml file:
a) First execution:
<action name="Login" class="ads.web.action.LoginAction">
<result name="success_usuario_adsAdmin">/src/jsp/results.jsp</result>
</action>
When I login, the results page appear, the script displayTagAjax.js is executed, the references are updated and all work properly.
b) Second execution:
<action name="Login" class="ads.web.action.LoginAction">
<result name="success_usuario_adsAdmin">/src/jsp/menu.jsp</result>
</action>
When I login, the menu appears and then I click on "Buscar usuario". Then the
page with the results is loaded in the divContenedor. The script displayTagAjax.js is executed when I load the menu, but not when the results page is loaded. Therefore the hrefs are not modified and the ajax in displaytag doesn't work.
I hope I've explained better -if you have patient to read all this :)
> Date: Wed, 10 Sep 2008 04:14:27 -0700
> From: newton.dave@yahoo.com
> Subject: RE: Sorting with displaytag issue due to theme="ajax"
> To: user@struts.apache.org
>
> --- On Wed, 9/10/08, Francisco Expositowrote:
> > The unique difference I see is that the correct one
> > doesn't use ajax, isn't it?
>
> There's a huge number of differences between the two examples. That's not how you isolate a problem.
>
> The advice I provided stands; and I'd still remove the <s:div...> tags if you're not using their Ajax functionality.
>
> Dave
>
> >
> >
> >
> > > Date: Wed, 10 Sep 2008 03:37:30 -0700
> > > From: newton.dave@yahoo.com
> > > Subject: RE: Sorting with displaytag issue due to
> > theme="ajax"
> > > To: user@struts.apache.org
> > >
> > > There are too many differences between your two
> > examples. You should build up the functionality from one to
> > another until it breaks and start from there.
> > >
> > > One thing I'd comment is that if your divs are
> > just containers then don't use the <s:div...> tag,
> > as with the ajax theme they're really designed for
> > something else--just use HTML divs. I'd try that first,
> > then start to isolate the problem one step at a time.
> > >
> > > Dave
> > >
> > > --- On Wed, 9/10/08, Francisco Exposito wrote:
> > > > I've changed the order and now that error
> > doesn't
> > > > appear, but it doesn't work yet...
> > > >
> > > > I have done a test with this page:
> > > >
> > > > <%@ page
> > > >
> > import="ads.web.action.UsuarioAction"%>
> > > > <%@ taglib
> > uri="http://displaytag.sf.net"
> > > > prefix="display" %>
> > > >
> > > > <%
> > > > Object result = session.getAttribute(
> > "result" );
> > > > UsuarioAction ac = new UsuarioAction();
> > > > System.out.println(ac.getTodosUsuarios());
> > > > session.setAttribute( "result",
> > > > ac.getTodosUsuarios() );
> > > > %>
> > > > <html>
> > > > <head>
> > > >
> > > > <script language='javascript'
> > > > src="src/javascript/jquery.js"
> > > >
> > type="text/javascript"></script>
> > > > <script
> > > >
> > src="src/javascript/displayTagAjax.js">
> > > >
> > > > </script>
> > > > </head>
> > > > <body>
> > > >
> > > >
> > > > <div id="ajxDspId">
> > > > <display:table
> > name="sessionScope.result"
> > > > pagesize="2"
> > htmlId="dispTable"
> > > > sort="list">
> > > > <display:column property="idUsuario"
> > > > title="ID" />
> > > > <display:column property="nombre"
> > > > sortable="true"/>
> > > > <display:column property="mail"
> > > > sortable="true"/>
> > > >
> > > > </display:table>
> > > > </div>
> > > > <!--- end display tag -->
> > > >
> > > >
> > > > </body>
> > > > </html>
> > > >
> > > >
> > > > If after the login my action goes to the
> > test.page
> > > > directly, it works properly and the links are
> > changed.
> > > >
> > > > But if after the login I go to a new page with a
> > menu:
> > > >
> > > > <%@ page pageEncoding="ISO-8859-1"
> > %>
> > > > <%@ taglib prefix="s"
> > > > uri="/struts-tags" %>
> > > > <html>
> > > > <head>
> > > > <script language='javascript'
> > > > src="src/javascript/jquery.js"
> > > >
> > type="text/javascript"></script>
> > > > <script
> > > >
> > src="src/javascript/displayTagAjax.js"></script>
> > > > <script
> > > >
> > src="src/javascript/optiontransferselect.js"
> > > > type="text/javascript"/>
> > > > <s:head theme="ajax"/>
> > > > <link rel="stylesheet"
> > media="all"
> > > > type="text/css"
> > > > href="src/css/default.css" />
> > > > <script
> > src="src/javascript/stuHover.js"
> > > >
> > type="text/javascript"></script>
> > > >
> > > > </head>
> > > >
> > > > <body>
> > > >
> > > > <s:div id="divPagina">
> > > > <s:url id="buscarUsuario"
> > > > action='IrBuscarUsuario'/>
> > > >
> > > > <s:div id="divMenu">
> > > > <img class="logo"
> > > > src=".../../src/images/logo.jpg"/>
> > > > <br><br>
> > > >
> > > > <ul id="menu">
> > > > <li class="sub">Usuarios
> > > > <ul>
> > > > <li><s:a
> > id="linkBuscarUsuario"
> > > > theme="ajax"
> > > > href="%{buscarUsuario}"
> > > > targets="divContenedor"
> > > > showLoadingText="false">Buscar
> > > > usuario</s:a></li>
> > > > </ul>
> > > > </li>
> > > > </ul>
> > > > </s:div>
> > > > <s:div id="divContenedor"
> > > > theme="ajax">
> > > > </s:div>
> > > > </s:div>
> > > > <script>
> > > >
> > > > </script>
> > > > </body>
> > > > </html>
> > > >
> > > > And when I go then to the test page (which must
> > be shown in
> > > > divContenedor), the links are not displayed ok
> > and when I
> > > > click on sorting or pagination, then it works but
> > the result
> > > > is not displayed in the divContenedor. It is
> > opened in a new
> > > > page and my menu is lost!
> > > >
> > > > If I check with firebug, all js are loaded (in
> > the menu
> > > > page and in the test page).
> > > >
> > > > > To: user@struts.apache.org> From:
> > > > laurie@holoweb.net> Subject: Re: Sorting with
> > displaytag
> > > > issue due to theme="ajax"> Date:
> > Tue, 9 Sep
> > > > 2008 18:08:57 -0400> > Francisco Exposito
> > wrote:>
> > > > > Also I've tried to use displayTagAjax.
> > In order to
> > > > use it, I define in the main page:> > >
> > >
> > > > <script
> > src="src/javascript/displayTagAjax.js"
> > > > type="text/javascript"/>> >
> > <script
> > > > src="src/javascript/jquery.js"
> > > > type="text/javascript"/>> >
> > > > But
> > > > when I reload this page, I receive the error
> > "jQuery is
> > > > not defined" and the error seems to be in
> > the line of
> > > > displayTagAjax.js: > > > >
> > jQuery(function($)
> > > > {> > changeLinks();> > }); > >
> > I assume it
> > > > was a typo, since in a later email you have the
> > order >
> > > > corrected. But just in case it's the obvious
> > thing:
> > > > since > displayTagAjax.js conatains a call to
> > jQuery, the
> > > > jquery.js script needs > to be loaded
> > first...> >
> > > > L.> > >
> > > >
> > --------------------------------------------------------------------->
> > > > To unsubscribe, e-mail:
> > > > user-unsubscribe@struts.apache.org> For
> > additional
> > > > commands, e-mail: user-help@struts.apache.org>
> >
> > > >
> > _________________________________________________________________
> > > > ¿Sigue el calor? Consulta MSN El tiempo
> > > > http://eltiempo.es.msn.com/
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > >
> >
> > _________________________________________________________________
> > Llega la nueva temporada. Consulta las nuevas tendencias en
> > MSN Estilo
> > http://estilo.es.msn.com/moda/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
¿Eres un cotilla? Disfruta de todas las novedades en MSN Corazón
http://entretenimiento.es.msn.com/corazon/
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Dave Newton <ne...@yahoo.com>.
--- On Wed, 9/10/08, Francisco Expositowrote:
> The unique difference I see is that the correct one
> doesn't use ajax, isn't it?
There's a huge number of differences between the two examples. That's not how you isolate a problem.
The advice I provided stands; and I'd still remove the <s:div...> tags if you're not using their Ajax functionality.
Dave
>
>
>
> > Date: Wed, 10 Sep 2008 03:37:30 -0700
> > From: newton.dave@yahoo.com
> > Subject: RE: Sorting with displaytag issue due to
> theme="ajax"
> > To: user@struts.apache.org
> >
> > There are too many differences between your two
> examples. You should build up the functionality from one to
> another until it breaks and start from there.
> >
> > One thing I'd comment is that if your divs are
> just containers then don't use the <s:div...> tag,
> as with the ajax theme they're really designed for
> something else--just use HTML divs. I'd try that first,
> then start to isolate the problem one step at a time.
> >
> > Dave
> >
> > --- On Wed, 9/10/08, Francisco Exposito wrote:
> > > I've changed the order and now that error
> doesn't
> > > appear, but it doesn't work yet...
> > >
> > > I have done a test with this page:
> > >
> > > <%@ page
> > >
> import="ads.web.action.UsuarioAction"%>
> > > <%@ taglib
> uri="http://displaytag.sf.net"
> > > prefix="display" %>
> > >
> > > <%
> > > Object result = session.getAttribute(
> "result" );
> > > UsuarioAction ac = new UsuarioAction();
> > > System.out.println(ac.getTodosUsuarios());
> > > session.setAttribute( "result",
> > > ac.getTodosUsuarios() );
> > > %>
> > > <html>
> > > <head>
> > >
> > > <script language='javascript'
> > > src="src/javascript/jquery.js"
> > >
> type="text/javascript"></script>
> > > <script
> > >
> src="src/javascript/displayTagAjax.js">
> > >
> > > </script>
> > > </head>
> > > <body>
> > >
> > >
> > > <div id="ajxDspId">
> > > <display:table
> name="sessionScope.result"
> > > pagesize="2"
> htmlId="dispTable"
> > > sort="list">
> > > <display:column property="idUsuario"
> > > title="ID" />
> > > <display:column property="nombre"
> > > sortable="true"/>
> > > <display:column property="mail"
> > > sortable="true"/>
> > >
> > > </display:table>
> > > </div>
> > > <!--- end display tag -->
> > >
> > >
> > > </body>
> > > </html>
> > >
> > >
> > > If after the login my action goes to the
> test.page
> > > directly, it works properly and the links are
> changed.
> > >
> > > But if after the login I go to a new page with a
> menu:
> > >
> > > <%@ page pageEncoding="ISO-8859-1"
> %>
> > > <%@ taglib prefix="s"
> > > uri="/struts-tags" %>
> > > <html>
> > > <head>
> > > <script language='javascript'
> > > src="src/javascript/jquery.js"
> > >
> type="text/javascript"></script>
> > > <script
> > >
> src="src/javascript/displayTagAjax.js"></script>
> > > <script
> > >
> src="src/javascript/optiontransferselect.js"
> > > type="text/javascript"/>
> > > <s:head theme="ajax"/>
> > > <link rel="stylesheet"
> media="all"
> > > type="text/css"
> > > href="src/css/default.css" />
> > > <script
> src="src/javascript/stuHover.js"
> > >
> type="text/javascript"></script>
> > >
> > > </head>
> > >
> > > <body>
> > >
> > > <s:div id="divPagina">
> > > <s:url id="buscarUsuario"
> > > action='IrBuscarUsuario'/>
> > >
> > > <s:div id="divMenu">
> > > <img class="logo"
> > > src=".../../src/images/logo.jpg"/>
> > > <br><br>
> > >
> > > <ul id="menu">
> > > <li class="sub">Usuarios
> > > <ul>
> > > <li><s:a
> id="linkBuscarUsuario"
> > > theme="ajax"
> > > href="%{buscarUsuario}"
> > > targets="divContenedor"
> > > showLoadingText="false">Buscar
> > > usuario</s:a></li>
> > > </ul>
> > > </li>
> > > </ul>
> > > </s:div>
> > > <s:div id="divContenedor"
> > > theme="ajax">
> > > </s:div>
> > > </s:div>
> > > <script>
> > >
> > > </script>
> > > </body>
> > > </html>
> > >
> > > And when I go then to the test page (which must
> be shown in
> > > divContenedor), the links are not displayed ok
> and when I
> > > click on sorting or pagination, then it works but
> the result
> > > is not displayed in the divContenedor. It is
> opened in a new
> > > page and my menu is lost!
> > >
> > > If I check with firebug, all js are loaded (in
> the menu
> > > page and in the test page).
> > >
> > > > To: user@struts.apache.org> From:
> > > laurie@holoweb.net> Subject: Re: Sorting with
> displaytag
> > > issue due to theme="ajax"> Date:
> Tue, 9 Sep
> > > 2008 18:08:57 -0400> > Francisco Exposito
> wrote:>
> > > > Also I've tried to use displayTagAjax.
> In order to
> > > use it, I define in the main page:> > >
> >
> > > <script
> src="src/javascript/displayTagAjax.js"
> > > type="text/javascript"/>> >
> <script
> > > src="src/javascript/jquery.js"
> > > type="text/javascript"/>> >
> > > But
> > > when I reload this page, I receive the error
> "jQuery is
> > > not defined" and the error seems to be in
> the line of
> > > displayTagAjax.js: > > > >
> jQuery(function($)
> > > {> > changeLinks();> > }); > >
> I assume it
> > > was a typo, since in a later email you have the
> order >
> > > corrected. But just in case it's the obvious
> thing:
> > > since > displayTagAjax.js conatains a call to
> jQuery, the
> > > jquery.js script needs > to be loaded
> first...> >
> > > L.> > >
> > >
> --------------------------------------------------------------------->
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org> For
> additional
> > > commands, e-mail: user-help@struts.apache.org>
>
> > >
> _________________________________________________________________
> > > ¿Sigue el calor? Consulta MSN El tiempo
> > > http://eltiempo.es.msn.com/
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
>
> _________________________________________________________________
> Llega la nueva temporada. Consulta las nuevas tendencias en
> MSN Estilo
> http://estilo.es.msn.com/moda/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Francisco Exposito <fc...@hotmail.com>.
The unique difference I see is that the correct one doesn't use ajax, isn't it?
As I've seen, the javascripts are executed only when the menu page is loaded. When I go to the secondary page, it is not executed.
I've created a button adding it a call to the function changeLoads (which is inside the displayTagAjax.js) and when I click on the button, then the references are changed. But it should be executed automatically.
> Date: Wed, 10 Sep 2008 03:37:30 -0700
> From: newton.dave@yahoo.com
> Subject: RE: Sorting with displaytag issue due to theme="ajax"
> To: user@struts.apache.org
>
> There are too many differences between your two examples. You should build up the functionality from one to another until it breaks and start from there.
>
> One thing I'd comment is that if your divs are just containers then don't use the <s:div...> tag, as with the ajax theme they're really designed for something else--just use HTML divs. I'd try that first, then start to isolate the problem one step at a time.
>
> Dave
>
> --- On Wed, 9/10/08, Francisco Exposito wrote:
> > I've changed the order and now that error doesn't
> > appear, but it doesn't work yet...
> >
> > I have done a test with this page:
> >
> > <%@ page
> > import="ads.web.action.UsuarioAction"%>
> > <%@ taglib uri="http://displaytag.sf.net"
> > prefix="display" %>
> >
> > <%
> > Object result = session.getAttribute( "result" );
> > UsuarioAction ac = new UsuarioAction();
> > System.out.println(ac.getTodosUsuarios());
> > session.setAttribute( "result",
> > ac.getTodosUsuarios() );
> > %>
> > <html>
> > <head>
> >
> > <script language='javascript'
> > src="src/javascript/jquery.js"
> > type="text/javascript"></script>
> > <script
> > src="src/javascript/displayTagAjax.js">
> >
> > </script>
> > </head>
> > <body>
> >
> >
> > <div id="ajxDspId">
> > <display:table name="sessionScope.result"
> > pagesize="2" htmlId="dispTable"
> > sort="list">
> > <display:column property="idUsuario"
> > title="ID" />
> > <display:column property="nombre"
> > sortable="true"/>
> > <display:column property="mail"
> > sortable="true"/>
> >
> > </display:table>
> > </div>
> > <!--- end display tag -->
> >
> >
> > </body>
> > </html>
> >
> >
> > If after the login my action goes to the test.page
> > directly, it works properly and the links are changed.
> >
> > But if after the login I go to a new page with a menu:
> >
> > <%@ page pageEncoding="ISO-8859-1" %>
> > <%@ taglib prefix="s"
> > uri="/struts-tags" %>
> > <html>
> > <head>
> > <script language='javascript'
> > src="src/javascript/jquery.js"
> > type="text/javascript"></script>
> > <script
> > src="src/javascript/displayTagAjax.js"></script>
> > <script
> > src="src/javascript/optiontransferselect.js"
> > type="text/javascript"/>
> > <s:head theme="ajax"/>
> > <link rel="stylesheet" media="all"
> > type="text/css"
> > href="src/css/default.css" />
> > <script src="src/javascript/stuHover.js"
> > type="text/javascript"></script>
> >
> > </head>
> >
> > <body>
> >
> > <s:div id="divPagina">
> > <s:url id="buscarUsuario"
> > action='IrBuscarUsuario'/>
> >
> > <s:div id="divMenu">
> > <img class="logo"
> > src=".../../src/images/logo.jpg"/>
> > <br><br>
> >
> > <ul id="menu">
> > <li class="sub">Usuarios
> > <ul>
> > <li><s:a id="linkBuscarUsuario"
> > theme="ajax"
> > href="%{buscarUsuario}"
> > targets="divContenedor"
> > showLoadingText="false">Buscar
> > usuario</s:a></li>
> > </ul>
> > </li>
> > </ul>
> > </s:div>
> > <s:div id="divContenedor"
> > theme="ajax">
> > </s:div>
> > </s:div>
> > <script>
> >
> > </script>
> > </body>
> > </html>
> >
> > And when I go then to the test page (which must be shown in
> > divContenedor), the links are not displayed ok and when I
> > click on sorting or pagination, then it works but the result
> > is not displayed in the divContenedor. It is opened in a new
> > page and my menu is lost!
> >
> > If I check with firebug, all js are loaded (in the menu
> > page and in the test page).
> >
> > > To: user@struts.apache.org> From:
> > laurie@holoweb.net> Subject: Re: Sorting with displaytag
> > issue due to theme="ajax"> Date: Tue, 9 Sep
> > 2008 18:08:57 -0400> > Francisco Exposito wrote:>
> > > Also I've tried to use displayTagAjax. In order to
> > use it, I define in the main page:> > > >
> > <script src="src/javascript/displayTagAjax.js"
> > type="text/javascript"/>> > <script
> > src="src/javascript/jquery.js"
> > type="text/javascript"/>> > > > But
> > when I reload this page, I receive the error "jQuery is
> > not defined" and the error seems to be in the line of
> > displayTagAjax.js: > > > > jQuery(function($)
> > {> > changeLinks();> > }); > > I assume it
> > was a typo, since in a later email you have the order >
> > corrected. But just in case it's the obvious thing:
> > since > displayTagAjax.js conatains a call to jQuery, the
> > jquery.js script needs > to be loaded first...> >
> > L.> > >
> > --------------------------------------------------------------------->
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org> For additional
> > commands, e-mail: user-help@struts.apache.org>
> > _________________________________________________________________
> > ¿Sigue el calor? Consulta MSN El tiempo
> > http://eltiempo.es.msn.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Llega la nueva temporada. Consulta las nuevas tendencias en MSN Estilo
http://estilo.es.msn.com/moda/
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Dave Newton <ne...@yahoo.com>.
There are too many differences between your two examples. You should build up the functionality from one to another until it breaks and start from there.
One thing I'd comment is that if your divs are just containers then don't use the <s:div...> tag, as with the ajax theme they're really designed for something else--just use HTML divs. I'd try that first, then start to isolate the problem one step at a time.
Dave
--- On Wed, 9/10/08, Francisco Exposito wrote:
> I've changed the order and now that error doesn't
> appear, but it doesn't work yet...
>
> I have done a test with this page:
>
> <%@ page
> import="ads.web.action.UsuarioAction"%>
> <%@ taglib uri="http://displaytag.sf.net"
> prefix="display" %>
>
> <%
> Object result = session.getAttribute( "result" );
> UsuarioAction ac = new UsuarioAction();
> System.out.println(ac.getTodosUsuarios());
> session.setAttribute( "result",
> ac.getTodosUsuarios() );
> %>
> <html>
> <head>
>
> <script language='javascript'
> src="src/javascript/jquery.js"
> type="text/javascript"></script>
> <script
> src="src/javascript/displayTagAjax.js">
>
> </script>
> </head>
> <body>
>
>
> <div id="ajxDspId">
> <display:table name="sessionScope.result"
> pagesize="2" htmlId="dispTable"
> sort="list">
> <display:column property="idUsuario"
> title="ID" />
> <display:column property="nombre"
> sortable="true"/>
> <display:column property="mail"
> sortable="true"/>
>
> </display:table>
> </div>
> <!--- end display tag -->
>
>
> </body>
> </html>
>
>
> If after the login my action goes to the test.page
> directly, it works properly and the links are changed.
>
> But if after the login I go to a new page with a menu:
>
> <%@ page pageEncoding="ISO-8859-1" %>
> <%@ taglib prefix="s"
> uri="/struts-tags" %>
> <html>
> <head>
> <script language='javascript'
> src="src/javascript/jquery.js"
> type="text/javascript"></script>
> <script
> src="src/javascript/displayTagAjax.js"></script>
> <script
> src="src/javascript/optiontransferselect.js"
> type="text/javascript"/>
> <s:head theme="ajax"/>
> <link rel="stylesheet" media="all"
> type="text/css"
> href="src/css/default.css" />
> <script src="src/javascript/stuHover.js"
> type="text/javascript"></script>
>
> </head>
>
> <body>
>
> <s:div id="divPagina">
> <s:url id="buscarUsuario"
> action='IrBuscarUsuario'/>
>
> <s:div id="divMenu">
> <img class="logo"
> src=".../../src/images/logo.jpg"/>
> <br><br>
>
> <ul id="menu">
> <li class="sub">Usuarios
> <ul>
> <li><s:a id="linkBuscarUsuario"
> theme="ajax"
> href="%{buscarUsuario}"
> targets="divContenedor"
> showLoadingText="false">Buscar
> usuario</s:a></li>
> </ul>
> </li>
> </ul>
> </s:div>
> <s:div id="divContenedor"
> theme="ajax">
> </s:div>
> </s:div>
> <script>
>
> </script>
> </body>
> </html>
>
> And when I go then to the test page (which must be shown in
> divContenedor), the links are not displayed ok and when I
> click on sorting or pagination, then it works but the result
> is not displayed in the divContenedor. It is opened in a new
> page and my menu is lost!
>
> If I check with firebug, all js are loaded (in the menu
> page and in the test page).
>
> > To: user@struts.apache.org> From:
> laurie@holoweb.net> Subject: Re: Sorting with displaytag
> issue due to theme="ajax"> Date: Tue, 9 Sep
> 2008 18:08:57 -0400> > Francisco Exposito wrote:>
> > Also I've tried to use displayTagAjax. In order to
> use it, I define in the main page:> > > >
> <script src="src/javascript/displayTagAjax.js"
> type="text/javascript"/>> > <script
> src="src/javascript/jquery.js"
> type="text/javascript"/>> > > > But
> when I reload this page, I receive the error "jQuery is
> not defined" and the error seems to be in the line of
> displayTagAjax.js: > > > > jQuery(function($)
> {> > changeLinks();> > }); > > I assume it
> was a typo, since in a later email you have the order >
> corrected. But just in case it's the obvious thing:
> since > displayTagAjax.js conatains a call to jQuery, the
> jquery.js script needs > to be loaded first...> >
> L.> > >
> --------------------------------------------------------------------->
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org> For additional
> commands, e-mail: user-help@struts.apache.org>
> _________________________________________________________________
> ¿Sigue el calor? Consulta MSN El tiempo
> http://eltiempo.es.msn.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Sorting with displaytag issue due to theme="ajax"
Posted by Francisco Exposito <fc...@hotmail.com>.
I've changed the order and now that error doesn't appear, but it doesn't work yet...
I have done a test with this page:
<%@ page import="ads.web.action.UsuarioAction"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%
Object result = session.getAttribute( "result" );
UsuarioAction ac = new UsuarioAction();
System.out.println(ac.getTodosUsuarios());
session.setAttribute( "result", ac.getTodosUsuarios() );
%>
<html>
<head>
<script language='javascript' src="src/javascript/jquery.js" type="text/javascript"></script>
<script src="src/javascript/displayTagAjax.js">
</script>
</head>
<body>
<div id="ajxDspId">
<display:table name="sessionScope.result" pagesize="2" htmlId="dispTable" sort="list">
<display:column property="idUsuario" title="ID" />
<display:column property="nombre" sortable="true"/>
<display:column property="mail" sortable="true"/>
</display:table>
</div>
<!--- end display tag -->
</body>
</html>
If after the login my action goes to the test.page directly, it works properly and the links are changed.
But if after the login I go to a new page with a menu:
<%@ page pageEncoding="ISO-8859-1" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<script language='javascript' src="src/javascript/jquery.js" type="text/javascript"></script>
<script src="src/javascript/displayTagAjax.js"></script>
<script src="src/javascript/optiontransferselect.js" type="text/javascript"/>
<s:head theme="ajax"/>
<link rel="stylesheet" media="all" type="text/css" href="src/css/default.css" />
<script src="src/javascript/stuHover.js" type="text/javascript"></script>
</head>
<body>
<s:div id="divPagina">
<s:url id="buscarUsuario" action='IrBuscarUsuario'/>
<s:div id="divMenu">
<img class="logo" src=".../../src/images/logo.jpg"/>
<br><br>
<ul id="menu">
<li class="sub">Usuarios
<ul>
<li><s:a id="linkBuscarUsuario"
theme="ajax"
href="%{buscarUsuario}"
targets="divContenedor"
showLoadingText="false">Buscar usuario</s:a></li>
</ul>
</li>
</ul>
</s:div>
<s:div id="divContenedor" theme="ajax">
</s:div>
</s:div>
<script>
</script>
</body>
</html>
And when I go then to the test page (which must be shown in divContenedor), the links are not displayed ok and when I click on sorting or pagination, then it works but the result is not displayed in the divContenedor. It is opened in a new page and my menu is lost!
If I check with firebug, all js are loaded (in the menu page and in the test page).
> To: user@struts.apache.org> From: laurie@holoweb.net> Subject: Re: Sorting with displaytag issue due to theme="ajax"> Date: Tue, 9 Sep 2008 18:08:57 -0400> > Francisco Exposito wrote:> > Also I've tried to use displayTagAjax. In order to use it, I define in the main page:> > > > <script src="src/javascript/displayTagAjax.js" type="text/javascript"/>> > <script src="src/javascript/jquery.js" type="text/javascript"/>> > > > But when I reload this page, I receive the error "jQuery is not defined" and the error seems to be in the line of displayTagAjax.js: > > > > jQuery(function($) {> > changeLinks();> > }); > > I assume it was a typo, since in a later email you have the order > corrected. But just in case it's the obvious thing: since > displayTagAjax.js conatains a call to jQuery, the jquery.js script needs > to be loaded first...> > L.> > > ---------------------------------------------------------------------> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org> For additional commands, e-mail: user-help@struts.apache.org>
_________________________________________________________________
¿Sigue el calor? Consulta MSN El tiempo
http://eltiempo.es.msn.com/
Re: Sorting with displaytag issue due to theme="ajax"
Posted by Laurie Harper <la...@holoweb.net>.
Francisco Exposito wrote:
> Also I've tried to use displayTagAjax. In order to use it, I define in the main page:
>
> <script src="src/javascript/displayTagAjax.js" type="text/javascript"/>
> <script src="src/javascript/jquery.js" type="text/javascript"/>
>
> But when I reload this page, I receive the error "jQuery is not defined" and the error seems to be in the line of displayTagAjax.js:
>
> jQuery(function($) {
> changeLinks();
> });
I assume it was a typo, since in a later email you have the order
corrected. But just in case it's the obvious thing: since
displayTagAjax.js conatains a call to jQuery, the jquery.js script needs
to be loaded first...
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Sorting with displaytag issue due to theme="ajax"
Posted by Dave Newton <ne...@yahoo.com>.
--- On Tue, 9/9/08, Francisco Exposito wrote:
> But when I reload this page, I receive the error
> "jQuery is not defined" and the error seems to be
> in the line of displayTagAjax.js:
>
> jQuery(function($) {
> changeLinks();
> });
It looks like the Ajax version of displaytag uses jQuery. Are you loading jQuery? Have you tried asking on a displaytag site/list/forum or wherever this tag lives?
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org