You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nkonstantinou <nk...@upcom.eu> on 2007/11/28 10:53:05 UTC

T4.1.3 Problem loading page

I'm facing s strange behaviour with T4.1.3. The problem goes like this: I
have a form

                    <form jwcid="quoteForm@Form"
                          delegate="ognl:beans.validationDelegate"
                          success="listener:onQuoteSubmit"
                          updateComponents="selectCountry"
                          method="literal:get"
                          action="#">

 that has two select components

                            <select jwcid="selectCountry"
                                    onchange="javascript:this.form.submit
();">
                              <option value="1154">AUSTRIA</option>
                              <option value="1035">USA</option>
                            </select>
and

                            <select jwcid="selectRegion"
                                    onchange="javascript:this.form.submit
();">
                              <option value="0">Entire country</option>
                              <option value="247">Attika</option>
                              <option value="257">Thrace</option>
                            </select>

So, what I want is when the user selects another country, to update the
regions. Inside the form, I keep a
                      <input type="hidden"
                             jwcid="@Hidden"
                             value="ognl:selectedCountryId"
                             listener="listener:onQuoteSubmit" />

because as I understand from the manuals, this is the proper way to refresh
a property's value.

The .page contains

  <component id="selectCountry" type="PropertySelection">
    <binding name="model" value="countrySelectionModel"/>
    <binding name="value" value="selectedCountryId"/>
  </component>

  <component id="selectRegion" type="PropertySelection">
    <binding name="model" value="regionSelectionModel"/>
    <binding name="value" value="selectedRegionId"/>
  </component>

Now the thing is that when I change the value of one of the drop-down lists:
 - Firefox (v.2.0.10) displays the page "Problem loading page" with contents
"The connection was reset. The connection to the server was reset while the
page was loading..." (the dreadful screen with the yellow exclamation mark,
I believe it is even worse than error 500 :)

 - Internet Explorer 6 finds an error in javascript, specifically: Invalid
syntax, line 977, which is as selectCountry is rendered by Tapestry:
<select name="selectCountry" id="selectCountry" onchange="javascript:
this.form.submit();">

So, the question is: Shouldn't Tapestry produce some kind of an error in the
first case? I googled a while but my search was not fruitful, nobody seems
to have a "Problem loading page". I 'm looking at the code blindly.

Second, is there some other way I should submit the form?
Third, can I avoid the hidden components? I speculate there is a problem
with DataSqueezer, at least when I remove the hidden components I get some
kind of error

Re: T4.1.3 Problem loading page

Posted by Andreas Andreou <an...@gmail.com>.
Also, since you already have selectedCountryId in your @PropertySelection,
why use @Hidden ?

For the javascript docs that relate to form handling, see
http://tapestry.apache.org/tapestry4.1/javascript/form.html

On Nov 28, 2007 11:53 AM, nkonstantinou <nk...@upcom.eu> wrote:
> I'm facing s strange behaviour with T4.1.3. The problem goes like this: I
> have a form
>
>                     <form jwcid="quoteForm@Form"
>                           delegate="ognl:beans.validationDelegate"
>                           success="listener:onQuoteSubmit"
>                           updateComponents="selectCountry"
>                           method="literal:get"
>                           action="#">
>
>  that has two select components
>
>                             <select jwcid="selectCountry"
>                                     onchange="javascript:this.form.submit
> ();">
>                               <option value="1154">AUSTRIA</option>
>                               <option value="1035">USA</option>
>                             </select>
> and
>
>                             <select jwcid="selectRegion"
>                                     onchange="javascript:this.form.submit
> ();">
>                               <option value="0">Entire country</option>
>                               <option value="247">Attika</option>
>                               <option value="257">Thrace</option>
>                             </select>
>
> So, what I want is when the user selects another country, to update the
> regions. Inside the form, I keep a
>                       <input type="hidden"
>                              jwcid="@Hidden"
>                              value="ognl:selectedCountryId"
>                              listener="listener:onQuoteSubmit" />
>
> because as I understand from the manuals, this is the proper way to refresh
> a property's value.
>
> The .page contains
>
>   <component id="selectCountry" type="PropertySelection">
>     <binding name="model" value="countrySelectionModel"/>
>     <binding name="value" value="selectedCountryId"/>
>   </component>
>
>   <component id="selectRegion" type="PropertySelection">
>     <binding name="model" value="regionSelectionModel"/>
>     <binding name="value" value="selectedRegionId"/>
>   </component>
>
> Now the thing is that when I change the value of one of the drop-down lists:
>  - Firefox (v.2.0.10) displays the page "Problem loading page" with contents
> "The connection was reset. The connection to the server was reset while the
> page was loading..." (the dreadful screen with the yellow exclamation mark,
> I believe it is even worse than error 500 :)
>
>  - Internet Explorer 6 finds an error in javascript, specifically: Invalid
> syntax, line 977, which is as selectCountry is rendered by Tapestry:
> <select name="selectCountry" id="selectCountry" onchange="javascript:
> this.form.submit();">
>
> So, the question is: Shouldn't Tapestry produce some kind of an error in the
> first case? I googled a while but my search was not fruitful, nobody seems
> to have a "Problem loading page". I 'm looking at the code blindly.
>
> Second, is there some other way I should submit the form?
> Third, can I avoid the hidden components? I speculate there is a problem
> with DataSqueezer, at least when I remove the hidden components I get some
> kind of error
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


