You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Allen Guo <el...@gmail.com> on 2007/07/04 09:08:01 UTC

Select Component can't work in TP-5.0.5

Hi All,

I use select component in html template like this
    <select t:type="select" model="graphicModel" value="shop.currTemplate.backgroundImage" size="1" disabled="false"/>
The generated result is like this
    <select id="select" name="select" size="1">
      <option disabled="disabled" value="bug.jpg">bug
      <option disabled="disabled" value="pet.png">pet
    </select>
    <img alt="[Error]" class="t-error-icon t-invisible" id="select:icon" src="/bogo/assets/tapestry/field-error-marker.png"> 

I used the latest TP5.0.5(not snapshot). It's really very strange. Can anyone give me a help?


Thank you in advance
Allen Guo



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


RE: service method in BaseEngine

Posted by Ma...@bmw.ch.
I wonder, why it even compiles ;). _locale is a private member! Try
using  setLocale() instead.

> -----Original Message-----
> From: munich@fantasymail.de [mailto:munich@fantasymail.de] 
> Sent: Wednesday, July 04, 2007 1:19 PM
> To: Tapestry users
> Subject: service method in BaseEngine
> 
> Has anyone an idea why the following code will not work?
> 
> public void service(WebRequest webRequest, WebResponse 
> webResponse) throws IOException {
> 		
> 		
> 		if (webRequest.getServerName().startsWith("en.")){
> 			this._locale=new Locale("en","");	
> 			
> 		}
> 		else {
> 			this._locale=new Locale("de","");
> 		}
> 	
> ...
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

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


service method in BaseEngine

Posted by mu...@fantasymail.de.
Has anyone an idea why the following code will not work?

public void service(WebRequest webRequest, WebResponse webResponse) throws IOException {
		
		
		if (webRequest.getServerName().startsWith("en.")){
			this._locale=new Locale("en","");				
		}
		else {
			this._locale=new Locale("de","");
		}
	
...




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


BaseEngine and org.apache.tapestry.request-decoder

Posted by mu...@fantasymail.de.
How do you inject the Engine into org.apache.tapestry.request-decoder ?

In the workbench example there is:

<extension name="org.apache.tapestry.request-decoder" class="org.apache.tapestry.workbench.RequestDecoder"/>

I am trying to set the locale inside RequestDecoder dependent on the domain name. In order to set the Locale, BaseEngine is necessary....

Thanks!

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


Re: Select Component can't work in TP-5.0.5

Posted by 小司 <mo...@gmail.com>.
I meet the same problem.There is not any error tip.


2007/7/4, Allen Guo <el...@gmail.com>:
> Hi All,
>
> I use select component in html template like this
>    <select t:type="select" model="graphicModel" value="shop.currTemplate.backgroundImage" size="1" disabled="false"/>
> The generated result is like this
>    <select id="select" name="select" size="1">
>      <option disabled="disabled" value="bug.jpg">bug
>      <option disabled="disabled" value="pet.png">pet
>    </select>
>    <img alt="[Error]" class="t-error-icon t-invisible" id="select:icon" src="/bogo/assets/tapestry/field-error-marker.png">
>
> I used the latest TP5.0.5(not snapshot). It's really very strange. Can anyone give me a help?
>
>
> Thank you in advance
> Allen Guo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
得与失都是生活

Re: Select Component can't work in TP-5.0.5

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Is this the problem you are trying to fix, or the disabled options?
If the latter, I think there is a problem with your model.

Cheers,
Nick.


蝈蝈龙 wrote:
> For <img/> , As I use complicated CSS, I found the page can't display
> correctly in IE but it's fine in Firefox.
> 
> I prefer the generated html code is more simple.

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


Re: Select Component can't work in TP-5.0.5

Posted by 蝈蝈龙 <el...@gmail.com>.
For <img/> , As I use complicated CSS, I found the page can't display
correctly in IE but it's fine in Firefox.

I prefer the generated html code is more simple.

2007/7/5, Howard Lewis Ship <hl...@gmail.com>:
>
> It looks like the bug, if any, is that
>
> disabled="false"
>
> should set the Select component's disabled parameter to false (which
> is the default), but it appears it may be set to true.  Generally,
> when the TypeCoercer coverts a string to a boolean, any non-blank
> string is converted to true, even the string "false".  However, the
> disabled parameter should have a default parameter prefix of "prop:",
> which interprets the string "false" specially.
>
> Other than that, the rest looks reasonable to me.
>
> The <img/> tag is normal; it's much easier on the client side to hide
> or reveal an existing DOM element than it is to create it and remove
> it.  That's what Tapestry does ... it puts the <img> in place just in
> case the client side decides to display it.  The "t-invisible" ensures
> that, initially, the red icon does not appear to the user.
>
> On 7/4/07, Allen Guo <el...@gmail.com> wrote:
> > Hi All,
> >
> > I use select component in html template like this
> >     <select t:type="select" model="graphicModel" value="
> shop.currTemplate.backgroundImage" size="1" disabled="false"/>
> > The generated result is like this
> >     <select id="select" name="select" size="1">
> >       <option disabled="disabled" value="bug.jpg">bug
> >       <option disabled="disabled" value="pet.png">pet
> >     </select>
> >     <img alt="[Error]" class="t-error-icon t-invisible" id="select:icon"
> src="/bogo/assets/tapestry/field-error-marker.png">
> >
> > I used the latest TP5.0.5(not snapshot). It's really very strange. Can
> anyone give me a help?
> >
> >
> > Thank you in advance
> > Allen Guo
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Select Component can't work in TP-5.0.5

Posted by Howard Lewis Ship <hl...@gmail.com>.
It looks like the bug, if any, is that

disabled="false"

should set the Select component's disabled parameter to false (which
is the default), but it appears it may be set to true.  Generally,
when the TypeCoercer coverts a string to a boolean, any non-blank
string is converted to true, even the string "false".  However, the
disabled parameter should have a default parameter prefix of "prop:",
which interprets the string "false" specially.

