You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew Madu <an...@gmail.com> on 2007/02/25 22:30:52 UTC

Ajax form reloading problem

Hi,
I have the latest SVN version of cocoon and have noticed from the following
code:

                <map:select type="ajax-request">
                  <map:when test="true">
                    <map:serialize type="xml"/>
                  </map:when>
                  <map:otherwise>
                    <map:serialize type="xhtml"/>
                  </map:otherwise>
                </map:select>

that if, and in the map:other section, I set the serialize type to html when
you submit a page for which some form elements have been incorrectly entered
you will receive notification without the whole page having to reload, i.e,
as per the ajax-cocoon spec, only those form elements which are incorrect
are submitted. Now, when I set the serialize type to xhtml when you submit a
page which has incorrectly filled in form elements, the whole page is
reloaded!

What is the issue here?

--
Regards

Andrew

Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi Grzegorz,
I know we spoke a few day ago regarding an Ajax reloading problem. I just
wanted to know whether you have been able to gain any further insight into
this issue?

--
Regards

Andrew

On 27/02/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi Grzegorz,
>
> >
> > Why do you have <page> tag on the beginning of this file? Do you
> > generate it? If so, maybe this is what confuses the browser?
>
>
> I have removed this tag but it makes no difference to the functionality of
> the page. If xhtml and/or the body tag has the specified onload event,
> mentioned in my document, the page will not function as expected.
>
> If you didn't come up with solution until tomorrow's afternoon I will
> > try to dig more into this. Now I do not have enough free time.
>
>
> I appreciate your help on this issue.
>
> --
> Regards
>
> Andrew
>
> --
> > Grzegorz Kossakowski
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi Grzegorz,

>
> Why do you have <page> tag on the beginning of this file? Do you
> generate it? If so, maybe this is what confuses the browser?


I have removed this tag but it makes no difference to the functionality of
the page. If xhtml and/or the body tag has the specified onload event,
mentioned in my document, the page will not function as expected.

If you didn't come up with solution until tomorrow's afternoon I will
> try to dig more into this. Now I do not have enough free time.


I appreciate your help on this issue.

--
Regards

Andrew

--
> Grzegorz Kossakowski
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Ajax form reloading problem

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Andrew Madu napisał(a):
> Hi Grzegorz,
> as requested I have included snippets from my sitemap plus various 
> other related files.
>
> <snip/>
> html_rendered_page_snippet (login_view_source.html):
>
> I have attached this document to the email. This document contains the 
> complete source as viewed in the browser. In it you can quite clearly 
> see that the form tags are not being handeled correctly.
>
Why do you have <page> tag on the beginning of this file? Do you 
generate it? If so, maybe this is what confuses the browser?

If you didn't come up with solution until tomorrow's afternoon I will 
try to dig more into this. Now I do not have enough free time.

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi Grzegorz,
as requested I have included snippets from my sitemap plus various other
related files.

initial_sitemap_flow_call:

            <map:match pattern="">
                <map:call function="login"/>
            </map:match>

flow_snippet:

function login() {

    if (userGlobal == null) {

        var form = new Form("forms/login.xml");
        form.showForm("viewform-login_new.xml"); //In relation to sitemap
snippet

        userGlobal = cocoon.session.getAttribute("user");

    }

    //Redirect user to registered area of site
    cocoon.sendPage("registered_section1.xml", {"msg":msg,
"userGlobal":userGlobal});

}

sitemap_ajax_call_snippet:

            <map:match pattern="**viewform-*.xml">
                <map:generate type="newjx" src="jx/{2}.jx"/>
                <map:transform type="cinclude"/>
                <map:transform type="xslt-saxon" src="style/{2}.xsl"/>
                <map:transform type="cinclude"/>
                <map:transform type="browser-update"/>
                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:transform src="template-style/forms-samples-styling.xsl
"/>
                <map:transform type="i18n">
                  <map:parameter name="locale" value="en-US"/>
                </map:transform>
                <map:select type="ajax-request">
                  <map:when test="true">
                    <map:serialize type="xml"/>
                  </map:when>
                  <map:otherwise>
                    <map:serialize type="xhtml"/> //Problem line. If changed
to html all is fine
                  </map:otherwise>
                </map:select>
            </map:match>

login_page_snippet (login_new.xsl/login_new.jx):

I have attached these documents to this email. The first chuck of code in
the jx file pertains to the login process

login_page_validation (login.xml):

I have attached this document to the email

onload_javascript_snippet:

I have attached this document to the email

html_rendered_page_snippet (login_view_source.html):

I have attached this document to the email. This document contains the
complete source as viewed in the browser. In it you can quite clearly see
that the form tags are not being handeled correctly.

I have attached the various documents only so as to give a complete view of
the login process.

