You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Stanton <pa...@mapshed.com.au> on 2011/06/13 00:09:49 UTC

form observe submit not working?

Hi,

I've read multiple times that this is the recommended approach to adding 
client side callbacks when a form is submitted, however it isn't working 
for me:

<t:form t:id="myForm">
<t:submit />
</t:form>

<script type="text/javascript">
             $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT, 
function()
                     {
                         alert("submitting");
                     });
             alert("listening");
</script>

Can someone point out what I have done wrong?

Thanks, p.

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


Re: form observe submit not working?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sun, 12 Jun 2011 19:09:49 -0300, Paul Stanton <pa...@mapshed.com.au>  
wrote:

> Hi,

Hi!

> I've read multiple times that this is the recommended approach to adding  
> client side callbacks when a form is submitted, however it isn't working  
> for me:
>
> <t:form t:id="myForm">
> <t:submit />
> </t:form>

Please try giving an explicit id to <t:submit> which isn't "submit",  
something like <t:submit id="submit1"/>. I recall people having this  
problem with 5.1.0.5.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: form observe submit not working?

Posted by Josh Canfield <jo...@gmail.com>.
> I'm not sure what the relevance/purpose of your java code re setupRender is,
> however it seems it is not required.

When I use only the form and submit components in the page then the
core javascript stack (tapestry.js, prototype.js etc.) is not included
in the page. You must be using some other component that causes the
stack to load. Calling addScript(";") forces the core stack into the
page with no side effects (empty string is ignored);

> Would you like to post this solution to SO and get credit?
Done, it'll be my first answer :)

Josh


On Mon, Jun 13, 2011 at 7:33 PM, Paul Stanton <pa...@mapshed.com.au> wrote:
> Thanks Josh,
>
> Simply adding `$("myForm").getFormEventManager();` prior is enough to fix
> the problem.
>
> You're correct, doing this in `onDOMLoaded` is probably recommended, however
> clearly not required.
>
> I'm not sure what the relevance/purpose of your java code re setupRender is,
> however it seems it is not required.
>
> Would you like to post this solution to SO and get credit?
>
> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>
> otherwise i'll solve there to close it off.....
>
> Cheers, p.
>
> On 14/06/2011 10:13 AM, Josh Canfield wrote:
>>>
>>> If anyone can suggest a workaround, that would be great.
>>
>> There is an interesting defect in 5.1.0.5, I didn't look to see if
>> it's reported, I'd be surprised if it wasn't since it seems pretty
>> critical.
>>
>> A simple<t:form><t:submit/></t:form>  doesn't include any of the core
>> tapestry javascript libraries so it's not even hooking onSubmit in the
>> form.
>>
>> You need to get two things to happen: get tapestry.js and friends into
>> the page and get the FormEventManager created (this is where onSubmit
>> is hooked)
>>
>>  @Inject
>>     private RenderSupport renderSupport;
>>
>>     void setupRender() {
>>         /// non-blank addScript causes stack to get added
>>         renderSupport.addScript(";");
>>     }
>>
>> I updated the TML to wait for the dom to load so you don't get strange
>> timing errors:
>>
>> <t:form t:id="myForm">
>>     <t:submit/>
>> </t:form>
>>
>> <script type="text/javascript">
>>     Tapestry.onDOMLoaded(function() {
>>
>>                 $('myForm').getFormEventManager(); // forces the form
>> to start listening for submits
>>
>>
>> $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT, function()
>> {
>>                     alert("submitting");
>>                 });
>>                 alert("Dom loaded");
>>             }
>>     )
>> </script>
>>
>> Obnoxious, but fixed in later versions of the framework.
>>
>> Josh
>>
>> On Mon, Jun 13, 2011 at 3:45 PM, Paul Stanton<pa...@mapshed.com.au>  wrote:
>>>
>>> Thanks Shing,
>>>
>>> This confirms what I'm seeing.
>>>
>>> If anyone can suggest a workaround, that would be great.
>>>
>>> p.
>>>
>>> On 14/06/2011 5:07 AM, Shing Hing Man wrote:
>>>>
>>>> I have run your piece code in Tap 5.1.0.5 and only seeing the listening
>>>> message when I clicked submit.
>>>>
>>>> Shing
>>>>
>>>>
>>>> --- On Mon, 13/6/11, Paul Stanton<pa...@mapshed.com.au>    wrote:
>>>>
>>>>> From: Paul Stanton<pa...@mapshed.com.au>
>>>>> Subject: Re: form observe submit not working?
>>>>> To: "Tapestry users"<us...@tapestry.apache.org>
>>>>> Date: Monday, 13 June, 2011, 15:05
>>>>> Can someone please confirm the
>>>>> behaviour in 5.1.0.5 ? I just want to
>>>>> make sure i'm not going mad!!!
>>>>>
>>>>> thanks, p.
>>>>>
>>>>> On 13/06/2011 2:21 PM, Taha Hafeez wrote:
>>>>>>
>>>>>> Hi Paul,
>>>>>>
>>>>>> I am using 5.2.5, but ideally it should work in
>>>>>
>>>>> 5.1.0.5 too.
>>>>>>
>>>>>> regards
>>>>>> Taha
>>>>>>
>>>>>>
>>>>>> On Mon, Jun 13, 2011 at 8:40 AM, Paul Stanton<pa...@mapshed.com.au>
>>>>>
>>>>> wrote:
>>>>>>>
>>>>>>> taha, i'm using 5.1.0.5 and this is the only code
>>>>>
>>>>> in the tml ..
>>>>>>>
>>>>>>> are you sure you get the 'submitting' message and
>>>>>
>>>>> not just the 'listening'
>>>>>>>
>>>>>>> message?
>>>>>>>
>>>>>>> thanks, p.
>>>>>>>
>>>>>>>
>>>>>>> On 13/06/2011 12:10 PM, Taha Hafeez wrote:
>>>>>>>
>>>>>>>> This is nothing wrong with this code as I
>>>>>
>>>>> created a page and copy-pasted
>>>>>>>>
>>>>>>>> your code, it works.
>>>>>>>>
>>>>>>>> I checked it on firefox and chrome and it
>>>>>
>>>>> works fine. You should
>>>>>>>>
>>>>>>>> check/debug
>>>>>>>> if there is some error in another part of the
>>>>>
>>>>> page.
>>>>>>>>
>>>>>>>> regards
>>>>>>>> Taha
>>>>>>>>
>>>>>>>> On Mon, Jun 13, 2011 at 7:00 AM, Paul
>>>>>
>>>>> Stanton<pa...@mapshed.com.au>
>>>>>>>>
>>>>>>>>    wrote:
>>>>>>>>
>>>>>>>>    Thanks Taha, however that did
>>>>>
>>>>> not help. If you view source the id is
>>>>>>>>>
>>>>>>>>> correctly rendered as 'myForm'. The source
>>>>>
>>>>> is now:
>>>>>>>>>
>>>>>>>>> <t:form t:id="myForm" id="myForm">
>>>>>>>>>
>>>>>>>>> <t:submit />
>>>>>>>>> </t:form>
>>>>>>>>>
>>>>>>>>> <script type="text/javascript">
>>>>>>>>>
>>>>>    $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
>>>>>>>>>
>>>>>>>>> function()
>>>>>>>>>
>>>>>          {
>>>>>              alert("submitting");
>>>>>          });
>>>>>    alert("listening");
>>>>>>>>>
>>>>>>>>> </script>
>>>>>>>>>
>>>>>>>>> Still never seeing the message
>>>>>
>>>>> "submitting".
>>>>>>>>>
>>>>>>>>> This question has been posted to stack
>>>>>
>>>>> overflow also, so if you have an
>>>>>>>>>
>>>>>>>>> answer and want some so points feel free
>>>>>
>>>>> to answer it here:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>>>>>>>>>
>>>>>>>>> p.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 13/06/2011 10:43 AM, Taha Hafeez
>>>>>
>>>>> wrote:
>>>>>>>>>
>>>>>>>>>    Hi
>>>>>>>>>>
>>>>>>>>>> The t:id is a unique id for a
>>>>>
>>>>> component within the parent component and
>>>>>>>>>>
>>>>>>>>>> does
>>>>>>>>>> not necessarily map to javascript id.
>>>>>
>>>>> You can either specify an id for
>>>>>>>>>>
>>>>>>>>>> the
>>>>>>>>>> form
>>>>>>>>>>
>>>>>>>>>> <form t:type='form' t:id='myForm'
>>>>>
>>>>> id='myForm'>
>>>>>>>>>>
>>>>>>>>>> or add javascript the recommended way
>>>>>
>>>>> using
>>>>> JavaScriptSupport.addScript/addInitializerCall. There you
>>>>> can use
>>>>>>>>>>
>>>>>>>>>> form.getClientId() to get the
>>>>>
>>>>> javascript id
>>>>>>>>>>
>>>>>>>>>> regards
>>>>>>>>>> Taha
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul
>>>>>
>>>>> Stanton<pa...@mapshed.com.au>
>>>>>>>>>>
>>>>>>>>>>    wrote:
>>>>>>>>>>
>>>>>>>>>>    alan,
>>>>>>>>>>
>>>>>>>>>>> there is no javascript on the page
>>>>>
>>>>> you suggested. i don't think you
>>>>>>>>>>>
>>>>>>>>>>> understand the question.
>>>>>>>>>>>
>>>>>>>>>>> p.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 13/06/2011 9:08 AM, ael wrote:
>>>>>>>>>>>
>>>>>>>>>>>    I think this can
>>>>>
>>>>> help you.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>>>>>>
>>>>>>>>>>>> Use the method shown.
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>>>>>>>>>>> Sent from the Tapestry - User
>>>>>
>>>>> mailing list archive at Nabble.com.
>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>
>>>>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>>>>
>>>>>>> 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
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>

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


