You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julien HENRY <he...@yahoo.fr> on 2008/04/02 12:49:46 UTC

Re : T5: Layout question

Hi Onno,

You don't need to do anything else. Everything outside of 
<div class="text-column" t:type="Border">
                  Page content
</div>
will be discarded and the Layout component will be used instead. Is it not the case?

Regards,

Julien

----- Message d'origine ----
De : Onno Scheffers <on...@piraya.nl>
À : Tapestry users <us...@tapestry.apache.org>
Envoyé le : Mercredi, 2 Avril 2008, 11h26mn 58s
Objet : T5: Layout question

I created a Layout component called Border.
According to the documentation, I have to setup my page something like this:
<html t:type="Border" xmlns:t="
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
   Page content
</html>

I want the template to be previewable though so the webdesigners can work
with the pages more easily.
For this I need some more markup around the page content that needs to be
ignored when rendering the page. Thus something like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
   <body>
      <div id="main">
         <div id="content">
            <div class="content-holder">
               <div class="text-column" t:type="Border">
                  Page content
               </div>
            </div>
         </div>
      </div>
   </body>
</html>

Is there a way I can tell Tapestry to ignore all Markup outside of the
Border component?

regards,

Onno





      _____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact. http://mail.yahoo.fr

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


Re: Re : T5: Layout question

Posted by Onno Scheffers <on...@piraya.nl>.
Hi Julien

thanks for your answer and that was what I expected to see happening, but it
doesn't.
So if it is supposed to work like that, then I must be doing something wrong
here.

My Start.tml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <title>My Project</title>
   </head>
   <body>
      <div id="main">
         <div id="content">
            <div class="content-holder">
               <div class="text-column" t:type="Border">
                  My content
               </div>
            </div>
         </div>
      </div>
   </body>
</html>

My Border.tml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
   <body>
      <div id="main">
         <div id="header">[...]</div>
         <div id="content">
            <div class="content-holder">
               <div class="nav-column">
                  <ul class="navigation">
                     <li>Item 1</li>
                     <li>Item 2</li>
                  </ul>
               </div>
               <div class="text-column">
                  <t:body />
               </div>
            </div>
         </div>
      </div>
   </body>
</html>

Tapestry output:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
xmlns="http://www.w3.org/1999/xhtml"><head><link
href="assets/tapestry/default.css" rel="stylesheet"
type="text/css"><meta content="text/html; charset=utf-8"
http-equiv="Content-Type"><title>My Project</title></head><body><div
id="main">
         <div id="content">
            <div class="content-holder">
               <html
xmlns="http://www.w3.org/1999/xhtml"><head>[...]</head><body><div
id="main">
         <div id="header">[...]</div>
         <div id="content">
            <div class="content-holder">
               <div class="nav-column">

                  <ul class="navigation"><li>Item 1</li><li>Item 2</li></ul>
               </div>
               <div class="text-column">

                  My content

               </div>
            </div>
         </div>
      </div></body></html>

            </div>
         </div>
      </div></body></html>


regards,

Onno



2008/4/2, Julien HENRY <he...@yahoo.fr>:
>
> Hi Onno,
>
> You don't need to do anything else. Everything outside of
>
> <div class="text-column" t:type="Border">
>                   Page content
> </div>
>
> will be discarded and the Layout component will be used instead. Is it not
> the case?
>
> Regards,
>
> Julien
>
> ----- Message d'origine ----
> De : Onno Scheffers <on...@piraya.nl>
> À : Tapestry users <us...@tapestry.apache.org>
> Envoyé le : Mercredi, 2 Avril 2008, 11h26mn 58s
> Objet : T5: Layout question
>
>
> I created a Layout component called Border.
> According to the documentation, I have to setup my page something like
> this:
> <html t:type="Border" xmlns:t="
> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    Page content
> </html>
>
> I want the template to be previewable though so the webdesigners can work
> with the pages more easily.
> For this I need some more markup around the page content that needs to be
> ignored when rendering the page. Thus something like this:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    <body>
>       <div id="main">
>          <div id="content">
>             <div class="content-holder">
>                <div class="text-column" t:type="Border">
>                   Page content
>                </div>
>             </div>
>          </div>
>       </div>
>    </body>
> </html>
>
> Is there a way I can tell Tapestry to ignore all Markup outside of the
> Border component?
>
> regards,
>
> Onno
>
>
>
>
>
>
>
>       _____________________________________________________________________________
> Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact.
> http://mail.yahoo.fr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: Layout question

