You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dariusz Wojtas <dw...@gmail.com> on 2007/01/17 00:45:52 UTC

[S2] Any hope to have ajax form submission working?

Hi,

Does the current form submission come from a problem in dojo?
Or is this something else?
What are the current conclusions about it?

I do not want to be too annoying, this is just important for me.
Any chance to have it working within a week or two?

Best regards
Dariusz Wojtas

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


Re: [S2] Any hope to have ajax form submission working?

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hi Musachy,

One more word on the struts version.
Because I was afraid I could break sth with the build, I have just
downloaded a fresh set of JAR files from:
http://people.apache.org/builds/struts/nightlies/2.0.x/
and used them (dated 19-Jan-2007).
the same files are not found (404), the same issues under IE

Thanks
Dariusz Wojtas

On 1/21/07, Dariusz Wojtas <dw...@gmail.com> wrote:
> Hi Musachy,
>
> I have created an issue WW-1665 and attached 2 files
> Index.jsp and target.jsp.
> Place these files in 1 dir and open index.jsp.
>
> try to submit data, and switch the 'targets' attribute to point to
> different DIVs.
> I also get some javascript errors in IE - most likely something is not found:
>
>   Could not load widget 'dojo.widget.html.Tooltip'
>   last tried '__package__.js'
>
> Using struts 2.0.4 snapshot made 12 hours ago.
> These are requests logged by my filter when I open index.jsp on a
> fresh IE (reload with SHIFT after clearing browsers cache). /esu is my
> app prefix:
>
> /esu/ajax/index.jsp
> /esu/struts/xhtml/styles.css
> /esu/struts/dojo/dojo.js
> /esu/struts/dojo/src/browser_debug.js
> /esu/struts/dojo/src/debug.js
> /esu/struts/simple/dojoRequire.js
> /esu/struts/ajax/dojoRequire.js
> /esu/struts/CommonFunctions.js
> /esu/struts/dojo/src/widget/html/Tooltip.js
> /esu/struts/dojo/src/widget/html.js
> /esu/struts/dojo/src/widget.js
> /esu/struts/dojo/src/__package__.js
> /esu/struts/dojo/src.js
> /esu/struts/dojo/__package__.js
>
> It all works under FF 2.0
> But I also get some 404s under FF:
> GET http://localhost:8080/esu/struts/dojo/src/widget/html/Tooltip.js
> GET http://localhost:8080/esu/struts/dojo/src/widget/html.js
> GET http://localhost:8080/esu/struts/dojo/src/widget.js
> GET http://localhost:8080/esu/struts/dojo/src/__package__.js
> GET http://localhost:8080/esu/struts/dojo/src.js
> GET http://localhost:8080/esu/struts/dojo/__package__.js
> Could not load 'dojo.widget.html.Tooltip'; last tried '__package__.js'
> [Break on this error] throw _13||Error(_12);
>
>
>
>
> Best regards
> Dariusz Wojtas

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


Re: [S2] Any hope to have ajax form submission working?

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hi Musachy,

I have created an issue WW-1665 and attached 2 files
Index.jsp and target.jsp.
Place these files in 1 dir and open index.jsp.

try to submit data, and switch the 'targets' attribute to point to
different DIVs.
I also get some javascript errors in IE - most likely something is not found:

  Could not load widget 'dojo.widget.html.Tooltip'
  last tried '__package__.js'

Using struts 2.0.4 snapshot made 12 hours ago.
These are requests logged by my filter when I open index.jsp on a
fresh IE (reload with SHIFT after clearing browsers cache). /esu is my
app prefix:

/esu/ajax/index.jsp
/esu/struts/xhtml/styles.css
/esu/struts/dojo/dojo.js
/esu/struts/dojo/src/browser_debug.js
/esu/struts/dojo/src/debug.js
/esu/struts/simple/dojoRequire.js
/esu/struts/ajax/dojoRequire.js
/esu/struts/CommonFunctions.js
/esu/struts/dojo/src/widget/html/Tooltip.js
/esu/struts/dojo/src/widget/html.js
/esu/struts/dojo/src/widget.js
/esu/struts/dojo/src/__package__.js
/esu/struts/dojo/src.js
/esu/struts/dojo/__package__.js

It all works under FF 2.0
But I also get some 404s under FF:
GET http://localhost:8080/esu/struts/dojo/src/widget/html/Tooltip.js
GET http://localhost:8080/esu/struts/dojo/src/widget/html.js
GET http://localhost:8080/esu/struts/dojo/src/widget.js
GET http://localhost:8080/esu/struts/dojo/src/__package__.js
GET http://localhost:8080/esu/struts/dojo/src.js
GET http://localhost:8080/esu/struts/dojo/__package__.js
Could not load 'dojo.widget.html.Tooltip'; last tried '__package__.js'
[Break on this error] throw _13||Error(_12);