Re: form observe submit not working?

Posted by Paul Stanton <pa...@mapshed.com.au>.
Thanks Josh,

Simply adding `$("myForm").getFormEventManager();` prior is enough to 
fix the problem.

You're correct, doing this in `onDOMLoaded` is probably recommended, 
however clearly not required.

I'm not sure what the relevance/purpose of your java code re setupRender 
is, however it seems it is not required.

Would you like to post this solution to SO and get credit?

http://stackoverflow.com/questions/6325026/form-observe-submit-not-working

otherwise i'll solve there to close it off.....

Cheers, p.

On 14/06/2011 10:13 AM, Josh Canfield wrote:
>> If anyone can suggest a workaround, that would be great.
> There is an interesting defect in 5.1.0.5, I didn't look to see if
> it's reported, I'd be surprised if it wasn't since it seems pretty
> critical.
>
> A simple<t:form><t:submit/></t:form>  doesn't include any of the core
> tapestry javascript libraries so it's not even hooking onSubmit in the
> form.
>
> You need to get two things to happen: get tapestry.js and friends into
> the page and get the FormEventManager created (this is where onSubmit
> is hooked)
>
>   @Inject
>      private RenderSupport renderSupport;
>
>      void setupRender() {
>          /// non-blank addScript causes stack to get added
>          renderSupport.addScript(";");
>      }
>
> I updated the TML to wait for the dom to load so you don't get strange
> timing errors:
>
> <t:form t:id="myForm">
>      <t:submit/>
> </t:form>
>
> <script type="text/javascript">
>      Tapestry.onDOMLoaded(function() {
>
>                  $('myForm').getFormEventManager(); // forces the form
> to start listening for submits
>
>
> $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT, function()
> {
>                      alert("submitting");
>                  });
>                  alert("Dom loaded");
>              }
>      )
> </script>
>
> Obnoxious, but fixed in later versions of the framework.
>
> Josh
>
> On Mon, Jun 13, 2011 at 3:45 PM, Paul Stanton<pa...@mapshed.com.au>  wrote:
>> Thanks Shing,
>>
>> This confirms what I'm seeing.
>>
>> If anyone can suggest a workaround, that would be great.
>>
>> p.
>>
>> On 14/06/2011 5:07 AM, Shing Hing Man wrote:
>>> I have run your piece code in Tap 5.1.0.5 and only seeing the listening
>>> message when I clicked submit.
>>>
>>> Shing
>>>
>>>
>>> --- On Mon, 13/6/11, Paul Stanton<pa...@mapshed.com.au>    wrote:
>>>
>>>> From: Paul Stanton<pa...@mapshed.com.au>
>>>> Subject: Re: form observe submit not working?
>>>> To: "Tapestry users"<us...@tapestry.apache.org>
>>>> Date: Monday, 13 June, 2011, 15:05
>>>> Can someone please confirm the
>>>> behaviour in 5.1.0.5 ? I just want to
>>>> make sure i'm not going mad!!!
>>>>
>>>> thanks, p.
>>>>
>>>> On 13/06/2011 2:21 PM, Taha Hafeez wrote:
>>>>> Hi Paul,
>>>>>
>>>>> I am using 5.2.5, but ideally it should work in
>>>> 5.1.0.5 too.
>>>>> regards
>>>>> Taha
>>>>>
>>>>>
>>>>> On Mon, Jun 13, 2011 at 8:40 AM, Paul Stanton<pa...@mapshed.com.au>
>>>> wrote:
>>>>>> taha, i'm using 5.1.0.5 and this is the only code
>>>> in the tml ..
>>>>>> are you sure you get the 'submitting' message and
>>>> not just the 'listening'
>>>>>> message?
>>>>>>
>>>>>> thanks, p.
>>>>>>
>>>>>>
>>>>>> On 13/06/2011 12:10 PM, Taha Hafeez wrote:
>>>>>>
>>>>>>> This is nothing wrong with this code as I
>>>> created a page and copy-pasted
>>>>>>> your code, it works.
>>>>>>>
>>>>>>> I checked it on firefox and chrome and it
>>>> works fine. You should
>>>>>>> check/debug
>>>>>>> if there is some error in another part of the
>>>> page.
>>>>>>> regards
>>>>>>> Taha
>>>>>>>
>>>>>>> On Mon, Jun 13, 2011 at 7:00 AM, Paul
>>>> Stanton<pa...@mapshed.com.au>
>>>>>>>     wrote:
>>>>>>>
>>>>>>>     Thanks Taha, however that did
>>>> not help. If you view source the id is
>>>>>>>> correctly rendered as 'myForm'. The source
>>>> is now:
>>>>>>>> <t:form t:id="myForm" id="myForm">
>>>>>>>>
>>>>>>>> <t:submit />
>>>>>>>> </t:form>
>>>>>>>>
>>>>>>>> <script type="text/javascript">
>>>>>>>>
>>>>     $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
>>>>>>>> function()
>>>>>>>>
>>>>           {
>>>>               alert("submitting");
>>>>           });
>>>>     alert("listening");
>>>>>>>> </script>
>>>>>>>>
>>>>>>>> Still never seeing the message
>>>> "submitting".
>>>>>>>> This question has been posted to stack
>>>> overflow also, so if you have an
>>>>>>>> answer and want some so points feel free
>>>> to answer it here:
>>>>>>>>
>>>>>>>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>>>>>>>>
>>>>>>>> p.
>>>>>>>>
>>>>>>>>
>>>>>>>> On 13/06/2011 10:43 AM, Taha Hafeez
>>>> wrote:
>>>>>>>>     Hi
>>>>>>>>> The t:id is a unique id for a
>>>> component within the parent component and
>>>>>>>>> does
>>>>>>>>> not necessarily map to javascript id.
>>>> You can either specify an id for
>>>>>>>>> the
>>>>>>>>> form
>>>>>>>>>
>>>>>>>>> <form t:type='form' t:id='myForm'
>>>> id='myForm'>
>>>>>>>>> or add javascript the recommended way
>>>> using
>>>> JavaScriptSupport.addScript/addInitializerCall. There you
>>>> can use
>>>>>>>>> form.getClientId() to get the
>>>> javascript id
>>>>>>>>> regards
>>>>>>>>> Taha
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul
>>>> Stanton<pa...@mapshed.com.au>
>>>>>>>>>     wrote:
>>>>>>>>>
>>>>>>>>>     alan,
>>>>>>>>>
>>>>>>>>>> there is no javascript on the page
>>>> you suggested. i don't think you
>>>>>>>>>> understand the question.
>>>>>>>>>>
>>>>>>>>>> p.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 13/06/2011 9:08 AM, ael wrote:
>>>>>>>>>>
>>>>>>>>>>     I think this can
>>>> help you.
>>>>>>>>>>>
>>>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>>>>>
>>>>>>>>>>> Use the method shown.
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> View this message in context:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>>>>>>>>>> Sent from the Tapestry - User
>>>> mailing list archive at Nabble.com.
>>>> ---------------------------------------------------------------------
>>>>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>
>>>
>> ---------------------------------------------------------------------
>> 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: form observe submit not working?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 13 Jun 2011 21:13:32 -0300, Josh Canfield <jo...@gmail.com>  
wrote:

> <t:form t:id="myForm">
>     <t:submit/>
> </t:form>

By the way, there's no need to use the Submit component unless you have  
more than one submit button. An ordinary HTML <input type="submit"/>  
works, inclusive for
AJAX and validation and etc, so that's what I recommend for single-submit  
button scenarios.

<t:form t:id="myForm">
      <input type="submit"/>
</t:form>

By the way again, I prefer to use invisible instrumentation, so my  
template looks like ordinary HTML (including the generated one):

<form t:type="Form" t:id="myForm">
      <input type="submit"/>
</form>

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: form observe submit not working?

Posted by Josh Canfield <jo...@gmail.com>.
> If anyone can suggest a workaround, that would be great.

There is an interesting defect in 5.1.0.5, I didn't look to see if
it's reported, I'd be surprised if it wasn't since it seems pretty
critical.

A simple <t:form><t:submit/></t:form> doesn't include any of the core
tapestry javascript libraries so it's not even hooking onSubmit in the
form.

You need to get two things to happen: get tapestry.js and friends into
the page and get the FormEventManager created (this is where onSubmit
is hooked)

 @Inject
    private RenderSupport renderSupport;

    void setupRender() {
        /// non-blank addScript causes stack to get added
        renderSupport.addScript(";");
    }

I updated the TML to wait for the dom to load so you don't get strange
timing errors:

<t:form t:id="myForm">
    <t:submit/>
</t:form>

<script type="text/javascript">
    Tapestry.onDOMLoaded(function() {

                $('myForm').getFormEventManager(); // forces the form
to start listening for submits


$("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT, function()
{
                    alert("submitting");
                });
                alert("Dom loaded");
            }
    )
</script>

Obnoxious, but fixed in later versions of the framework.

Josh