--
Regards

Andrew

On 27/02/07, Grzegorz Kossakowski <gr...@tuffmail.com> wrote:
>
> Andrew Madu napisa�(a):
> > Hi Grzegorz,
> >
> >
> >     Could not reproduce. I have onload="alert('loaded')" in body tag
> >     and all
> >     forms work well in Ajax mode.
> >
> >
> > Ah! It may help if I provide a link to my site for which you can see
> > the main login form page in action:
> >
> > www.beyarecords.com < http://www.beyarecords.com>
> >
> The site is down. The best way is to provide as small as possible
> example where error occurs. I mean, you should extract small portion of
> your application and test it separated from the rest. After doing it,
> you will still have no clue provide sitemap fragments, form definitions,
> templates, flowscripts and all related files.
>
> --
> Grzegorz Kossakowski
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Ajax form reloading problem

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Andrew Madu napisał(a):
> Hi Grzegorz,
>
>
>     Could not reproduce. I have onload="alert('loaded')" in body tag
>     and all
>     forms work well in Ajax mode.
>
>
> Ah! It may help if I provide a link to my site for which you can see 
> the main login form page in action:
>
> www.beyarecords.com <http://www.beyarecords.com>
>
The site is down. The best way is to provide as small as possible 
example where error occurs. I mean, you should extract small portion of 
your application and test it separated from the rest. After doing it, 
you will still have no clue provide sitemap fragments, form definitions, 
templates, flowscripts and all related files.

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Ajax form reloading after Action Event

Posted by fh...@s-und-n.de.
Hello, 

I have a little problem with cocoon and ajax in one of my forms.

The form I use has one tree widget included and this tree works fine with 
ajax.
When I select a treenode a java class produces some data on the server 
which present in the form this way:

<bu:replace id="elements">
<div id="elements">
<jx:forEach var="element" items="${data.getData()}">
   <tr>
     <td>${element.getInfo()}</td>
     <td>${element.getName()}</td>
     <td>${element.getTitle()}</td> 
   </tr> 
</jx:forEach>
</div>
</bu:replace>

This works fine so far! Everything is displayed after the selection via 
ajax.

Now I want to add an action widget, wich will sort the data 
alphabetically.
So I inserted the action widget which calls a java class and does some 
work to sort the data. OK.
But the whole page is completely reloaded.

Here is the action widget:
template:
<ft:widget id="sort">
        <fi:styling type="link"/>
</ft:widget>

model:
<fd:action id="sort" command="sortName" state="active">
        <fb:label>up</fb:label>
        <fd:on-action>
                <java class="de.sundn.SortAction"/>
        </fd:on-action>
</fd:action>

So my question is:
How to refresh the part above without a complete reload of the page. What 
settings have to be made that the action widget uses ajax as the tree 
does?

Hope you can help me?


Freundliche Grüße / With kind regards
Fabian Hagen

S&N AG
Klingenderstr. 5
D 33100 Paderborn

voice     +49 5251/1581- 0
fax       +49 5251/1581-71
eMail     fhagen@s-und-n.de
web       http://www.s-und-n.de

Vorstand
Klaus Beverungen
Josef Tillmann 

Vorsitzender des Aufsichtsrates
Heinz-Dieter Wendorff

Handelsregister
Amtsgericht Paderborn HRB 3270 

Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi Grzegorz,

>
> Could not reproduce. I have onload="alert('loaded')" in body tag and all
> forms work well in Ajax mode.


Ah! It may help if I provide a link to my site for which you can see the
main login form page in action:

www.beyarecords.com

You will notice, if viewing the source page, that first line read as:

<!DOCTYPE page PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


If I change my sitemap so that the DOCTYPE is for html 4.0, ala html, and
remove the onload command from the body tag then all is fine.

You will need to view the site in firefox and if you have javascript
debugging installed will see the cocoon error.

If you submit the form, as is, without filling in any details the page will
reload.

--
Regards

Andrew

Re: Ajax form reloading problem

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Andrew Madu napisał(a):
> Hi,
> supplemental to my last 2 posts!, I have noticed that if I have 
> noticed that if I have an onload="" in the body tag of an ajaxified 
> page, when you submit the page with incorrectly filled out form 
> elements the whole page will reload.
>
> So to recap:
>
> 1. If serialize type="xhtml" in sitemap definition of ajax-request, 
> the ajaxified page will reload on submit.
Why do you insist on serializing it to xhtml if it should be serialized 
to xml?
> 2. If there is an onload="some_javascript_function_call()" in the body 
> tag, the ajaxified page will reload on submit.
>
Could not reproduce. I have onload="alert('loaded')" in body tag and all 
forms work well in Ajax mode.


-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Ajax form reloading problem