Re: T4.1.3 Problem loading page

Posted by Alejandro Scandroli <al...@gmail.com>.
Hi

Can you use AJAX?
Maybe some AJAX will help.
Just remove the "onchange" values out from your templates and try this
on your page:

	@EventListener(targets = "selectCountry", events = "onchange",
submitForm = "quoteForm")
	public void changeRegions(IRequestCycle cycle)
	{
		ResponseBuilder responseBuilder = cycle.getResponseBuilder();
		responseBuilder.updateComponent("selectRegion");
	}


--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es



On Nov 28, 2007 10:53 AM, nkonstantinou <nk...@upcom.eu> wrote:
> I'm facing s strange behaviour with T4.1.3. The problem goes like this: I
> have a form
>
>                     <form jwcid="quoteForm@Form"
>                           delegate="ognl:beans.validationDelegate"
>                           success="listener:onQuoteSubmit"
>                           updateComponents="selectCountry"
>                           method="literal:get"
>                           action="#">
>
>  that has two select components
>
>                             <select jwcid="selectCountry"
>                                     onchange="javascript:this.form.submit
> ();">
>                               <option value="1154">AUSTRIA</option>
>                               <option value="1035">USA</option>
>                             </select>
> and
>
>                             <select jwcid="selectRegion"
>                                     onchange="javascript:this.form.submit
> ();">
>                               <option value="0">Entire country</option>
>                               <option value="247">Attika</option>
>                               <option value="257">Thrace</option>
>                             </select>
>
> So, what I want is when the user selects another country, to update the
> regions. Inside the form, I keep a
>                       <input type="hidden"
>                              jwcid="@Hidden"
>                              value="ognl:selectedCountryId"
>                              listener="listener:onQuoteSubmit" />
>
> because as I understand from the manuals, this is the proper way to refresh
> a property's value.
>
> The .page contains
>
>   <component id="selectCountry" type="PropertySelection">
>     <binding name="model" value="countrySelectionModel"/>
>     <binding name="value" value="selectedCountryId"/>
>   </component>
>
>   <component id="selectRegion" type="PropertySelection">
>     <binding name="model" value="regionSelectionModel"/>
>     <binding name="value" value="selectedRegionId"/>
>   </component>
>
> Now the thing is that when I change the value of one of the drop-down lists:
>  - Firefox (v.2.0.10) displays the page "Problem loading page" with contents
> "The connection was reset. The connection to the server was reset while the
> page was loading..." (the dreadful screen with the yellow exclamation mark,
> I believe it is even worse than error 500 :)
>
>  - Internet Explorer 6 finds an error in javascript, specifically: Invalid
> syntax, line 977, which is as selectCountry is rendered by Tapestry:
> <select name="selectCountry" id="selectCountry" onchange="javascript:
> this.form.submit();">
>
> So, the question is: Shouldn't Tapestry produce some kind of an error in the
> first case? I googled a while but my search was not fruitful, nobody seems
> to have a "Problem loading page". I 'm looking at the code blindly.
>
> Second, is there some other way I should submit the form?
> Third, can I avoid the hidden components? I speculate there is a problem
> with DataSqueezer, at least when I remove the hidden components I get some
> kind of error
>

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