On Mon, Jun 13, 2011 at 3:45 PM, Paul Stanton <pa...@mapshed.com.au> wrote:
> Thanks Shing,
>
> This confirms what I'm seeing.
>
> If anyone can suggest a workaround, that would be great.
>
> p.
>
> On 14/06/2011 5:07 AM, Shing Hing Man wrote:
>>
>> I have run your piece code in Tap 5.1.0.5 and only seeing the listening
>> message when I clicked submit.
>>
>> Shing
>>
>>
>> --- On Mon, 13/6/11, Paul Stanton<pa...@mapshed.com.au>  wrote:
>>
>>> From: Paul Stanton<pa...@mapshed.com.au>
>>> Subject: Re: form observe submit not working?
>>> To: "Tapestry users"<us...@tapestry.apache.org>
>>> Date: Monday, 13 June, 2011, 15:05
>>> Can someone please confirm the
>>> behaviour in 5.1.0.5 ? I just want to
>>> make sure i'm not going mad!!!
>>>
>>> thanks, p.
>>>
>>> On 13/06/2011 2:21 PM, Taha Hafeez wrote:
>>>>
>>>> Hi Paul,
>>>>
>>>> I am using 5.2.5, but ideally it should work in
>>>
>>> 5.1.0.5 too.
>>>>
>>>> regards
>>>> Taha
>>>>
>>>>
>>>> On Mon, Jun 13, 2011 at 8:40 AM, Paul Stanton<pa...@mapshed.com.au>
>>>
>>> wrote:
>>>>>
>>>>> taha, i'm using 5.1.0.5 and this is the only code
>>>
>>> in the tml ..
>>>>>
>>>>> are you sure you get the 'submitting' message and
>>>
>>> not just the 'listening'
>>>>>
>>>>> message?
>>>>>
>>>>> thanks, p.
>>>>>
>>>>>
>>>>> On 13/06/2011 12:10 PM, Taha Hafeez wrote:
>>>>>
>>>>>> This is nothing wrong with this code as I
>>>
>>> created a page and copy-pasted
>>>>>>
>>>>>> your code, it works.
>>>>>>
>>>>>> I checked it on firefox and chrome and it
>>>
>>> works fine. You should
>>>>>>
>>>>>> check/debug
>>>>>> if there is some error in another part of the
>>>
>>> page.
>>>>>>
>>>>>> regards
>>>>>> Taha
>>>>>>
>>>>>> On Mon, Jun 13, 2011 at 7:00 AM, Paul
>>>
>>> Stanton<pa...@mapshed.com.au>
>>>>>>
>>>>>>    wrote:
>>>>>>
>>>>>>    Thanks Taha, however that did
>>>
>>> not help. If you view source the id is
>>>>>>>
>>>>>>> correctly rendered as 'myForm'. The source
>>>
>>> is now:
>>>>>>>
>>>>>>> <t:form t:id="myForm" id="myForm">
>>>>>>>
>>>>>>> <t:submit />
>>>>>>> </t:form>
>>>>>>>
>>>>>>> <script type="text/javascript">
>>>>>>>
>>>    $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
>>>>>>>
>>>>>>> function()
>>>>>>>
>>>          {
>>>>>>>
>>>              alert("submitting");
>>>>>>>
>>>          });
>>>>>>>
>>>    alert("listening");
>>>>>>>
>>>>>>> </script>
>>>>>>>
>>>>>>> Still never seeing the message
>>>
>>> "submitting".
>>>>>>>
>>>>>>> This question has been posted to stack
>>>
>>> overflow also, so if you have an
>>>>>>>
>>>>>>> answer and want some so points feel free
>>>
>>> to answer it here:
>>>>>>>
>>>>>>>
>>>>>>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>>>>>>>
>>>>>>> p.
>>>>>>>
>>>>>>>
>>>>>>> On 13/06/2011 10:43 AM, Taha Hafeez
>>>
>>> wrote:
>>>>>>>
>>>>>>>    Hi
>>>>>>>>
>>>>>>>> The t:id is a unique id for a
>>>
>>> component within the parent component and
>>>>>>>>
>>>>>>>> does
>>>>>>>> not necessarily map to javascript id.
>>>
>>> You can either specify an id for
>>>>>>>>
>>>>>>>> the
>>>>>>>> form
>>>>>>>>
>>>>>>>> <form t:type='form' t:id='myForm'
>>>
>>> id='myForm'>
>>>>>>>>
>>>>>>>> or add javascript the recommended way
>>>
>>> using
>>> JavaScriptSupport.addScript/addInitializerCall. There you
>>> can use
>>>>>>>>
>>>>>>>> form.getClientId() to get the
>>>
>>> javascript id
>>>>>>>>
>>>>>>>> regards
>>>>>>>> Taha
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul
>>>
>>> Stanton<pa...@mapshed.com.au>
>>>>>>>>
>>>>>>>>    wrote:
>>>>>>>>
>>>>>>>>    alan,
>>>>>>>>
>>>>>>>>> there is no javascript on the page
>>>
>>> you suggested. i don't think you
>>>>>>>>>
>>>>>>>>> understand the question.
>>>>>>>>>
>>>>>>>>> p.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 13/06/2011 9:08 AM, ael wrote:
>>>>>>>>>
>>>>>>>>>    I think this can
>>>
>>> help you.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>>>>
>>>>>>>>>> Use the method shown.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> View this message in context:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>>>>>>>>> Sent from the Tapestry - User
>>>
>>> mailing list archive at Nabble.com.
>>>>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 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
>>>>>>>
>>>>>>>
>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>
>>>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: form observe submit not working?

Posted by Paul Stanton <pa...@mapshed.com.au>.
One workaround (might not be ideal) is to listen to the "submit" event 
instead of Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT

Hope that helps someone.

p.