Other than that, the rest looks reasonable to me.

The <img/> tag is normal; it's much easier on the client side to hide
or reveal an existing DOM element than it is to create it and remove
it.  That's what Tapestry does ... it puts the <img> in place just in
case the client side decides to display it.  The "t-invisible" ensures
that, initially, the red icon does not appear to the user.

On 7/4/07, Allen Guo <el...@gmail.com> wrote:
> Hi All,
>
> I use select component in html template like this
>     <select t:type="select" model="graphicModel" value="shop.currTemplate.backgroundImage" size="1" disabled="false"/>
> The generated result is like this
>     <select id="select" name="select" size="1">
>       <option disabled="disabled" value="bug.jpg">bug
>       <option disabled="disabled" value="pet.png">pet
>     </select>
>     <img alt="[Error]" class="t-error-icon t-invisible" id="select:icon" src="/bogo/assets/tapestry/field-error-marker.png">
>
> I used the latest TP5.0.5(not snapshot). It's really very strange. Can anyone give me a help?
>
>
> Thank you in advance
> Allen Guo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: Select Component can't work in TP-5.0.5

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Then please show the source & usage of your model.

Cheers,
Nick.


蝈蝈龙 wrote:
> The same error
> 
> 2007/7/4, Nick Westgate <ni...@key-planning.co.jp>:
>>
>> What happens if you omit the disabled attribute?
>>
>> Cheers,
>> Nick.
>>
>>
>> Allen Guo wrote:
>> > Hi All,
>> >
>> > I use select component in html template like this
>> >     <select t:type="select" model="graphicModel" value="
>> shop.currTemplate.backgroundImage" size="1" disabled="false"/>
>> > The generated result is like this
>> >     <select id="select" name="select" size="1">
>> >       <option disabled="disabled" value="bug.jpg">bug
>> >       <option disabled="disabled" value="pet.png">pet
>> >     </select>
>> >     <img alt="[Error]" class="t-error-icon t-invisible" 
>> id="select:icon"
>> src="/bogo/assets/tapestry/field-error-marker.png">
>> >
>> > I used the latest TP5.0.5(not snapshot). It's really very strange. Can
>> anyone give me a help?
>> >
>> >
>> > Thank you in advance
>> > Allen Guo
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 

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


Re: Select Component can't work in TP-5.0.5

Posted by 蝈蝈龙 <el...@gmail.com>.
The same error

2007/7/4, Nick Westgate <ni...@key-planning.co.jp>:
>
> What happens if you omit the disabled attribute?
>
> Cheers,
> Nick.
>
>
> Allen Guo wrote:
> > Hi All,
> >
> > I use select component in html template like this
> >     <select t:type="select" model="graphicModel" value="
> shop.currTemplate.backgroundImage" size="1" disabled="false"/>
> > The generated result is like this
> >     <select id="select" name="select" size="1">
> >       <option disabled="disabled" value="bug.jpg">bug
> >       <option disabled="disabled" value="pet.png">pet
> >     </select>
> >     <img alt="[Error]" class="t-error-icon t-invisible" id="select:icon"
> src="/bogo/assets/tapestry/field-error-marker.png">
> >
> > I used the latest TP5.0.5(not snapshot). It's really very strange. Can
> anyone give me a help?
> >
> >
> > Thank you in advance
> > Allen Guo
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Select Component can't work in TP-5.0.5

Posted by Nick Westgate <ni...@key-planning.co.jp>.
What happens if you omit the disabled attribute?

Cheers,
Nick.


Allen Guo wrote:
> Hi All,
> 
> I use select component in html template like this
>     <select t:type="select" model="graphicModel" value="shop.currTemplate.backgroundImage" size="1" disabled="false"/>
> The generated result is like this
>     <select id="select" name="select" size="1">
>       <option disabled="disabled" value="bug.jpg">bug
>       <option disabled="disabled" value="pet.png">pet
>     </select>
>     <img alt="[Error]" class="t-error-icon t-invisible" id="select:icon" src="/bogo/assets/tapestry/field-error-marker.png"> 
> 
> I used the latest TP5.0.5(not snapshot). It's really very strange. Can anyone give me a help?
> 
> 
> Thank you in advance
> Allen Guo
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

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