Best regards
Dariusz Wojtas


On 1/21/07, Dariusz Wojtas <dw...@gmail.com> wrote:
> I will try to send it in 30 minutes.
> I will try to separate some part of my app into 2 JSPs.
> I hope it shows the issue.
>
> Dariusz Wojtas
>
> On 1/20/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> > I tried to replicate this, so I added this to index.jsp on showcase
> > under apps/showcase/src/main/webapp/ajax/remotelink:
> >
> > <div id="target">
> >     <s:form id="form" action="/AjaxTest.action" >
> >       <input type=textbox name="data">
> >       <s:a theme="ajax" targets="target">Try</s:a>
> >     </s:form>
> > </div>
> >
> > but it works on both IE 6 and FF 2. The anchor and the button share the
> > same javascript code, so they should behave the same. They can be used
> > inside a form, in which case they will submit the parent form or outside
> > a form, using "formId". Adding theme="ajax" to the form should make no
> > difference on this case. Can you try the above example and let me know
> > if it works?
> >
> > thanks
> > musachy
>

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


Re: [S2] Any hope to have ajax form submission working?

Posted by Dariusz Wojtas <dw...@gmail.com>.
I will try to send it in 30 minutes.
I will try to separate some part of my app into 2 JSPs.
I hope it shows the issue.

Dariusz Wojtas

On 1/20/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> I tried to replicate this, so I added this to index.jsp on showcase
> under apps/showcase/src/main/webapp/ajax/remotelink:
>
> <div id="target">
>     <s:form id="form" action="/AjaxTest.action" >
>       <input type=textbox name="data">
>       <s:a theme="ajax" targets="target">Try</s:a>
>     </s:form>
> </div>
>
> but it works on both IE 6 and FF 2. The anchor and the button share the
> same javascript code, so they should behave the same. They can be used
> inside a form, in which case they will submit the parent form or outside
> a form, using "formId". Adding theme="ajax" to the form should make no
> difference on this case. Can you try the above example and let me know
> if it works?
>
> thanks
> musachy

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


Re: [S2] Any hope to have ajax form submission working?

Posted by Musachy Barroso <mb...@wfscorp.com>.
I tried to replicate this, so I added this to index.jsp on showcase 
under apps/showcase/src/main/webapp/ajax/remotelink:

<div id="target">
    <s:form id="form" action="/AjaxTest.action" >
      <input type=textbox name="data">
      <s:a theme="ajax" targets="target">Try</s:a>
    </s:form>
</div>

but it works on both IE 6 and FF 2. The anchor and the button share the 
same javascript code, so they should behave the same. They can be used 
inside a form, in which case they will submit the parent form or outside 
a form, using "formId". Adding theme="ajax" to the form should make no 
difference on this case. Can you try the above example and let me know 
if it works?

thanks
musachy


Dariusz Wojtas wrote:
> Hi Musachy,
>
> Your question to prepare some test form/page gave some results.
> My problem was that I had problems submitting remote forms.
> Submitting with a button had problems, then I tried to submit it with
> the <s:a/> element.
> And it worked in FF but not in IE.
> But I found something interesting after looooong testing :)
>
> Some pseudocode below:
>
> <div id="myParentDIV">
>  <form action="/namespace/my.action" theme="ajax">
>    <s:hidden name="id"/>
>    <s:textfield name="name"/>
>    <s:a theme="ajax" targets="myParentDIV">Save</s:a>
>  </form>
> </div>
> <div id="mySecondDIV">
> </div>
>
> IE 6
> In this case <s:a> makes request to '/app/namespace/my.action'
> ut does not attach params.
> If I switch <s:a> targets attribute to point to the second div - then
> it works and passes params....
> The only difference that I see is that it is not it's parent div.
>
> Under FF it works in both cases.
>
> Is there any special reason of this behaviour?
> Can it be fixed?
> Now I can easily make workarounds - now I know the reason of failures,
> but can it be fixed?
> Or this is some bug in IE?
>
> Or maybe this is not allowed?
>
> In fact what I tried is that the 'myParentDiv' element is of type
>    <s:div id="myParentDIV" theme="ajax" href="%{someURL}" ...>
> and the form is loaded by the browser in a separate request.
> But I tried to make both div elements to be declared with <s:div> that
> preload their contents. It still works only if the target is not the
> parent div but the other div.
>
> Best Regards
> Dariusz Wojtas
>
> On 1/17/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>> Can you create a ticket with the scenarios that do not work? I'll
>> probably have time to go over it on the weekend.
>>
>> thanks
>> musachy
>>
>> Dariusz Wojtas wrote:
>> > Hi Musachy,
>> >
>> > This is probably lack of precision from my side.
>> > Saying "ajax forms" I thought about remote forms.
>> >
>> > Even having them working with inputs of type submit/image only (no
>> > anchors) - just to have one method of submission that works in all
>> > cases. Currently there are problems with both: anchor and input button
>> > submission.
>> >
>> > At least one submission method that works with remote forms in all
>> > scenarios ....
>> >
>> > Best regards
>> > Dariusz Wojtas
>> >
>> >
>> > On 1/17/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>> >> I think the problem is only with files right? On showcase there are
>> >> several examples (not the remoting forms), like on the div, 
>> anchor, and
>> >> button page which work.
>> >>
>> >> regards
>> >> musachy
>> >>
>> >> Dariusz Wojtas wrote:
>> >> > Hi,
>> >> >
>> >> > Does the current form submission come from a problem in dojo?
>> >> > Or is this something else?
>> >> > What are the current conclusions about it?
>> >> >
>> >> > I do not want to be too annoying, this is just important for me.
>> >> > Any chance to have it working within a week or two?
>> >> >
>> >> > Best regards
>> >> > Dariusz Wojtas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