On 14/06/2011 8:45 AM, Paul Stanton wrote:
> Thanks Shing,
>
> This confirms what I'm seeing.
>
> If anyone can suggest a workaround, that would be great.
>
> p.
>
> On 14/06/2011 5:07 AM, Shing Hing Man wrote:
>> I have run your piece code in Tap 5.1.0.5 and only seeing the 
>> listening message when I clicked submit.
>>
>> Shing
>>
>>
>> --- On Mon, 13/6/11, Paul Stanton<pa...@mapshed.com.au>  wrote:
>>
>>> From: Paul Stanton<pa...@mapshed.com.au>
>>> Subject: Re: form observe submit not working?
>>> To: "Tapestry users"<us...@tapestry.apache.org>
>>> Date: Monday, 13 June, 2011, 15:05
>>> Can someone please confirm the
>>> behaviour in 5.1.0.5 ? I just want to
>>> make sure i'm not going mad!!!
>>>
>>> thanks, p.
>>>
>>> On 13/06/2011 2:21 PM, Taha Hafeez wrote:
>>>> Hi Paul,
>>>>
>>>> I am using 5.2.5, but ideally it should work in
>>> 5.1.0.5 too.
>>>> regards
>>>> Taha
>>>>
>>>>
>>>> On Mon, Jun 13, 2011 at 8:40 AM, Paul Stanton<pa...@mapshed.com.au>
>>> wrote:
>>>>> taha, i'm using 5.1.0.5 and this is the only code
>>> in the tml ..
>>>>> are you sure you get the 'submitting' message and
>>> not just the 'listening'
>>>>> message?
>>>>>
>>>>> thanks, p.
>>>>>
>>>>>
>>>>> On 13/06/2011 12:10 PM, Taha Hafeez wrote:
>>>>>
>>>>>> This is nothing wrong with this code as I
>>> created a page and copy-pasted
>>>>>> your code, it works.
>>>>>>
>>>>>> I checked it on firefox and chrome and it
>>> works fine. You should
>>>>>> check/debug
>>>>>> if there is some error in another part of the
>>> page.
>>>>>> regards
>>>>>> Taha
>>>>>>
>>>>>> On Mon, Jun 13, 2011 at 7:00 AM, Paul
>>> Stanton<pa...@mapshed.com.au>
>>>>>>     wrote:
>>>>>>
>>>>>>     Thanks Taha, however that did
>>> not help. If you view source the id is
>>>>>>> correctly rendered as 'myForm'. The source
>>> is now:
>>>>>>> <t:form t:id="myForm" id="myForm">
>>>>>>>
>>>>>>> <t:submit />
>>>>>>> </t:form>
>>>>>>>
>>>>>>> <script type="text/javascript">
>>>>>>>
>>>     $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
>>>>>>> function()
>>>>>>>
>>>           {
>>>>>>>
>>>               alert("submitting");
>>>>>>>
>>>           });
>>>>>>>
>>>     alert("listening");
>>>>>>> </script>
>>>>>>>
>>>>>>> Still never seeing the message
>>> "submitting".
>>>>>>> This question has been posted to stack
>>> overflow also, so if you have an
>>>>>>> answer and want some so points feel free
>>> to answer it here:
>>>>>>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working 
>>>>>>>
>>>>>>>
>>>>>>> p.
>>>>>>>
>>>>>>>
>>>>>>> On 13/06/2011 10:43 AM, Taha Hafeez
>>> wrote:
>>>>>>>     Hi
>>>>>>>> The t:id is a unique id for a
>>> component within the parent component and
>>>>>>>> does
>>>>>>>> not necessarily map to javascript id.
>>> You can either specify an id for
>>>>>>>> the
>>>>>>>> form
>>>>>>>>
>>>>>>>> <form t:type='form' t:id='myForm'
>>> id='myForm'>
>>>>>>>> or add javascript the recommended way
>>> using
>>> JavaScriptSupport.addScript/addInitializerCall. There you
>>> can use
>>>>>>>> form.getClientId() to get the
>>> javascript id
>>>>>>>> regards
>>>>>>>> Taha
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul
>>> Stanton<pa...@mapshed.com.au>
>>>>>>>>     wrote:
>>>>>>>>
>>>>>>>>     alan,
>>>>>>>>
>>>>>>>>> there is no javascript on the page
>>> you suggested. i don't think you
>>>>>>>>> understand the question.
>>>>>>>>>
>>>>>>>>> p.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 13/06/2011 9:08 AM, ael wrote:
>>>>>>>>>
>>>>>>>>>     I think this can
>>> help you.
>>>>>>>>>>
>>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen 
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen 
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Use the method shown.
>>>>>>>>>>
>>>>>>>>>> -- 
>>>>>>>>>> View this message in context:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html 
>>>>>>>>>>
>>>>>>>>>> Sent from the Tapestry - User
>>> mailing list archive at Nabble.com.
>>>>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>>>>> 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
>>>>>>>
>>>>>>>
>>>>>>>
>>> ---------------------------------------------------------------------
>>>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: form observe submit not working?

Posted by Paul Stanton <pa...@mapshed.com.au>.
Thanks Shing,

This confirms what I'm seeing.

If anyone can suggest a workaround, that would be great.

p.

On 14/06/2011 5:07 AM, Shing Hing Man wrote:
> I have run your piece code in Tap 5.1.0.5 and only seeing the listening message when I clicked submit.
>
> Shing
>
>
> --- On Mon, 13/6/11, Paul Stanton<pa...@mapshed.com.au>  wrote:
>
>> From: Paul Stanton<pa...@mapshed.com.au>
>> Subject: Re: form observe submit not working?
>> To: "Tapestry users"<us...@tapestry.apache.org>
>> Date: Monday, 13 June, 2011, 15:05
>> Can someone please confirm the
>> behaviour in 5.1.0.5 ? I just want to
>> make sure i'm not going mad!!!
>>
>> thanks, p.
>>
>> On 13/06/2011 2:21 PM, Taha Hafeez wrote:
>>> Hi Paul,
>>>
>>> I am using 5.2.5, but ideally it should work in
>> 5.1.0.5 too.
>>> regards
>>> Taha
>>>
>>>
>>> On Mon, Jun 13, 2011 at 8:40 AM, Paul Stanton<pa...@mapshed.com.au>
>> wrote:
>>>> taha, i'm using 5.1.0.5 and this is the only code
>> in the tml ..
>>>> are you sure you get the 'submitting' message and
>> not just the 'listening'
>>>> message?
>>>>
>>>> thanks, p.
>>>>
>>>>
>>>> On 13/06/2011 12:10 PM, Taha Hafeez wrote:
>>>>
>>>>> This is nothing wrong with this code as I
>> created a page and copy-pasted
>>>>> your code, it works.
>>>>>
>>>>> I checked it on firefox and chrome and it
>> works fine. You should
>>>>> check/debug
>>>>> if there is some error in another part of the
>> page.
>>>>> regards
>>>>> Taha
>>>>>
>>>>> On Mon, Jun 13, 2011 at 7:00 AM, Paul
>> Stanton<pa...@mapshed.com.au>
>>>>>     wrote:
>>>>>
>>>>>     Thanks Taha, however that did
>> not help. If you view source the id is
>>>>>> correctly rendered as 'myForm'. The source
>> is now:
>>>>>> <t:form t:id="myForm" id="myForm">
>>>>>>
>>>>>> <t:submit />
>>>>>> </t:form>
>>>>>>
>>>>>> <script type="text/javascript">
>>>>>>
>>     $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
>>>>>> function()
>>>>>>
>>           {
>>>>>>
>>           
>>     alert("submitting");
>>>>>>
>>           });
>>>>>>
>>     alert("listening");
>>>>>> </script>
>>>>>>
>>>>>> Still never seeing the message
>> "submitting".
>>>>>> This question has been posted to stack
>> overflow also, so if you have an
>>>>>> answer and want some so points feel free
>> to answer it here:
>>>>>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>>>>>>
>>>>>> p.
>>>>>>
>>>>>>
>>>>>> On 13/06/2011 10:43 AM, Taha Hafeez
>> wrote:
>>>>>>     Hi
>>>>>>> The t:id is a unique id for a
>> component within the parent component and
>>>>>>> does
>>>>>>> not necessarily map to javascript id.
>> You can either specify an id for
>>>>>>> the
>>>>>>> form
>>>>>>>
>>>>>>> <form t:type='form' t:id='myForm'
>> id='myForm'>
>>>>>>> or add javascript the recommended way
>> using
>> JavaScriptSupport.addScript/addInitializerCall. There you
>> can use
>>>>>>> form.getClientId() to get the
>> javascript id
>>>>>>> regards
>>>>>>> Taha
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul
>> Stanton<pa...@mapshed.com.au>
>>>>>>>     wrote:
>>>>>>>
>>>>>>>     alan,
>>>>>>>
>>>>>>>> there is no javascript on the page
>> you suggested. i don't think you
>>>>>>>> understand the question.
>>>>>>>>
>>>>>>>> p.
>>>>>>>>
>>>>>>>>
>>>>>>>> On 13/06/2011 9:08 AM, ael wrote:
>>>>>>>>
>>>>>>>>     I think this can
>> help you.
>>>>>>>>>
>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>>>
>>>>>>>>> Use the method shown.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>>>>>>>> Sent from the Tapestry - User
>> mailing list archive at Nabble.com.
>>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>> ---------------------------------------------------------------------
>>>> 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
>
>

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