Posted by Onno Scheffers <on...@piraya.nl>.
Hi DH,

thanks for your response. I missed that earlier discussion and t:container
indeed doesn't seem to offer a proper work-around for the lack of $content$
when using the Layout component pattern.

Does anyone know if something like $content$ will be added to T5 before the
stable release?

regards,

Onno


2008/4/2, 宁德辉 <dh...@gaonline.com.cn>:
>
> It looks like that T5 doesn't have such solution as $content$ in T4.
> It is discussed before.
> http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-to15719185.html#a15739812
> Even though the t:container element can't help.
>
> Thanks!
>
> DH
>
>
>
> ----- Original Message -----
> From: "Julien HENRY" <he...@yahoo.fr>
> To: "Tapestry users" <us...@tapestry.apache.org>
> Sent: Wednesday, April 02, 2008 6:49 PM
> Subject: Re : T5: Layout question
>
>
> Hi Onno,
>
> You don't need to do anything else. Everything outside of
> <div class="text-column" t:type="Border">
>                   Page content
> </div>
> will be discarded and the Layout component will be used instead. Is it not
> the case?
>
> Regards,
>
> Julien
>
> ----- Message d'origine ----
> De : Onno Scheffers <on...@piraya.nl>
> À : Tapestry users <us...@tapestry.apache.org>
> Envoyé le : Mercredi, 2 Avril 2008, 11h26mn 58s
> Objet : T5: Layout question
>
> I created a Layout component called Border.
> According to the documentation, I have to setup my page something like
> this:
> <html t:type="Border" xmlns:t="
> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    Page content
> </html>
>
> I want the template to be previewable though so the webdesigners can work
> with the pages more easily.
> For this I need some more markup around the page content that needs to be
> ignored when rendering the page. Thus something like this:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    <body>
>       <div id="main">
>          <div id="content">
>             <div class="content-holder">
>                <div class="text-column" t:type="Border">
>                   Page content
>                </div>
>             </div>
>          </div>
>       </div>
>    </body>
> </html>
>
> Is there a way I can tell Tapestry to ignore all Markup outside of the
> Border component?
>
> regards,
>
> Onno
>
>
>
>
>
>
>       _____________________________________________________________________________
> Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact.
> http://mail.yahoo.fr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: Beaneditform Validation differences between IE6 and firefox2.0?

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

Howard changed something a few days ago in 5.0.12, might be what you need:
https://issues.apache.org/jira/browse/TAPESTRY-2320

-Filip

