You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by lucas owen <sr...@gmail.com> on 2012/11/20 14:46:49 UTC

Struts2-jQuery plugin

Hi Struts users!

I'm building a web app and I have a serious problem:

index.jsp is a search form with 2 combo boxes which i populate with
sj:select (this works correctly)

when the user clicks "search", the form sends the data to search.action and
the results are displayed in searchResult.jsp

in this searchResult.jsp i have the same 2 como boxes (same code) but

1.- they dont work (they dont call the sj:select href action)
2.- they dont get pre-selected with the value the user entered

so the question is can i use sj:select after coming from search.action or
this just can be used in jsp without any previous struts processing (like
index.jsp)?

thank you so much in advance!!

Re: Struts2-jQuery plugin

Posted by lucas owen <sr...@gmail.com>.
no no, sj:select is working perfectly in index.jsp but not in
searchResults.jsp (it's the same code)

why?


2012/11/20 Martin Gainty <mg...@hotmail.com>

>
> Lukasz
> i assume this is what you are referring to:
> <sj:select
>         href="%{remoteurl}"
>         id="echo"
>         name="echo"
>         list="languageList"
>         emptyOption="true"
>         headerKey="-1"
>         headerValue="Please Select a Language"/> you will need to populate
> the remoteurl variable with a url tag that defines a 'registered' action
> e.g.
> <s:url var="remoteurl" action="jsonsample"/>
> does this help?
> Martin ______________________________________________
> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und
> Vertraulichkeitanmerkung/Note de déni et de confidentialité
>  Ez az
> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> ezen üzenet tartalma miatt.
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>  > Date: Tue, 20 Nov 2012 14:46:49 +0100
> > Subject: Struts2-jQuery plugin
> > From: sr.ilustre@gmail.com
> > To: user@struts.apache.org
> >
> > Hi Struts users!
> >
> > I'm building a web app and I have a serious problem:
> >
> > index.jsp is a search form with 2 combo boxes which i populate with
> > sj:select (this works correctly)
> >
> > when the user clicks "search", the form sends the data to search.action
> and
> > the results are displayed in searchResult.jsp
> >
> > in this searchResult.jsp i have the same 2 como boxes (same code) but
> >
> > 1.- they dont work (they dont call the sj:select href action)
> > 2.- they dont get pre-selected with the value the user entered
> >
> > so the question is can i use sj:select after coming from search.action or
> > this just can be used in jsp without any previous struts processing (like
> > index.jsp)?
> >
> > thank you so much in advance!!
>
>

RE: Struts2-jQuery plugin

Posted by Martin Gainty <mg...@hotmail.com>.
Lukasz
i assume this is what you are referring to:
<sj:select
        href="%{remoteurl}"
        id="echo"
        name="echo"
        list="languageList"
        emptyOption="true"
        headerKey="-1"
        headerValue="Please Select a Language"/> you will need to populate the remoteurl variable with a url tag that defines a 'registered' action e.g.
<s:url var="remoteurl" action="jsonsample"/>
does this help?
Martin ______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 > Date: Tue, 20 Nov 2012 14:46:49 +0100
> Subject: Struts2-jQuery plugin
> From: sr.ilustre@gmail.com
> To: user@struts.apache.org
> 
> Hi Struts users!
> 
> I'm building a web app and I have a serious problem:
> 
> index.jsp is a search form with 2 combo boxes which i populate with
> sj:select (this works correctly)
> 
> when the user clicks "search", the form sends the data to search.action and
> the results are displayed in searchResult.jsp
> 
> in this searchResult.jsp i have the same 2 como boxes (same code) but
> 
> 1.- they dont work (they dont call the sj:select href action)
> 2.- they dont get pre-selected with the value the user entered
> 
> so the question is can i use sj:select after coming from search.action or
> this just can be used in jsp without any previous struts processing (like
> index.jsp)?
> 
> thank you so much in advance!!
 		 	   		  

RE: Struts2-jQuery plugin

Posted by Martin Gainty <mg...@hotmail.com>.
Lukas and Zoran we used to bind handlers to the DOM elements almost the same way in Dojo JQuery: to bind a EventType.Namespace to a JS handler you implement the bind.bind('click.name', handler), the string click is the event type, and the string name is the namespace. http://api.jquery.com/bind/
that EventType.Namespace seems backwards does this conform to your understanding? Thanks,
Martin Gainty 
______________________________________________ 
Note de déni et de confidentialitéCe message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 > Date: Thu, 22 Nov 2012 12:34:09 +0100
> Subject: Re: Struts2-jQuery plugin
> From: sr.ilustre@gmail.com
> To: zoran@sparecreative.com
> CC: user@struts.apache.org
> 
> Hi Zoran
> 
> I don't need to use the plugin, simple jQuery is good as long as it works
> 
> Could you please show your code?
> 
> Thanks.
> 
> 
> 2012/11/22 Zoran Avtarovski <zo...@sparecreative.com>
> 
> > Hi Lucas,
> >
> > I don't use the plugin as I find using jQuery without a plugin to be
> > simple enough.
> >
> > I suspect that if you look at the generated javascript in your
> > searchResult.jsp page the jQuery binding will be waiting for a document
> > ready trigger which isn't fired for ajax requests.
> >
> > The way I get around this to use the jQuery live function for binding
> > which works perfectly, but as I said not having used the sj plugin not
> > sure what you need to do.
> >
> > Z.
> >
> >
> >
> > On 21/11/12 12:46 AM, "lucas owen" <sr...@gmail.com> wrote:
> >
> > >Hi Struts users!
> > >
> > >I'm building a web app and I have a serious problem:
> > >
> > >index.jsp is a search form with 2 combo boxes which i populate with
> > >sj:select (this works correctly)
> > >
> > >when the user clicks "search", the form sends the data to search.action
> > >and
> > >the results are displayed in searchResult.jsp
> > >
> > >in this searchResult.jsp i have the same 2 como boxes (same code) but
> > >
> > >1.- they dont work (they dont call the sj:select href action)
> > >2.- they dont get pre-selected with the value the user entered
> > >
> > >so the question is can i use sj:select after coming from search.action or
> > >this just can be used in jsp without any previous struts processing (like
> > >index.jsp)?
> > >
> > >thank you so much in advance!!
> >
> >
> >
 		 	   		  

Re: Struts2-jQuery plugin

Posted by lucas owen <sr...@gmail.com>.
Hi Zoran

I don't need to use the plugin, simple jQuery is good as long as it works

Could you please show your code?

Thanks.


2012/11/22 Zoran Avtarovski <zo...@sparecreative.com>

> Hi Lucas,
>
> I don't use the plugin as I find using jQuery without a plugin to be
> simple enough.
>
> I suspect that if you look at the generated javascript in your
> searchResult.jsp page the jQuery binding will be waiting for a document
> ready trigger which isn't fired for ajax requests.
>
> The way I get around this to use the jQuery live function for binding
> which works perfectly, but as I said not having used the sj plugin not
> sure what you need to do.
>
> Z.
>
>
>
> On 21/11/12 12:46 AM, "lucas owen" <sr...@gmail.com> wrote:
>
> >Hi Struts users!
> >
> >I'm building a web app and I have a serious problem:
> >
> >index.jsp is a search form with 2 combo boxes which i populate with
> >sj:select (this works correctly)
> >
> >when the user clicks "search", the form sends the data to search.action
> >and
> >the results are displayed in searchResult.jsp
> >
> >in this searchResult.jsp i have the same 2 como boxes (same code) but
> >
> >1.- they dont work (they dont call the sj:select href action)
> >2.- they dont get pre-selected with the value the user entered
> >
> >so the question is can i use sj:select after coming from search.action or
> >this just can be used in jsp without any previous struts processing (like
> >index.jsp)?
> >
> >thank you so much in advance!!
>
>
>

Re: Struts2-jQuery plugin

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
Hi Lucas,

I don't use the plugin as I find using jQuery without a plugin to be
simple enough.

I suspect that if you look at the generated javascript in your
searchResult.jsp page the jQuery binding will be waiting for a document
ready trigger which isn't fired for ajax requests.

The way I get around this to use the jQuery live function for binding
which works perfectly, but as I said not having used the sj plugin not
sure what you need to do.

Z.



On 21/11/12 12:46 AM, "lucas owen" <sr...@gmail.com> wrote:

>Hi Struts users!
>
>I'm building a web app and I have a serious problem:
>
>index.jsp is a search form with 2 combo boxes which i populate with
>sj:select (this works correctly)
>
>when the user clicks "search", the form sends the data to search.action
>and
>the results are displayed in searchResult.jsp
>
>in this searchResult.jsp i have the same 2 como boxes (same code) but
>
>1.- they dont work (they dont call the sj:select href action)
>2.- they dont get pre-selected with the value the user entered
>
>so the question is can i use sj:select after coming from search.action or
>this just can be used in jsp without any previous struts processing (like
>index.jsp)?
>
>thank you so much in advance!!



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