Posted by Reinhard Poetz <re...@apache.org>.
Andrew Madu wrote:
> Hi Grzegorz,
> 
> 
>     Please stop sending worthless e-mails if you want any further help. See
>     this sentences[1] for good advice:
>     "Please also have some consideration for the other users on the list -
>     this is a busy list and we do not appreciate getting the exact same
>     message posted impatiently several times a day/week! Doing so is only
>     likely to make your question answered more slowly, or not at all, not
>     faster."
> 
> 
> I appreciate and accept your email. If only we all had a 'put life on 
> hold and wait' button, huh?! ;-)

I understand that you have to solve real world problems, but the Cocoon 
community is a community of mostly volunteers. If you need guaranteed service 
levels, I'm sure that there would be some companies which would provide support 
to you.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi Grzegorz,


> Please stop sending worthless e-mails if you want any further help. See
> this sentences[1] for good advice:
> "Please also have some consideration for the other users on the list -
> this is a busy list and we do not appreciate getting the exact same
> message posted impatiently several times a day/week! Doing so is only
> likely to make your question answered more slowly, or not at all, not
> faster."


I appreciate and accept your email. If only we all had a 'put life on hold
and wait' button, huh?! ;-)

--
Regards

Andrew

Re: Ajax form reloading problem

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Andrew Madu napisał(a):
> Hi,
> anyone?!
Please stop sending worthless e-mails if you want any further help. See 
this sentences[1] for good advice:
"Please also have some consideration for the other users on the list - 
this is a busy list and we do not appreciate getting the exact same 
message posted impatiently several times a day/week! Doing so is only 
likely to make your question answered more slowly, or not at all, not 
faster."

Thanks.

[1] http://cocoon.apache.org/2.1/1175.html

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi,
anyone?!

--
Regards

Andrew

On 26/02/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi,
> any ideas with this one guys? I would really like to get this issue
> nailed!!
>
> --
> Regards
>
> Andrew
>
> On 25/02/07, Andrew Madu < andrewmadu@gmail.com> wrote:
> >
> > Hi,
> > supplemental to my last 2 posts!, I have noticed that if I have noticed
> > that if I have an onload="" in the body tag of an ajaxified page, when you
> > submit the page with incorrectly filled out form elements the whole page
> > will reload.
> >
> > So to recap:
> >
> > 1. If serialize type="xhtml" in sitemap definition of ajax-request, the
> > ajaxified page will reload on submit.
> > 2. If there is an onload="some_javascript_function_call()" in the body
> > tag, the ajaxified page will reload on submit.
> >
> > --
> > Regards
> >
> > Andrew
> >
> > On 25/02/07, Andrew Madu < andrewmadu@gmail.com> wrote:
> > >
> > > Hi,
> > > supplemental to my original post, I have noticed that when I first
> > > load the ajax form page which has a serialize type set to xhtml I get an
> > > ajax javascript error which states @ line 1 of the dojo_ajax.js file:
> > >
> > > cocoon is not defined
> > >
> > > Was this same error not dealt with last year if I remember correctly?
> > >
> > > --
> > > Regards
> > >
> > > Andrew
> > >
> > > On 25/02/07, Andrew Madu <an...@gmail.com> wrote:
> > > >
> > > > Hi,
> > > > I have the latest SVN version of cocoon and have noticed from the
> > > > following code:
> > > >
> > > >                 <map:select type="ajax-request">
> > > >                   <map:when test="true">
> > > >                     <map:serialize type="xml"/>
> > > >                   </map:when>
> > > >                   <map:otherwise>
> > > >                     <map:serialize type="xhtml"/>
> > > >                   </map:otherwise>
> > > >                 </map:select>
> > > >
> > > > that if, and in the map:other section, I set the serialize type to
> > > > html when you submit a page for which some form elements have been
> > > > incorrectly entered you will receive notification without the whole page
> > > > having to reload, i.e, as per the ajax-cocoon spec, only those form
> > > > elements which are incorrect are submitted. Now, when I set the serialize
> > > > type to xhtml when you submit a page which has incorrectly filled in form
> > > > elements, the whole page is reloaded!
> > > >
> > > > What is the issue here?
> > > >
> > > > --
> > > > Regards
> > > >
> > > > Andrew
> > > >
> > >
> > >
> >
>

Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi,
any ideas with this one guys? I would really like to get this issue nailed!!

--
Regards

Andrew