On 2008-04-03 09:55, dhning wrote:
> Josh, thanks you for the response.
> I mistake the validation via ajax in Firefox, the http requests are to download tapestry error images like field-error-marker.gif&error-bever-right.png, sorry about that.
> 
> I have change "onAction" to "onSuccess", but js error still exists in IE, debugger shows me at line 532 of tapestry.js.
> 
> if (! event.result)
>  {
>             domevent.stop(); //  line 532 here
>  }
> 
> Error is "Object doesn't support this property or method". 
> 
> If I disable the debugger, then client validation logic seems run, and show the error bubble, but immediately the form is submitted, I really can't understand, maybe because of js error, the event is not prevented from being submitted.
> 
> My concern: 5.0.11 Client validation of beaneditform works in firefox, but why can not in IE, Opera has the same problem. I also test validation of Form component in these 3 browsers, result seems the same.
> 
> Please help.
> 
> 
> Thanks!
> 
> DH
> 
> 
> ----- Original Message ----- 
> From: "Josh Canfield" <jo...@thedailytube.com>
> To: "Tapestry users" <us...@tapestry.apache.org>
> Sent: Thursday, April 03, 2008 1:47 AM
> Subject: Re: T5: Beaneditform Validation differences between IE6 and firefox2.0?
> 
> 
>> Hi,
>>
>> Why do you think there is an ajax request sent? Last I checked client
>> side validation is done with javascript that is added to the page when
>> it is rendered. I don't use the beaneditform, so I can't be sure but I
>> doubt it's doing validation via ajax.
>>
>> You're catching every action from Usereditor and saving the user. Is
>> that really what you want? Perhaps you should be more selective and
>> only save the user when the form submission is successful?
>> check out
>> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Form.html
>> for info on form events, specifically "success"
>>
>> As for the javascript error in IE... try stepping into it and tell us
>> what object is having the problem.
>>
>> Josh
>>
>> On Wed, Apr 2, 2008 at 4:37 AM, dhning <dh...@gaonline.com.cn> wrote:
>>> Hi,
>>>
>>> I just begin to learn T5 and simply use component t:beaneditform to create/edit a simple entity User. But I found that the validation behavior are different in IE6 and firefox.
>>> Please help. My tapestry version is 5.0.11.
>>>
>>> My entity code:
>>>
>>> public class User implements Serializable {
>>>    private String username;
>>>    private String password;
>>>
>>>    @Validate("required") // for tapestry, add require validation.
>>>    public String getPassword() {
>>>        return password;
>>>    }
>>>    // other setter & getter
>>> }
>>>
>>> My page class code:
>>>
>>> public class CreateUser extends BasePage { // my base page to inject the entity service
>>>
>>>    private User user; // not persistent
>>>
>>>    public User getUser() {
>>>        return this.user;
>>>    }
>>>
>>>    public void setUser(User user) {
>>>        this.user = user;
>>>    }
>>>
>>>    @InjectPage
>>>    private UserList listPage;
>>>
>>>    UserList onActionFromUsereditor() {
>>>     getEntityService().save(user);
>>>
>>>        return this.listPage;
>>>    }
>>> }
>>>
>>> I don't write any validation in page class, such as onSuccess ...
>>>
>>> My template code:
>>> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>>    <head>
>>>
>>>        <title>t5first Start Page</title>
>>>    </head>
>>>    <body>
>>>        <h1>Create User</h1>
>>>
>>>   <t:beaneditform t:id="usereditor" t:object="user" t:submitLabel="message:button.save"/>
>>>
>>>    </body>
>>> </html>
>>>
>>> Case: I input nothing, and click "submit" button.
>>> In firefox everything works. A ajax request is sent, later a popup prompt that "password" can't be null.
>>> But in IE6(I have installed VS2005 studio as debugger), when I click "submit" button, a js error happens: Object doesn't support this property or method and ask me whether to debug or not.
>>> I choose not, then the "onActionFromUsereditor" is invoked and page navigates to the user list page. An user record has been added to DB!!!.
>>>
>>> Would you please help?
>>>
>>> BTW, T4's client validation is very good without sending ajax request, is there a way for T5 to implement such feature?
>>>
>>> Thanks!
>>> DH
>>
>>
>> -- 
>> --
>> TheDailyTube.com. Sign up and get the best new videos on the internet
>> delivered fresh to your inbox.
>>
>> ---------------------------------------------------------------------
>> 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: T5: Beaneditform Validation differences between IE6 and firefox2.0?

Posted by dhning <dh...@gaonline.com.cn>.
Josh, thanks you for the response.
I mistake the validation via ajax in Firefox, the http requests are to download tapestry error images like field-error-marker.gif&error-bever-right.png, sorry about that.

I have change "onAction" to "onSuccess", but js error still exists in IE, debugger shows me at line 532 of tapestry.js.

if (! event.result)
 {
            domevent.stop(); //  line 532 here
 }

Error is "Object doesn't support this property or method". 

If I disable the debugger, then client validation logic seems run, and show the error bubble, but immediately the form is submitted, I really can't understand, maybe because of js error, the event is not prevented from being submitted.

My concern: 5.0.11 Client validation of beaneditform works in firefox, but why can not in IE, Opera has the same problem. I also test validation of Form component in these 3 browsers, result seems the same.

Please help.


Thanks!

DH


----- Original Message ----- 
From: "Josh Canfield" <jo...@thedailytube.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Thursday, April 03, 2008 1:47 AM
Subject: Re: T5: Beaneditform Validation differences between IE6 and firefox2.0?