Re: [S2] Any hope to have ajax form submission working?

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hi Musachy,

Your question to prepare some test form/page gave some results.
My problem was that I had problems submitting remote forms.
Submitting with a button had problems, then I tried to submit it with
the <s:a/> element.
And it worked in FF but not in IE.
But I found something interesting after looooong testing :)

Some pseudocode below:

<div id="myParentDIV">
  <form action="/namespace/my.action" theme="ajax">
    <s:hidden name="id"/>
    <s:textfield name="name"/>
    <s:a theme="ajax" targets="myParentDIV">Save</s:a>
  </form>
</div>
<div id="mySecondDIV">
</div>

IE 6
In this case <s:a> makes request to '/app/namespace/my.action'
ut does not attach params.
If I switch <s:a> targets attribute to point to the second div - then
it works and passes params....
The only difference that I see is that it is not it's parent div.

Under FF it works in both cases.

Is there any special reason of this behaviour?
Can it be fixed?
Now I can easily make workarounds - now I know the reason of failures,
but can it be fixed?
Or this is some bug in IE?

Or maybe this is not allowed?

In fact what I tried is that the 'myParentDiv' element is of type
    <s:div id="myParentDIV" theme="ajax" href="%{someURL}" ...>
and the form is loaded by the browser in a separate request.
But I tried to make both div elements to be declared with <s:div> that
preload their contents. It still works only if the target is not the
parent div but the other div.

Best Regards
Dariusz Wojtas

On 1/17/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> Can you create a ticket with the scenarios that do not work? I'll
> probably have time to go over it on the weekend.
>
> thanks
> musachy
>
> Dariusz Wojtas wrote:
> > Hi Musachy,
> >
> > This is probably lack of precision from my side.
> > Saying "ajax forms" I thought about remote forms.
> >
> > Even having them working with inputs of type submit/image only (no
> > anchors) - just to have one method of submission that works in all
> > cases. Currently there are problems with both: anchor and input button
> > submission.
> >
> > At least one submission method that works with remote forms in all
> > scenarios ....
> >
> > Best regards
> > Dariusz Wojtas
> >
> >
> > On 1/17/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> >> I think the problem is only with files right? On showcase there are
> >> several examples (not the remoting forms), like on the div, anchor, and
> >> button page which work.
> >>
> >> regards
> >> musachy
> >>
> >> Dariusz Wojtas wrote:
> >> > Hi,
> >> >
> >> > Does the current form submission come from a problem in dojo?
> >> > Or is this something else?
> >> > What are the current conclusions about it?
> >> >
> >> > I do not want to be too annoying, this is just important for me.
> >> > Any chance to have it working within a week or two?
> >> >
> >> > Best regards
> >> > Dariusz Wojtas

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


Re: [S2] Any hope to have ajax form submission working?

Posted by Musachy Barroso <mb...@wfscorp.com>.
Can you create a ticket with the scenarios that do not work? I'll 
probably have time to go over it on the weekend.

thanks
musachy

Dariusz Wojtas wrote:
> Hi Musachy,
>
> This is probably lack of precision from my side.
> Saying "ajax forms" I thought about remote forms.
>
> Even having them working with inputs of type submit/image only (no
> anchors) - just to have one method of submission that works in all
> cases. Currently there are problems with both: anchor and input button
> submission.
>
> At least one submission method that works with remote forms in all
> scenarios ....
>
> Best regards
> Dariusz Wojtas
>
>
> On 1/17/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>> I think the problem is only with files right? On showcase there are
>> several examples (not the remoting forms), like on the div, anchor, and
>> button page which work.
>>
>> regards
>> musachy
>>
>> Dariusz Wojtas wrote:
>> > Hi,
>> >
>> > Does the current form submission come from a problem in dojo?
>> > Or is this something else?
>> > What are the current conclusions about it?
>> >
>> > I do not want to be too annoying, this is just important for me.
>> > Any chance to have it working within a week or two?
>> >
>> > Best regards
>> > Dariusz Wojtas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