On 25/02/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi,
> supplemental to my last 2 posts!, I have noticed that if I have noticed
> that if I have an onload="" in the body tag of an ajaxified page, when you
> submit the page with incorrectly filled out form elements the whole page
> will reload.
>
> So to recap:
>
> 1. If serialize type="xhtml" in sitemap definition of ajax-request, the
> ajaxified page will reload on submit.
> 2. If there is an onload="some_javascript_function_call()" in the body
> tag, the ajaxified page will reload on submit.
>
> --
> Regards
>
> Andrew
>
> On 25/02/07, Andrew Madu <an...@gmail.com> wrote:
> >
> > Hi,
> > supplemental to my original post, I have noticed that when I first load
> > the ajax form page which has a serialize type set to xhtml I get an ajax
> > javascript error which states @ line 1 of the dojo_ajax.js file:
> >
> > cocoon is not defined
> >
> > Was this same error not dealt with last year if I remember correctly?
> >
> > --
> > Regards
> >
> > Andrew
> >
> > On 25/02/07, Andrew Madu <an...@gmail.com> wrote:
> > >
> > > Hi,
> > > I have the latest SVN version of cocoon and have noticed from the
> > > following code:
> > >
> > >                 <map:select type="ajax-request">
> > >                   <map:when test="true">
> > >                     <map:serialize type="xml"/>
> > >                   </map:when>
> > >                   <map:otherwise>
> > >                     <map:serialize type="xhtml"/>
> > >                   </map:otherwise>
> > >                 </map:select>
> > >
> > > that if, and in the map:other section, I set the serialize type to
> > > html when you submit a page for which some form elements have been
> > > incorrectly entered you will receive notification without the whole page
> > > having to reload, i.e, as per the ajax-cocoon spec, only those form
> > > elements which are incorrect are submitted. Now, when I set the serialize
> > > type to xhtml when you submit a page which has incorrectly filled in form
> > > elements, the whole page is reloaded!
> > >
> > > What is the issue here?
> > >
> > > --
> > > Regards
> > >
> > > Andrew
> > >
> >
> >
>

Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi,
supplemental to my last 2 posts!, I have noticed that if I have noticed that
if I have an onload="" in the body tag of an ajaxified page, when you submit
the page with incorrectly filled out form elements the whole page will
reload.

So to recap:

1. If serialize type="xhtml" in sitemap definition of ajax-request, the
ajaxified page will reload on submit.
2. If there is an onload="some_javascript_function_call()" in the body tag,
the ajaxified page will reload on submit.

--
Regards

Andrew

On 25/02/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi,
> supplemental to my original post, I have noticed that when I first load
> the ajax form page which has a serialize type set to xhtml I get an ajax
> javascript error which states @ line 1 of the dojo_ajax.js file:
>
> cocoon is not defined
>
> Was this same error not dealt with last year if I remember correctly?
>
> --
> Regards
>
> Andrew
>
> On 25/02/07, Andrew Madu <an...@gmail.com> wrote:
> >
> > Hi,
> > I have the latest SVN version of cocoon and have noticed from the
> > following code:
> >
> >                 <map:select type="ajax-request">
> >                   <map:when test="true">
> >                     <map:serialize type="xml"/>
> >                   </map:when>
> >                   <map:otherwise>
> >                     <map:serialize type="xhtml"/>
> >                   </map:otherwise>
> >                 </map:select>
> >
> > that if, and in the map:other section, I set the serialize type to html
> > when you submit a page for which some form elements have been incorrectly
> > entered you will receive notification without the whole page having to
> > reload, i.e, as per the ajax-cocoon spec, only those form elements which
> > are incorrect are submitted. Now, when I set the serialize type to xhtml
> > when you submit a page which has incorrectly filled in form elements, the
> > whole page is reloaded!
> >
> > What is the issue here?
> >
> > --
> > Regards
> >
> > Andrew
> >
>
>

Re: Ajax form reloading problem

Posted by Andrew Madu <an...@gmail.com>.
Hi,
supplemental to my original post, I have noticed that when I first load the
ajax form page which has a serialize type set to xhtml I get an ajax
javascript error which states @ line 1 of the dojo_ajax.js file:

cocoon is not defined

Was this same error not dealt with last year if I remember correctly?

--
Regards

Andrew

On 25/02/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi,
> I have the latest SVN version of cocoon and have noticed from the
> following code:
>
>                 <map:select type="ajax-request">
>                   <map:when test="true">
>                     <map:serialize type="xml"/>
>                   </map:when>
>                   <map:otherwise>
>                     <map:serialize type="xhtml"/>
>                   </map:otherwise>
>                 </map:select>
>
> that if, and in the map:other section, I set the serialize type to html
> when you submit a page for which some form elements have been incorrectly
> entered you will receive notification without the whole page having to
> reload, i.e, as per the ajax-cocoon spec, only those form elements which
> are incorrect are submitted. Now, when I set the serialize type to xhtml
> when you submit a page which has incorrectly filled in form elements, the
> whole page is reloaded!
>
> What is the issue here?
>
> --
> Regards
>
> Andrew
>