> Hi,
> 
> Why do you think there is an ajax request sent? Last I checked client
> side validation is done with javascript that is added to the page when
> it is rendered. I don't use the beaneditform, so I can't be sure but I
> doubt it's doing validation via ajax.
> 
> You're catching every action from Usereditor and saving the user. Is
> that really what you want? Perhaps you should be more selective and
> only save the user when the form submission is successful?
> check out
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Form.html
> for info on form events, specifically "success"
> 
> As for the javascript error in IE... try stepping into it and tell us
> what object is having the problem.
> 
> Josh
> 
> On Wed, Apr 2, 2008 at 4:37 AM, dhning <dh...@gaonline.com.cn> wrote:
>> Hi,
>>
>> I just begin to learn T5 and simply use component t:beaneditform to create/edit a simple entity User. But I found that the validation behavior are different in IE6 and firefox.
>> Please help. My tapestry version is 5.0.11.
>>
>> My entity code:
>>
>> public class User implements Serializable {
>>    private String username;
>>    private String password;
>>
>>    @Validate("required") // for tapestry, add require validation.
>>    public String getPassword() {
>>        return password;
>>    }
>>    // other setter & getter
>> }
>>
>> My page class code:
>>
>> public class CreateUser extends BasePage { // my base page to inject the entity service
>>
>>    private User user; // not persistent
>>
>>    public User getUser() {
>>        return this.user;
>>    }
>>
>>    public void setUser(User user) {
>>        this.user = user;
>>    }
>>
>>    @InjectPage
>>    private UserList listPage;
>>
>>    UserList onActionFromUsereditor() {
>>     getEntityService().save(user);
>>
>>        return this.listPage;
>>    }
>> }
>>
>> I don't write any validation in page class, such as onSuccess ...
>>
>> My template code:
>> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>    <head>
>>
>>        <title>t5first Start Page</title>
>>    </head>
>>    <body>
>>        <h1>Create User</h1>
>>
>>   <t:beaneditform t:id="usereditor" t:object="user" t:submitLabel="message:button.save"/>
>>
>>    </body>
>> </html>
>>
>> Case: I input nothing, and click "submit" button.
>> In firefox everything works. A ajax request is sent, later a popup prompt that "password" can't be null.
>> But in IE6(I have installed VS2005 studio as debugger), when I click "submit" button, a js error happens: Object doesn't support this property or method and ask me whether to debug or not.
>> I choose not, then the "onActionFromUsereditor" is invoked and page navigates to the user list page. An user record has been added to DB!!!.
>>
>> Would you please help?
>>
>> BTW, T4's client validation is very good without sending ajax request, is there a way for T5 to implement such feature?
>>
>> Thanks!
>> DH
> 
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>

Re: T5: Beaneditform Validation differences between IE6 and firefox2.0?

Posted by Josh Canfield <jo...@thedailytube.com>.
Hi,

Why do you think there is an ajax request sent? Last I checked client
side validation is done with javascript that is added to the page when
it is rendered. I don't use the beaneditform, so I can't be sure but I
doubt it's doing validation via ajax.

You're catching every action from Usereditor and saving the user. Is
that really what you want? Perhaps you should be more selective and
only save the user when the form submission is successful?
check out
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Form.html
for info on form events, specifically "success"

As for the javascript error in IE... try stepping into it and tell us
what object is having the problem.

Josh

On Wed, Apr 2, 2008 at 4:37 AM, dhning <dh...@gaonline.com.cn> wrote:
> Hi,
>
> I just begin to learn T5 and simply use component t:beaneditform to create/edit a simple entity User. But I found that the validation behavior are different in IE6 and firefox.
> Please help. My tapestry version is 5.0.11.
>
> My entity code:
>
> public class User implements Serializable {
>    private String username;
>    private String password;
>
>    @Validate("required") // for tapestry, add require validation.
>    public String getPassword() {
>        return password;
>    }
>    // other setter & getter
> }
>
> My page class code:
>
> public class CreateUser extends BasePage { // my base page to inject the entity service
>
>    private User user; // not persistent
>
>    public User getUser() {
>        return this.user;
>    }
>
>    public void setUser(User user) {
>        this.user = user;
>    }
>
>    @InjectPage
>    private UserList listPage;
>
>    UserList onActionFromUsereditor() {
>     getEntityService().save(user);
>
>        return this.listPage;
>    }
> }
>
> I don't write any validation in page class, such as onSuccess ...
>
> My template code:
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    <head>
>
>        <title>t5first Start Page</title>
>    </head>
>    <body>
>        <h1>Create User</h1>
>
>   <t:beaneditform t:id="usereditor" t:object="user" t:submitLabel="message:button.save"/>
>
>    </body>
> </html>
>
> Case: I input nothing, and click "submit" button.
> In firefox everything works. A ajax request is sent, later a popup prompt that "password" can't be null.
> But in IE6(I have installed VS2005 studio as debugger), when I click "submit" button, a js error happens: Object doesn't support this property or method and ask me whether to debug or not.
> I choose not, then the "onActionFromUsereditor" is invoked and page navigates to the user list page. An user record has been added to DB!!!.
>
> Would you please help?
>
> BTW, T4's client validation is very good without sending ajax request, is there a way for T5 to implement such feature?
>
> Thanks!
> DH



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Beaneditform Validation differences between IE6 and firefox2.0?