Re: form observe submit not working?

Posted by Shing Hing Man <ma...@yahoo.com>.
I have run your piece code in Tap 5.1.0.5 and only seeing the listening message when I clicked submit.

Shing 


--- On Mon, 13/6/11, Paul Stanton <pa...@mapshed.com.au> wrote:

> From: Paul Stanton <pa...@mapshed.com.au>
> Subject: Re: form observe submit not working?
> To: "Tapestry users" <us...@tapestry.apache.org>
> Date: Monday, 13 June, 2011, 15:05
> Can someone please confirm the
> behaviour in 5.1.0.5 ? I just want to 
> make sure i'm not going mad!!!
> 
> thanks, p.
> 
> On 13/06/2011 2:21 PM, Taha Hafeez wrote:
> > Hi Paul,
> >
> > I am using 5.2.5, but ideally it should work in
> 5.1.0.5 too.
> >
> > regards
> > Taha
> >
> >
> > On Mon, Jun 13, 2011 at 8:40 AM, Paul Stanton<pa...@mapshed.com.au> 
> wrote:
> >
> >> taha, i'm using 5.1.0.5 and this is the only code
> in the tml ..
> >>
> >> are you sure you get the 'submitting' message and
> not just the 'listening'
> >> message?
> >>
> >> thanks, p.
> >>
> >>
> >> On 13/06/2011 12:10 PM, Taha Hafeez wrote:
> >>
> >>> This is nothing wrong with this code as I
> created a page and copy-pasted
> >>> your code, it works.
> >>>
> >>> I checked it on firefox and chrome and it
> works fine. You should
> >>> check/debug
> >>> if there is some error in another part of the
> page.
> >>>
> >>> regards
> >>> Taha
> >>>
> >>> On Mon, Jun 13, 2011 at 7:00 AM, Paul
> Stanton<pa...@mapshed.com.au>
> >>>   wrote:
> >>>
> >>>   Thanks Taha, however that did
> not help. If you view source the id is
> >>>> correctly rendered as 'myForm'. The source
> is now:
> >>>>
> >>>> <t:form t:id="myForm" id="myForm">
> >>>>
> >>>> <t:submit />
> >>>> </t:form>
> >>>>
> >>>> <script type="text/javascript">
> >>>>         
>    $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
> >>>> function()
> >>>>           
>          {
> >>>>           
>          
>    alert("submitting");
> >>>>           
>          });
> >>>>         
>    alert("listening");
> >>>> </script>
> >>>>
> >>>> Still never seeing the message
> "submitting".
> >>>>
> >>>> This question has been posted to stack
> overflow also, so if you have an
> >>>> answer and want some so points feel free
> to answer it here:
> >>>>
> >>>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
> >>>>
> >>>> p.
> >>>>
> >>>>
> >>>> On 13/06/2011 10:43 AM, Taha Hafeez
> wrote:
> >>>>
> >>>>   Hi
> >>>>> The t:id is a unique id for a
> component within the parent component and
> >>>>> does
> >>>>> not necessarily map to javascript id.
> You can either specify an id for
> >>>>> the
> >>>>> form
> >>>>>
> >>>>> <form t:type='form' t:id='myForm'
> id='myForm'>
> >>>>>
> >>>>> or add javascript the recommended way
> using
> >>>>>
> JavaScriptSupport.addScript/addInitializerCall. There you
> can use
> >>>>> form.getClientId() to get the
> javascript id
> >>>>>
> >>>>> regards
> >>>>> Taha
> >>>>>
> >>>>>
> >>>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul
> Stanton<pa...@mapshed.com.au>
> >>>>>   wrote:
> >>>>>
> >>>>>   alan,
> >>>>>
> >>>>>> there is no javascript on the page
> you suggested. i don't think you
> >>>>>> understand the question.
> >>>>>>
> >>>>>> p.
> >>>>>>
> >>>>>>
> >>>>>> On 13/06/2011 9:08 AM, ael wrote:
> >>>>>>
> >>>>>>   I think this can
> help you.
> >>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
> >>>>>>>
> >>>>>>> Use the method shown.
> >>>>>>>
> >>>>>>> --
> >>>>>>> View this message in context:
> >>>>>>>
> >>>>>>>
> >>>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
> >>>>>>> Sent from the Tapestry - User
> mailing list archive at Nabble.com.
> >>>>>>>
> >>>>>>>
> ---------------------------------------------------------------------
> >>>>>>> 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
> >>>>
> >>>>
> >>>>
> >>
> ---------------------------------------------------------------------
> >> 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: form observe submit not working?

Posted by Paul Stanton <pa...@mapshed.com.au>.
Can someone please confirm the behaviour in 5.1.0.5 ? I just want to 
make sure i'm not going mad!!!

thanks, p.

