You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2012/10/17 23:58:05 UTC

Re: [t5.3.1 - AjaxFormLoop] How to prevent removing the last row ?

Am I lucky enough to get a positive answer now that we now reached v5.3.6 ?

Thank you all :)

On Wed, Mar 14, 2012 at 10:28 PM, Muhammad Gelbana <m....@gmail.com>wrote:

> Greetings to this magnificent mailing list and tapestry developers :)
>
> I have a perfectly operating ajax form loop but I'm trying to find a way
> to prevent the user from removing the last row in the form.
> In an annotated method to handle the remove row events from the ajax form
> loop, I've done the proper checks and tried returning false and null but
> nothing worked. Has anyone done this before ?
>
> My goal is to prevent the removal of the last ajax form loop row and
> display a java script alert to clarify the error.
>
> Thanks.
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>
>

Re: [t5.3.1 - AjaxFormLoop] How to prevent removing the last row ?

Posted by Lance Java <la...@googlemail.com>.
You could fire some javascript (via JavaScriptSupport) in the onAddRow and
onRemoveRow event handlers. The javascript could simply hide the "remove"
link for the last row so the user can't click on it.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-3-1-AjaxFormLoop-How-to-prevent-removing-the-last-row-tp5566078p5717052.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: [t5.3.1 - AjaxFormLoop] How to prevent removing the last row ?

Posted by Taha Siddiqi <ta...@gmail.com>.
You can return HttpError but that will also result in a error alert.


On Oct 19, 2012, at 2:50 AM, Muhammad Gelbana wrote:

> Would it be easier to override the http return code ? I'm not sure if
> that's even possible but it would be easier to write a line of java code
> than to override the javascript stack I guess.
> 
> On Thu, Oct 18, 2012 at 3:17 AM, Taha Siddiqi <ta...@gmail.com>wrote:
> 
>> Hi
>> 
>> The formLoopRemoveLink does not check the return status but the removal is
>> done only on a HTTP OK(200) status.
>> 
>> You can override this js method with your custom logic.
>> 
>> regards
>> Taha
>> 
>> 
>> On Oct 18, 2012, at 3:28 AM, Muhammad Gelbana wrote:
>> 
>>> Am I lucky enough to get a positive answer now that we now reached
>> v5.3.6 ?
>>> 
>>> Thank you all :)
>>> 
>>> On Wed, Mar 14, 2012 at 10:28 PM, Muhammad Gelbana <m.gelbana@gmail.com
>>> wrote:
>>> 
>>>> Greetings to this magnificent mailing list and tapestry developers :)
>>>> 
>>>> I have a perfectly operating ajax form loop but I'm trying to find a way
>>>> to prevent the user from removing the last row in the form.
>>>> In an annotated method to handle the remove row events from the ajax
>> form
>>>> loop, I've done the proper checks and tried returning false and null but
>>>> nothing worked. Has anyone done this before ?
>>>> 
>>>> My goal is to prevent the removal of the last ajax form loop row and
>>>> display a java script alert to clarify the error.
>>>> 
>>>> Thanks.
>>>> 
>>>> --
>>>> *Regards,*
>>>> *Muhammad Gelbana
>>>> Java Developer*
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> 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.3.1 - AjaxFormLoop] How to prevent removing the last row ?

Posted by Muhammad Gelbana <m....@gmail.com>.
Would it be easier to override the http return code ? I'm not sure if
that's even possible but it would be easier to write a line of java code
than to override the javascript stack I guess.

On Thu, Oct 18, 2012 at 3:17 AM, Taha Siddiqi <ta...@gmail.com>wrote:

> Hi
>
> The formLoopRemoveLink does not check the return status but the removal is
> done only on a HTTP OK(200) status.
>
> You can override this js method with your custom logic.
>
> regards
> Taha
>
>
> On Oct 18, 2012, at 3:28 AM, Muhammad Gelbana wrote:
>
> > Am I lucky enough to get a positive answer now that we now reached
> v5.3.6 ?
> >
> > Thank you all :)
> >
> > On Wed, Mar 14, 2012 at 10:28 PM, Muhammad Gelbana <m.gelbana@gmail.com
> >wrote:
> >
> >> Greetings to this magnificent mailing list and tapestry developers :)
> >>
> >> I have a perfectly operating ajax form loop but I'm trying to find a way
> >> to prevent the user from removing the last row in the form.
> >> In an annotated method to handle the remove row events from the ajax
> form
> >> loop, I've done the proper checks and tried returning false and null but
> >> nothing worked. Has anyone done this before ?
> >>
> >> My goal is to prevent the removal of the last ajax form loop row and
> >> display a java script alert to clarify the error.
> >>
> >> Thanks.
> >>
> >> --
> >> *Regards,*
> >> *Muhammad Gelbana
> >> Java Developer*
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [t5.3.1 - AjaxFormLoop] How to prevent removing the last row ?

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

The formLoopRemoveLink does not check the return status but the removal is done only on a HTTP OK(200) status. 

You can override this js method with your custom logic.

regards
Taha


On Oct 18, 2012, at 3:28 AM, Muhammad Gelbana wrote:

> Am I lucky enough to get a positive answer now that we now reached v5.3.6 ?
> 
> Thank you all :)
> 
> On Wed, Mar 14, 2012 at 10:28 PM, Muhammad Gelbana <m....@gmail.com>wrote:
> 
>> Greetings to this magnificent mailing list and tapestry developers :)
>> 
>> I have a perfectly operating ajax form loop but I'm trying to find a way
>> to prevent the user from removing the last row in the form.
>> In an annotated method to handle the remove row events from the ajax form
>> loop, I've done the proper checks and tried returning false and null but
>> nothing worked. Has anyone done this before ?
>> 
>> My goal is to prevent the removal of the last ajax form loop row and
>> display a java script alert to clarify the error.
>> 
>> Thanks.
>> 
>> --
>> *Regards,*
>> *Muhammad Gelbana
>> Java Developer*
>> 
>> 


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