You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Grish <gi...@hotmail.com> on 2007/08/03 05:37:55 UTC

[S2] Issues with AJAX in IE

I'm not so sure if this is some bug, but I noticed an odd behaviour with my
AJAX forms in IE.

For Firefox, if I hit the submit button for my form, my output is displayed
in my DIV area as exepcted. Same for IE. But in IE, when I hit enter button
instead of clicking on my submit button the whole jsp for that ajax call is
displayed instead of returning the output in the DIV area. With Firefox
there is no issue. I've noticed this in IE 6 and 7.

I'm actually modifying the Struts 2 + Spring 2 + JPA + AJAX tutorial. Here's
my code:

<s:form action="searchAjax" namespace="/persons" validate="true">
  <s:textfield id="search" label="%{getText('search.label')}"
name="searchCriteria" />
  <s:submit key="search.button" theme="ajax" targets="persons" />
</s:form>

<s:url action="listAjax" namespace="/persons" id="descrsUrl"/>
<div style="width: 300px;border-style: solid">
  <s:div id="persons" theme="ajax" href="%{descrsUrl}"
loadingText="Loading..." />
</div>

I don't know if this is some bug or there's something wrong with my setup.
Has anyone encountered a similar problem?
-- 
View this message in context: http://www.nabble.com/-S2--Issues-with-AJAX-in-IE-tf4210453.html#a11977018
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [S2] Issues with AJAX in IE

Posted by Meteora <bl...@virgilio.it>.
Hi, you are welcome, i am glad it works for you too.
About it being a bug... it is strange noone else (except us) is writing in
this topic so i am not sure if it is a bug or not but i don't know what else
it could be, i tried and tried again and i don't think my code has something
wrong but... you never know. 
Anyway i think we could report it as a bug, then they will see if there is
something wrong or not.
Rather, like you said...  if anyone has other ways to solve it... :)
Bye.


Grish wrote:
> 
> Hi,
> 
> Thanks for the reply! I was out of the office so I was only able to try it
> out now. It works so I guess I'll use this approach for now. I applied
> some CSS using "display: none". Again not the most elegant approaches but
> I guess it will do. 
> 
> Is this really some bug? If anyone has other ways to address this feel
> free to share :)
> 
> Thanks again for the input!
> 
> 
> Meteora wrote:
>> 
>> Hi, i had exactly the same problem but i noticed it just happens when you
>> have a single textfield. If you have 2 or more textfields... it works for
>> me. Did you try with more textfields? I solved in this way: where i just
>> have a single textfield, i add another invisible textfield (with border =
>> 0) so it works in IE also (when you hit enter button).
>> I know it could not be the correct way to do it but if it is really a
>> bug.... at least this "solution" works.  :)
>> Let me know if it works for you too, i hope so. Bye.
>> 
>> 
>> 
>> 
>> Grish wrote:
>>> 
>>> 
>>> But in IE, when I hit enter button instead of clicking on my submit
>>> button the whole jsp for that ajax call is displayed instead of
>>> returning the output in the DIV area. With Firefox there is no issue.
>>> I've noticed this in IE 6 and 7.
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Issues-with-AJAX-in-IE-tf4210453.html#a12858779
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [S2] Issues with AJAX in IE

Posted by Grish <gi...@hotmail.com>.
Hi,

Thanks for the reply! I was out of the office so I was only able to try it
out now. It works so I guess I'll use this approach for now. I applied some
CSS using "display: none". Again not the most elegant approaches but I guess
it will do. 

Is this really some bug? If anyone has other ways to address this feel free
to share :)

Thanks again for the input!


Meteora wrote:
> 
> Hi, i had exactly the same problem but i noticed it just happens when you
> have a single textfield. If you have 2 or more textfields... it works for
> me. Did you try with more textfields? I solved in this way: where i just
> have a single textfield, i add another invisible textfield (with border =
> 0) so it works in IE also (when you hit enter button).
> I know it could not be the correct way to do it but if it is really a
> bug.... at least this "solution" works.  :)
> Let me know if it works for you too, i hope so. Bye.
> 
> 
> 
> 
> Grish wrote:
>> 
>> 
>> But in IE, when I hit enter button instead of clicking on my submit
>> button the whole jsp for that ajax call is displayed instead of returning
>> the output in the DIV area. With Firefox there is no issue. I've noticed
>> this in IE 6 and 7.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Issues-with-AJAX-in-IE-tf4210453.html#a12770357
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [S2] Issues with AJAX in IE

Posted by Meteora <bl...@virgilio.it>.
Hi, i had exactly the same problem but i noticed it just happens when you
have a single textfield. If you have 2 or more textfields... it works for
me. Did you try with more textfields? I solved in this way: where i just
have a single textfield, i add another invisible textfield (with border = 0)
so it works in IE also (when you hit enter button).
I know it could not be the correct way to do it but if it is really a
bug.... at least this "solution" works.  :)
Let me know if it works for you too, i hope so. Bye.




Grish wrote:
> 
> 
> But in IE, when I hit enter button instead of clicking on my submit button
> the whole jsp for that ajax call is displayed instead of returning the
> output in the DIV area. With Firefox there is no issue. I've noticed this
> in IE 6 and 7.
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Issues-with-AJAX-in-IE-tf4210453.html#a12724164
Sent from the Struts - User mailing list archive at Nabble.com.

Re: [S2] Issues with AJAX in IE

Posted by Grish <gi...@hotmail.com>.
Well I checked out the samples in the struts 2 showcase and I get the same
problem.

It seems that when I submit a form using the enter key instead of clicking
the button my results displayed in a new page still. Again this only occurs
in IE 6, 7 (haven't tested with lower versions). I figured I could add a
javascript where I check if the user hits the enter key and then just submit
the form, but then I'll have to do that for every ajax form. 

Has anyone encountered this issue before or is there something wrong with my
code. It works fine though in firefox.


Grish wrote:
> 
> I'm not so sure if this is some bug, but I noticed an odd behaviour with
> my AJAX forms in IE.
> 
> For Firefox, if I hit the submit button for my form, my output is
> displayed in my DIV area as exepcted. Same for IE. But in IE, when I hit
> enter button instead of clicking on my submit button the whole jsp for
> that ajax call is displayed instead of returning the output in the DIV
> area. With Firefox there is no issue. I've noticed this in IE 6 and 7.
> 
> I'm actually modifying the Struts 2 + Spring 2 + JPA + AJAX tutorial.
> Here's my code:
> 
> <s:form action="searchAjax" namespace="/persons" validate="true">
>   <s:textfield id="search" label="%{getText('search.label')}"
> name="searchCriteria" />
>   <s:submit key="search.button" theme="ajax" targets="persons" />
> </s:form>
> 
> <s:url action="listAjax" namespace="/persons" id="descrsUrl"/>
> <div style="width: 300px;border-style: solid">
>   <s:div id="persons" theme="ajax" href="%{descrsUrl}"
> loadingText="Loading..." />
> </div>
> 
> I don't know if this is some bug or there's something wrong with my setup.
> Has anyone encountered a similar problem?
> 

-- 
View this message in context: http://www.nabble.com/-S2--Issues-with-AJAX-in-IE-tf4210453.html#a12631120
Sent from the Struts - User mailing list archive at Nabble.com.


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