Re: [S2] Any hope to have ajax form submission working?

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hi Musachy,

This is probably lack of precision from my side.
Saying "ajax forms" I thought about remote forms.

Even having them working with inputs of type submit/image only (no
anchors) - just to have one method of submission that works in all
cases. Currently there are problems with both: anchor and input button
submission.

At least one submission method that works with remote forms in all
scenarios ....

Best regards
Dariusz Wojtas


On 1/17/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> I think the problem is only with files right? On showcase there are
> several examples (not the remoting forms), like on the div, anchor, and
> button page which work.
>
> regards
> musachy
>
> Dariusz Wojtas wrote:
> > Hi,
> >
> > Does the current form submission come from a problem in dojo?
> > Or is this something else?
> > What are the current conclusions about it?
> >
> > I do not want to be too annoying, this is just important for me.
> > Any chance to have it working within a week or two?
> >
> > Best regards
> > Dariusz Wojtas

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


Re: [S2] Any hope to have ajax form submission working?

Posted by Musachy Barroso <mb...@wfscorp.com>.
I think the problem is only with files right? On showcase there are 
several examples (not the remoting forms), like on the div, anchor, and 
button page which work.

regards
musachy

Dariusz Wojtas wrote:
> Hi,
>
> Does the current form submission come from a problem in dojo?
> Or is this something else?
> What are the current conclusions about it?
>
> I do not want to be too annoying, this is just important for me.
> Any chance to have it working within a week or two?
>
> Best regards
> Dariusz Wojtas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


Re: [S2] Any hope to have ajax form submission working?

Posted by Musachy Barroso <mb...@wfscorp.com>.
After 3 hours debugging, now I see how easy it was :), when the 
"targets" attribute is set to a parent element of the form, and the link 
is hit, the content of the "targets" element is set to "Loading...", the 
problem is that doing this will "erase" the form in IE (duh). So when 
dojo iterates over the fom to build the parameters, the form is empty 
(form.element.length == 0) in IE, but  in FF the elements are still 
there. So, when you have an scenario like this, you can't show the 
loading text. Now the bad news, there is no way to prevent the loading 
text from being shown, I created a ticket for it the other day with a 
patch, but it is scheduled for 2.1.0:

https://issues.apache.org/struts/browse/WW-1570

It is a trivial patch, maybe we can get a committer to take a look at it :)

regards
musachy

Dariusz Wojtas wrote:
> Hmmm, if this is so black-magic then who knows if you can still
> reproduce it tomorrow?
> What if IE dies in 'some other way'?
>
> Thanks for the info, the hope is back :)
>
> Best regards
> Dariusz Wojtas
>
> On 1/24/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>> With your latest jsp file I was able to reproduce the problem. Here is
>> were it gets Microsoft-black-magic-style. I did something, not sure
>> what, and it then started to work. I killed the "explorer" process, and
>> start it again, and was able to reproduce it again, looks like a though
>> one :)
>>
>> regards
>> musachy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


Re: [S2] Any hope to have ajax form submission working?

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hmmm, if this is so black-magic then who knows if you can still
reproduce it tomorrow?
What if IE dies in 'some other way'?

Thanks for the info, the hope is back :)

Best regards
Dariusz Wojtas

On 1/24/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> With your latest jsp file I was able to reproduce the problem. Here is
> were it gets Microsoft-black-magic-style. I did something, not sure
> what, and it then started to work. I killed the "explorer" process, and
> start it again, and was able to reproduce it again, looks like a though
> one :)
>
> regards
> musachy

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


Re: [S2] Any hope to have ajax form submission working?

Posted by Musachy Barroso <mb...@wfscorp.com>.
With your latest jsp file I was able to reproduce the problem. Here is 
were it gets Microsoft-black-magic-style. I did something, not sure 
what, and it then started to work. I killed the "explorer" process, and 
start it again, and was able to reproduce it again, looks like a though 
one :)

regards
musachy

Dariusz Wojtas wrote:
> Hi,
>
> Does the current form submission come from a problem in dojo?
> Or is this something else?
> What are the current conclusions about it?
>
> I do not want to be too annoying, this is just important for me.
> Any chance to have it working within a week or two?
>
> Best regards
> Dariusz Wojtas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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