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 . 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: 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"
--- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sorting with displaytag issue due to theme="ajax"
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() ); } %> but not this one: <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"> CODE TO GO TO THE TABLE PAGE INSIDE THE DIV divContenedor > Date: Tue, 9 Sep 2008 04:14:50 -0700 > From: [EMAIL PROTECTED] > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _ ¡Entra en el Club oficial de Messenger y te enterarás de todas las novedades! http://www.vivelive.com/ilovemessenger
RE: Sorting with displaytag issue due to theme="ajax"
--- 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: > [...]src="../../src/javascript/jquery.js" > type="text/javascript"> > > > [...] > > but not this one: > [...]src="src/javascript/jquery.js" > type="text/javascript"> >
RE: Sorting with displaytag issue due to theme="ajax"
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: [EMAIL PROTECTED] > 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: > > [...] > src="../../src/javascript/jquery.js" > > type="text/javascript"> > > > > > > [...] > > > > but not this one: > > [...] > src="src/javascript/jquery.js" > > type="text/javascript"> > >
Re: Sorting with displaytag issue due to theme="ajax"
Francisco Exposito wrote: Also I've tried to use displayTagAjax. In order to use it, I define in the main page: 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sorting with displaytag issue due to theme="ajax"
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() ); %> 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" %> Usuarios Buscar usuario 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: [EMAIL PROTECTED]> 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:> > > >
RE: Sorting with displaytag issue due to theme="ajax"
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 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() ); > %> > > > > src="src/javascript/jquery.js" > type="text/javascript"> > src="src/javascript/displayTagAjax.js"> > > > > > > > > pagesize="2" htmlId="dispTable" > sort="list"> > title="ID" /> > sortable="true"/> > sortable="true"/> > > > > > > > > > > > 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" %> > > > src="src/javascript/jquery.js" > type="text/javascript"> > src="src/javascript/displayTagAjax.js"> > 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"> > > > > > > > action='IrBuscarUsuario'/> > > > src=".../../src/images/logo.jpg"/> > > > > Usuarios > > theme="ajax" > href="%{buscarUsuario}" > targets="divContenedor" > showLoadingText="false">Buscar > usuario > > > > > theme="ajax"> > > > > > > > > > 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: > [EMAIL PROTECTED]> 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:> > > > >
RE: Sorting with displaytag issue due to theme="ajax"
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: [EMAIL PROTECTED] > 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 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() ); > > %> > > > > > > > > > src="src/javascript/jquery.js" > > type="text/javascript"> > > > src="src/javascript/displayTagAjax.js"> > > > > > > > > > > > > > > > > > pagesize="2" htmlId="dispTable" > > sort="list"> > > > title="ID" /> > > > sortable="true"/> > > > sortable="true"/> > > > > > > > > > > > > > > > > > > > > > > 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" %> > > > > > > > src="src/javascript/jquery.js" > > type="text/javascript"> > > > src="src/javascript/displayTagAjax.js"> > > > 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"> > > > > > > > > > > > > > > > action='IrBuscarUsuario'/> > > > > > > > src=".../../src/images/logo.jpg"/> > > > > > > > > Usuarios > > > > > theme="ajax" > > href="%{buscarUsuario}" > > targets="divContenedor" > > showLoadingText="false">Buscar > > usuario > > > > > > > > > > > theme="ajax"> > > > > > > > > > > > > > > > > > > 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: > > [EMAIL PROTECTED]> 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:> > > > > >
RE: Sorting with displaytag issue due to theme="ajax"
--- 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 tags if you're not using their Ajax functionality. Dave > > > > > Date: Wed, 10 Sep 2008 03:37:30 -0700 > > From: [EMAIL PROTECTED] > > 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 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() ); > > > %> > > > > > > > > > > > > > > src="src/javascript/jquery.js" > > > > type="text/javascript"> > > > > > > src="src/javascript/displayTagAjax.js"> > > > > > > > > > > > > > > > > > > > > > > > > name="sessionScope.result" > > > pagesize="2" > htmlId="dispTable" > > > sort="list"> > > > > > title="ID" /> > > > > > sortable="true"/> > > > > > sortable="true"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 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" %> > > > > > > > > > > > src="src/javascript/jquery.js" > > > > type="text/javascript"> > > > > > > src="src/javascript/displayTagAjax.js"> > > > > > > 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"> > > > > > > > > > > > > > > > > > > > > > > > action='IrBuscarUsuario'/> > > > > > > > > > > > src=".../../src/images/logo.jpg"/> > > > > > > > > > > > > Usuarios > > > > > > id="linkBuscarUsuario" > > > theme="ajax" > > > href="%{buscarUsuario}" > > > targets="divContenedor" > > > showLoadingText="false">Buscar > > > usuario > > > > > > > > > > > > > > > > > theme="ajax"> > > > > > > > > > > > > > > > > > > > > > > > > > > > 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: > > > [EMAIL PROTECTED]> 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:> > > > > > > >
RE: Sorting with displaytag issue due to theme="ajax"
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" %> Usuarios Buscar usuario 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() ); %> The unique thing I change between the two examples is the struts-xml file: a) First execution: /src/jsp/results.jsp When I login, the results page appear, the script displayTagAjax.js is executed, the references are updated and all work properly. b) Second execution: /src/jsp/menu.jsp 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: [EMAIL PROTECTED] > 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 tags if > you're not using their Ajax functionality. > > Dave > > > > > > > > > > Date: Wed, 10 Sep 2008 03:37:30 -0700 > > > From: [EMAIL PROTECTED] > > > 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 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() ); > > > > %> > > > > > > > > > > > > > > > > > > > src="src/javascript
RE: Sorting with displaytag issue due to theme="ajax"
--- On Wed, 9/10/08, Francisco Exposito wrote: > > Does it work if you remove *this* ? Again--if the div itself isn't doing anything but is just a placeholder there's no reason to use , although I don't know if it would break anything. > type="text/javascript"> > src="src/javascript/displayTagAjax.js"> > debug="true"/> > 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sorting with displaytag issue due to theme="ajax"
I've removed it (I thought it was mandatory the theme="ajax" in the s:div due to the previous code Buscar usuario 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: [EMAIL PROTECTED] > Subject: RE: Sorting with displaytag issue due to theme="ajax" > To: user@struts.apache.org > > --- On Wed, 9/10/08, Francisco Exposito wrote: > > > > > > Does it work if you remove *this* ? Again--if the div itself isn't > doing anything but is just a placeholder there's no reason to use , > although I don't know if it would break anything. > > > > type="text/javascript"> > > > src="src/javascript/displayTagAjax.js"> > > > debug="true"/> > > > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _ Prueba los prototipos de los últimos en MSN Motor http://motor.es.msn.com/
Re: Sorting with displaytag issue due to theme="ajax"
I¹m not certain, but could this be a conflict between jquery and whatever new js libraries you¹ve added: I¹d look into these 3. That¹s probably where the issue lies. Z.
RE: Sorting with displaytag issue due to theme="ajax"
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: [EMAIL PROTECTED] > To: user@struts.apache.org; [EMAIL PROTECTED] > > I¹m not certain, but could this be a conflict between jquery and whatever > new js libraries you¹ve added: > > type="text/javascript"/> > <s:head theme="ajax"/> > <script src="src/javascript/stuHover.js" type="text/javascript"> > > > 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/