On 13/06/2011 2:21 PM, Taha Hafeez wrote:
> Hi Paul,
>
> I am using 5.2.5, but ideally it should work in 5.1.0.5 too.
>
> regards
> Taha
>
>
> On Mon, Jun 13, 2011 at 8:40 AM, Paul Stanton<pa...@mapshed.com.au>  wrote:
>
>> taha, i'm using 5.1.0.5 and this is the only code in the tml ..
>>
>> are you sure you get the 'submitting' message and not just the 'listening'
>> message?
>>
>> thanks, p.
>>
>>
>> On 13/06/2011 12:10 PM, Taha Hafeez wrote:
>>
>>> This is nothing wrong with this code as I created a page and copy-pasted
>>> your code, it works.
>>>
>>> I checked it on firefox and chrome and it works fine. You should
>>> check/debug
>>> if there is some error in another part of the page.
>>>
>>> regards
>>> Taha
>>>
>>> On Mon, Jun 13, 2011 at 7:00 AM, Paul Stanton<pa...@mapshed.com.au>
>>>   wrote:
>>>
>>>   Thanks Taha, however that did not help. If you view source the id is
>>>> correctly rendered as 'myForm'. The source is now:
>>>>
>>>> <t:form t:id="myForm" id="myForm">
>>>>
>>>> <t:submit />
>>>> </t:form>
>>>>
>>>> <script type="text/javascript">
>>>>             $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
>>>> function()
>>>>                     {
>>>>                         alert("submitting");
>>>>                     });
>>>>             alert("listening");
>>>> </script>
>>>>
>>>> Still never seeing the message "submitting".
>>>>
>>>> This question has been posted to stack overflow also, so if you have an
>>>> answer and want some so points feel free to answer it here:
>>>>
>>>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>>>>
>>>> p.
>>>>
>>>>
>>>> On 13/06/2011 10:43 AM, Taha Hafeez wrote:
>>>>
>>>>   Hi
>>>>> The t:id is a unique id for a component within the parent component and
>>>>> does
>>>>> not necessarily map to javascript id. You can either specify an id for
>>>>> the
>>>>> form
>>>>>
>>>>> <form t:type='form' t:id='myForm' id='myForm'>
>>>>>
>>>>> or add javascript the recommended way using
>>>>> JavaScriptSupport.addScript/addInitializerCall. There you can use
>>>>> form.getClientId() to get the javascript id
>>>>>
>>>>> regards
>>>>> Taha
>>>>>
>>>>>
>>>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul Stanton<pa...@mapshed.com.au>
>>>>>   wrote:
>>>>>
>>>>>   alan,
>>>>>
>>>>>> there is no javascript on the page you suggested. i don't think you
>>>>>> understand the question.
>>>>>>
>>>>>> p.
>>>>>>
>>>>>>
>>>>>> On 13/06/2011 9:08 AM, ael wrote:
>>>>>>
>>>>>>   I think this can help you.
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>>
>>>>>>> Use the method shown.
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>>
>>>>>>>
>>>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>>>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> 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
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> 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: form observe submit not working?

Posted by Taha Hafeez <ta...@gmail.com>.
Hi Paul,

I am using 5.2.5, but ideally it should work in 5.1.0.5 too.

regards
Taha


On Mon, Jun 13, 2011 at 8:40 AM, Paul Stanton <pa...@mapshed.com.au> wrote:

> taha, i'm using 5.1.0.5 and this is the only code in the tml ..
>
> are you sure you get the 'submitting' message and not just the 'listening'
> message?
>
> thanks, p.
>
>
> On 13/06/2011 12:10 PM, Taha Hafeez wrote:
>
>> This is nothing wrong with this code as I created a page and copy-pasted
>> your code, it works.
>>
>> I checked it on firefox and chrome and it works fine. You should
>> check/debug
>> if there is some error in another part of the page.
>>
>> regards
>> Taha
>>
>> On Mon, Jun 13, 2011 at 7:00 AM, Paul Stanton<pa...@mapshed.com.au>
>>  wrote:
>>
>>  Thanks Taha, however that did not help. If you view source the id is
>>> correctly rendered as 'myForm'. The source is now:
>>>
>>> <t:form t:id="myForm" id="myForm">
>>>
>>> <t:submit />
>>> </t:form>
>>>
>>> <script type="text/javascript">
>>>            $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
>>> function()
>>>                    {
>>>                        alert("submitting");
>>>                    });
>>>            alert("listening");
>>> </script>
>>>
>>> Still never seeing the message "submitting".
>>>
>>> This question has been posted to stack overflow also, so if you have an
>>> answer and want some so points feel free to answer it here:
>>>
>>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>>>
>>> p.
>>>
>>>
>>> On 13/06/2011 10:43 AM, Taha Hafeez wrote:
>>>
>>>  Hi
>>>>
>>>> The t:id is a unique id for a component within the parent component and
>>>> does
>>>> not necessarily map to javascript id. You can either specify an id for
>>>> the
>>>> form
>>>>
>>>> <form t:type='form' t:id='myForm' id='myForm'>
>>>>
>>>> or add javascript the recommended way using
>>>> JavaScriptSupport.addScript/addInitializerCall. There you can use
>>>> form.getClientId() to get the javascript id
>>>>
>>>> regards
>>>> Taha
>>>>
>>>>
>>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul Stanton<pa...@mapshed.com.au>
>>>>  wrote:
>>>>
>>>>  alan,
>>>>
>>>>> there is no javascript on the page you suggested. i don't think you
>>>>> understand the question.
>>>>>
>>>>> p.
>>>>>
>>>>>
>>>>> On 13/06/2011 9:08 AM, ael wrote:
>>>>>
>>>>>  I think this can help you.
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>>
>>>>>> Use the method shown.
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>>>
>>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>
>>>
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: form observe submit not working?

Posted by Paul Stanton <pa...@mapshed.com.au>.
taha, i'm using 5.1.0.5 and this is the only code in the tml ..

are you sure you get the 'submitting' message and not just the 
'listening' message?

thanks, p.

On 13/06/2011 12:10 PM, Taha Hafeez wrote:
> This is nothing wrong with this code as I created a page and copy-pasted
> your code, it works.
>
> I checked it on firefox and chrome and it works fine. You should check/debug
> if there is some error in another part of the page.
>
> regards
> Taha
>
> On Mon, Jun 13, 2011 at 7:00 AM, Paul Stanton<pa...@mapshed.com.au>  wrote:
>
>> Thanks Taha, however that did not help. If you view source the id is
>> correctly rendered as 'myForm'. The source is now:
>>
>> <t:form t:id="myForm" id="myForm">
>>
>> <t:submit />
>> </t:form>
>>
>> <script type="text/javascript">
>>             $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
>> function()
>>                     {
>>                         alert("submitting");
>>                     });
>>             alert("listening");
>> </script>
>>
>> Still never seeing the message "submitting".
>>
>> This question has been posted to stack overflow also, so if you have an
>> answer and want some so points feel free to answer it here:
>> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>>
>> p.
>>
>>
>> On 13/06/2011 10:43 AM, Taha Hafeez wrote:
>>
>>> Hi
>>>
>>> The t:id is a unique id for a component within the parent component and
>>> does
>>> not necessarily map to javascript id. You can either specify an id for the
>>> form
>>>
>>> <form t:type='form' t:id='myForm' id='myForm'>
>>>
>>> or add javascript the recommended way using
>>> JavaScriptSupport.addScript/addInitializerCall. There you can use
>>> form.getClientId() to get the javascript id
>>>
>>> regards
>>> Taha
>>>
>>>
>>> On Mon, Jun 13, 2011 at 6:00 AM, Paul Stanton<pa...@mapshed.com.au>
>>>   wrote:
>>>
>>>   alan,
>>>> there is no javascript on the page you suggested. i don't think you
>>>> understand the question.
>>>>
>>>> p.
>>>>
>>>>
>>>> On 13/06/2011 9:08 AM, ael wrote:
>>>>
>>>>   I think this can help you.
>>>>>
>>>>>
>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>
>>>>>
>>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>>
>>>>> Use the method shown.
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>
>>

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