Posted by dhning <dh...@gaonline.com.cn>.
Forgot to mention that the js error source in tapestry.js:

if (! event.result)
        {
            domevent.stop(); // debugger shows me the error here. 532 line in tapestry.js
        }
        else
        {
            this.form.fire("form:prepareforsubmit");
        }

        return event.result;


Thanks!

DH


----- Original Message ----- 
From: "dhning" <dh...@gaonline.com.cn>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Wednesday, April 02, 2008 7:37 PM
Subject: T5: Beaneditform Validation differences between IE6 and firefox2.0?


> Hi, 
> 
> I just begin to learn T5 and simply use component t:beaneditform to create/edit a simple entity User. But I found that the validation behavior are different in IE6 and firefox.
> Please help. My tapestry version is 5.0.11.
> 
> My entity code:
> 
> public class User implements Serializable {
>    private String username;
>    private String password;
> 
>    @Validate("required") // for tapestry, add require validation.
>    public String getPassword() {
>        return password;
>    }
>    // other setter & getter
> }
> 
> My page class code:
> 
> public class CreateUser extends BasePage { // my base page to inject the entity service
> 
>    private User user; // not persistent
> 
>    public User getUser() {
>        return this.user;
>    }
> 
>    public void setUser(User user) {
>        this.user = user;
>    }
>    
>    @InjectPage
>    private UserList listPage;
>    
>    UserList onActionFromUsereditor() {
>     getEntityService().save(user);
>        
>        return this.listPage;
>    }
> }
> 
> I don't write any validation in page class, such as onSuccess ...
> 
> My template code:
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    <head>
> 
>        <title>t5first Start Page</title>
>    </head>
>    <body>
>        <h1>Create User</h1>
>  
>   <t:beaneditform t:id="usereditor" t:object="user" t:submitLabel="message:button.save"/>
> 
>    </body>
> </html>
> 
> Case: I input nothing, and click "submit" button.
> In firefox everything works. A ajax request is sent, later a popup prompt that "password" can't be null.
> But in IE6(I have installed VS2005 studio as debugger), when I click "submit" button, a js error happens: Object doesn't support this property or method and ask me whether to debug or not.
> I choose not, then the "onActionFromUsereditor" is invoked and page navigates to the user list page. An user record has been added to DB!!!.
> 
> Would you please help?
> 
> BTW, T4's client validation is very good without sending ajax request, is there a way for T5 to implement such feature?
> 
> Thanks!
> DH

T5: Beaneditform Validation differences between IE6 and firefox2.0?

Posted by dhning <dh...@gaonline.com.cn>.
Hi, 

I just begin to learn T5 and simply use component t:beaneditform to create/edit a simple entity User. But I found that the validation behavior are different in IE6 and firefox.
Please help. My tapestry version is 5.0.11.

My entity code:

public class User implements Serializable {
    private String username;
    private String password;

    @Validate("required") // for tapestry, add require validation.
    public String getPassword() {
        return password;
    }
    // other setter & getter
}

My page class code:

public class CreateUser extends BasePage { // my base page to inject the entity service

    private User user; // not persistent

    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }
    
    @InjectPage
    private UserList listPage;
    
    UserList onActionFromUsereditor() {
     getEntityService().save(user);
        
        return this.listPage;
    }
}