Re: form observe submit not working?

Posted by Taha Hafeez <ta...@gmail.com>.
This is nothing wrong with this code as I created a page and copy-pasted
your code, it works.

I checked it on firefox and chrome and it works fine. You should check/debug
if there is some error in another part of the page.

regards
Taha

On Mon, Jun 13, 2011 at 7:00 AM, Paul Stanton <pa...@mapshed.com.au> wrote:

> Thanks Taha, however that did not help. If you view source the id is
> correctly rendered as 'myForm'. The source is now:
>
> <t:form t:id="myForm" id="myForm">
>
> <t:submit />
> </t:form>
>
> <script type="text/javascript">
>            $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
> function()
>                    {
>                        alert("submitting");
>                    });
>            alert("listening");
> </script>
>
> Still never seeing the message "submitting".
>
> This question has been posted to stack overflow also, so if you have an
> answer and want some so points feel free to answer it here:
> http://stackoverflow.com/questions/6325026/form-observe-submit-not-working
>
> p.
>
>
> On 13/06/2011 10:43 AM, Taha Hafeez wrote:
>
>> Hi
>>
>> The t:id is a unique id for a component within the parent component and
>> does
>> not necessarily map to javascript id. You can either specify an id for the
>> form
>>
>> <form t:type='form' t:id='myForm' id='myForm'>
>>
>> or add javascript the recommended way using
>> JavaScriptSupport.addScript/addInitializerCall. There you can use
>> form.getClientId() to get the javascript id
>>
>> regards
>> Taha
>>
>>
>> On Mon, Jun 13, 2011 at 6:00 AM, Paul Stanton<pa...@mapshed.com.au>
>>  wrote:
>>
>>  alan,
>>>
>>> there is no javascript on the page you suggested. i don't think you
>>> understand the question.
>>>
>>> p.
>>>
>>>
>>> On 13/06/2011 9:08 AM, ael wrote:
>>>
>>>  I think this can help you.
>>>>
>>>>
>>>>
>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>
>>>>
>>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>>
>>>> Use the method shown.
>>>>
>>>> --
>>>> View this message in context:
>>>>
>>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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: form observe submit not working?

Posted by Paul Stanton <pa...@mapshed.com.au>.
Thanks Taha, however that did not help. If you view source the id is 
correctly rendered as 'myForm'. The source is now:

<t:form t:id="myForm" id="myForm">
<t:submit />
</t:form>

<script type="text/javascript">
             $("myForm").observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT, 
function()
                     {
                         alert("submitting");
                     });
             alert("listening");
</script>

Still never seeing the message "submitting".

This question has been posted to stack overflow also, so if you have an 
answer and want some so points feel free to answer it here:
http://stackoverflow.com/questions/6325026/form-observe-submit-not-working

p.

On 13/06/2011 10:43 AM, Taha Hafeez wrote:
> Hi
>
> The t:id is a unique id for a component within the parent component and does
> not necessarily map to javascript id. You can either specify an id for the
> form
>
> <form t:type='form' t:id='myForm' id='myForm'>
>
> or add javascript the recommended way using
> JavaScriptSupport.addScript/addInitializerCall. There you can use
> form.getClientId() to get the javascript id
>
> regards
> Taha
>
>
> On Mon, Jun 13, 2011 at 6:00 AM, Paul Stanton<pa...@mapshed.com.au>  wrote:
>
>> alan,
>>
>> there is no javascript on the page you suggested. i don't think you
>> understand the question.
>>
>> p.
>>
>>
>> On 13/06/2011 9:08 AM, ael wrote:
>>
>>> I think this can help you.
>>>
>>>
>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>
>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>>
>>> Use the method shown.
>>>
>>> --
>>> View this message in context:
>>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> 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: form observe submit not working?

Posted by Taha Hafeez <ta...@gmail.com>.
Hi

The t:id is a unique id for a component within the parent component and does
not necessarily map to javascript id. You can either specify an id for the
form

<form t:type='form' t:id='myForm' id='myForm'>

or add javascript the recommended way using
JavaScriptSupport.addScript/addInitializerCall. There you can use
form.getClientId() to get the javascript id

regards
Taha


On Mon, Jun 13, 2011 at 6:00 AM, Paul Stanton <pa...@mapshed.com.au> wrote:

> alan,
>
> there is no javascript on the page you suggested. i don't think you
> understand the question.
>
> p.
>
>
> On 13/06/2011 9:08 AM, ael wrote:
>
>> I think this can help you.
>>
>>
>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>
>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>
>> Use the method shown.
>>
>> --
>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> 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: form observe submit not working?

Posted by ael <al...@dash.com.ph>.
Opsss, i though you only need the method onPrepareForSubmit().


Paul Stanton-4 wrote:
> 
> alan,
> 
> there is no javascript on the page you suggested. i don't think you 
> understand the question.
> 
> p.
> 
> On 13/06/2011 9:08 AM, ael wrote:
>> I think this can help you.
>>
>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>>
>> Use the method shown.
>>
>> --
>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> 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
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4483115.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: form observe submit not working?

Posted by Paul Stanton <pa...@mapshed.com.au>.
alan,

there is no javascript on the page you suggested. i don't think you 
understand the question.

p.

On 13/06/2011 9:08 AM, ael wrote:
> I think this can help you.
>
> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
>
> Use the method shown.
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: form observe submit not working?

Posted by ael <al...@dash.com.ph>.
I think this can help you.

http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen
http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/whatiscalledandwhen 

Use the method shown.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/form-observe-submit-not-working-tp4482663p4482770.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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