I don't write any validation in page class, such as onSuccess ...

My template code:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <head>

        <title>t5first Start Page</title>
    </head>
    <body>
        <h1>Create User</h1>
  
   <t:beaneditform t:id="usereditor" t:object="user" t:submitLabel="message:button.save"/>
 
    </body>
</html>

Case: I input nothing, and click "submit" button.
In firefox everything works. A ajax request is sent, later a popup prompt that "password" can't be null.
But in IE6(I have installed VS2005 studio as debugger), when I click "submit" button, a js error happens: Object doesn't support this property or method and ask me whether to debug or not.
I choose not, then the "onActionFromUsereditor" is invoked and page navigates to the user list page. An user record has been added to DB!!!.

Would you please help?

BTW, T4's client validation is very good without sending ajax request, is there a way for T5 to implement such feature?

Thanks!
DH

Re: T5: Layout question

Posted by 宁德辉 <dh...@gaonline.com.cn>.
It looks like that T5 doesn't have such solution as $content$ in T4.
It is discussed before. http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-to15719185.html#a15739812
Even though the t:container element can't help.

Thanks!

DH


----- Original Message ----- 
From: "Julien HENRY" <he...@yahoo.fr>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Wednesday, April 02, 2008 6:49 PM
Subject: Re : T5: Layout question


Hi Onno,

You don't need to do anything else. Everything outside of 
<div class="text-column" t:type="Border">
                  Page content
</div>
will be discarded and the Layout component will be used instead. Is it not the case?

Regards,

Julien

----- Message d'origine ----
De : Onno Scheffers <on...@piraya.nl>
À : Tapestry users <us...@tapestry.apache.org>
Envoyé le : Mercredi, 2 Avril 2008, 11h26mn 58s
Objet : T5: Layout question

I created a Layout component called Border.
According to the documentation, I have to setup my page something like this:
<html t:type="Border" xmlns:t="
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
   Page content
</html>

I want the template to be previewable though so the webdesigners can work
with the pages more easily.
For this I need some more markup around the page content that needs to be
ignored when rendering the page. Thus something like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
   <body>
      <div id="main">
         <div id="content">
            <div class="content-holder">
               <div class="text-column" t:type="Border">
                  Page content
               </div>
            </div>
         </div>
      </div>
   </body>
</html>

Is there a way I can tell Tapestry to ignore all Markup outside of the
Border component?

regards,

Onno





      _____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact. http://mail.yahoo.fr

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


Re: Re : T5: Layout question

Posted by Howard Lewis Ship <hl...@gmail.com>.
This is not the case.

T4 had the $content$ and $remove$ directives.  These are useful
features that have not yet made it into Tapestry 5.

On Wed, Apr 2, 2008 at 3:49 AM, Julien HENRY <he...@yahoo.fr> wrote:
> Hi Onno,
>
>  You don't need to do anything else. Everything outside of
>
> <div class="text-column" t:type="Border">
>                   Page content
>  </div>
>  will be discarded and the Layout component will be used instead. Is it not the case?
>
>  Regards,
>
>  Julien
>
>  ----- Message d'origine ----
>  De : Onno Scheffers <on...@piraya.nl>
>  À : Tapestry users <us...@tapestry.apache.org>
>  Envoyé le : Mercredi, 2 Avril 2008, 11h26mn 58s
>  Objet : T5: Layout question
>
>
>
>  I created a Layout component called Border.
>  According to the documentation, I have to setup my page something like this:
>  <html t:type="Border" xmlns:t="
>  http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    Page content
>  </html>
>
>  I want the template to be previewable though so the webdesigners can work
>  with the pages more easily.
>  For this I need some more markup around the page content that needs to be
>  ignored when rendering the page. Thus something like this:
>
>  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
>  http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
>  http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    <body>
>       <div id="main">
>          <div id="content">
>             <div class="content-holder">
>                <div class="text-column" t:type="Border">
>                   Page content
>                </div>
>             </div>
>          </div>
>       </div>
>    </body>
>  </html>
>
>  Is there a way I can tell Tapestry to ignore all Markup outside of the
>  Border component?
>
>  regards,
>
>  Onno
>
>
>
>
>
>
>       _____________________________________________________________________________
>  Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact. http://mail.yahoo.fr
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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