You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by TG <ta...@hotmail.com> on 2011/07/26 04:29:20 UTC

Delete confirmation with beaneditform

I use beaneditform to generate my CRUD UI and web tiers automagically. I
would like to have Delete action prompt me to confirm or cancel the action,
no customization required, plain confirmation box. I saw some threads in
this forum, it does not seem to have any one link annotation or codes that
can let me just provide this simple functionalities. I do not want to write
any Java class or anything that is more than 1 or 2 lines of codes, is it
possible?

If not, what is the simplest approach?

Thanks.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Delete-confirmation-with-beaneditform-tp4633324p4633324.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: Delete confirmation with beaneditform

Posted by "dragan.sahpaskix@gmail.com" <dr...@gmail.com>.
On Tue, Jul 26, 2011 at 3:49 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Tue, 26 Jul 2011 10:31:28 -0300, dragan.sahpaskix@gmail.com <
> dragan.sahpaskix@gmail.com> wrote:
>
>  Yes sure I agree, but I guess It cannot be done inside the BeanEditForm
>> unless you introduce a new component quite similar to it with this delete
>> functionality.
>>
>
> Again, just use Form and BeanEditor instead of BeanEditForm. As Taha said,
> copy and paste reuse is the worst one by far. In this scenario, it's even
> worse, as all the logic BeanEditForm has to generates the fields is actually
> imiplemented inside BeanEditor. And Tapestry already has the building blocks
> to do almost everything of what the original poster wants.
>

OK you are right. I totally agree with you. Avoid copy->paste and make a new
component.

Cheers,
Dragan Sahpaski


> --
> 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
>

Re: Delete confirmation with beaneditform

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 26 Jul 2011 10:31:28 -0300, dragan.sahpaskix@gmail.com  
<dr...@gmail.com> wrote:

> Yes sure I agree, but I guess It cannot be done inside the BeanEditForm
> unless you introduce a new component quite similar to it with this delete
> functionality.

Again, just use Form and BeanEditor instead of BeanEditForm. As Taha said,  
copy and paste reuse is the worst one by far. In this scenario, it's even  
worse, as all the logic BeanEditForm has to generates the fields is  
actually imiplemented inside BeanEditor. And Tapestry already has the  
building blocks to do almost everything of what the original poster wants.

-- 
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: Delete confirmation with beaneditform

Posted by "dragan.sahpaskix@gmail.com" <dr...@gmail.com>.
On Tue, Jul 26, 2011 at 3:26 PM, Taha Hafeez <ta...@gmail.com>wrote:

> Hi Dragan,
>
> IMHO copy-paste is never good. Think about any change in BeanEditForm
> in the future.
>

Yes sure I agree, but I guess It cannot be done inside the BeanEditForm
unless you introduce a new component quite similar to it with this delete
functionality.

Cheers,
Dragan Sahpaski

>
> regards
> Taha
>
> On Tue, Jul 26, 2011 at 6:47 PM, dragan.sahpaskix@gmail.com
> <dr...@gmail.com> wrote:
> > Hi,
> > On Tue, Jul 26, 2011 at 2:13 PM, Thiago H. de Paula Figueiredo <
> > thiagohp@gmail.com> wrote:
> >
> >> On Tue, 26 Jul 2011 04:38:39 -0300, dragan.sahpaskix@gmail.com <
> >> dragan.sahpaskix@gmail.com> wrote:
> >>
> >>  Just customize the bean edit form by adding a delete button, by copying
> >>> the entire tml and java class in your components package and make the
> needed
> >>> changes. I use this approach and works for me.
> >>>
> >>
> >> Hi!
> >>
> >> I'm sorry, but I wouldn't recommend this at all. BeanEditForm is almost
> >> nothing more than a Form with a BeanEditor and an HTML submit button
> inside.
> >> The real work is done by BeanEditor, so copying BeanEditForm makes
> >> absolutely no sense to me.
> >>
> >> Why not? If you just want to add a delete button, than that doesn't
> nothing
> > to do with the actual beaneditor. You just add a delete button that
> should
> > only be aware of the editing object in order to delete it (if you want
> that
> > automatically to work in the bean edit form component).
> >
> > Cheers
> > Dragan Sahpaski
> >
> >>
> >> --
> >> 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<
> 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: Delete confirmation with beaneditform

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

IMHO copy-paste is never good. Think about any change in BeanEditForm
in the future.

regards
Taha

On Tue, Jul 26, 2011 at 6:47 PM, dragan.sahpaskix@gmail.com
<dr...@gmail.com> wrote:
> Hi,
> On Tue, Jul 26, 2011 at 2:13 PM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> On Tue, 26 Jul 2011 04:38:39 -0300, dragan.sahpaskix@gmail.com <
>> dragan.sahpaskix@gmail.com> wrote:
>>
>>  Just customize the bean edit form by adding a delete button, by copying
>>> the entire tml and java class in your components package and make the needed
>>> changes. I use this approach and works for me.
>>>
>>
>> Hi!
>>
>> I'm sorry, but I wouldn't recommend this at all. BeanEditForm is almost
>> nothing more than a Form with a BeanEditor and an HTML submit button inside.
>> The real work is done by BeanEditor, so copying BeanEditForm makes
>> absolutely no sense to me.
>>
>> Why not? If you just want to add a delete button, than that doesn't nothing
> to do with the actual beaneditor. You just add a delete button that should
> only be aware of the editing object in order to delete it (if you want that
> automatically to work in the bean edit form component).
>
> Cheers
> Dragan Sahpaski
>
>>
>> --
>> 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<us...@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: Delete confirmation with beaneditform

Posted by "dragan.sahpaskix@gmail.com" <dr...@gmail.com>.
Hi,
On Tue, Jul 26, 2011 at 2:13 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Tue, 26 Jul 2011 04:38:39 -0300, dragan.sahpaskix@gmail.com <
> dragan.sahpaskix@gmail.com> wrote:
>
>  Just customize the bean edit form by adding a delete button, by copying
>> the entire tml and java class in your components package and make the needed
>> changes. I use this approach and works for me.
>>
>
> Hi!
>
> I'm sorry, but I wouldn't recommend this at all. BeanEditForm is almost
> nothing more than a Form with a BeanEditor and an HTML submit button inside.
> The real work is done by BeanEditor, so copying BeanEditForm makes
> absolutely no sense to me.
>
> Why not? If you just want to add a delete button, than that doesn't nothing
to do with the actual beaneditor. You just add a delete button that should
only be aware of the editing object in order to delete it (if you want that
automatically to work in the bean edit form component).

Cheers
Dragan Sahpaski

>
> --
> 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<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Delete confirmation with beaneditform

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 26 Jul 2011 04:38:39 -0300, dragan.sahpaskix@gmail.com  
<dr...@gmail.com> wrote:

> Just customize the bean edit form by adding a delete button, by copying  
> the entire tml and java class in your components package and make the  
> needed
> changes. I use this approach and works for me.

Hi!

I'm sorry, but I wouldn't recommend this at all. BeanEditForm is almost  
nothing more than a Form with a BeanEditor and an HTML submit button  
inside. The real work is done by BeanEditor, so copying BeanEditForm makes  
absolutely no sense to me.

-- 
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: Delete confirmation with beaneditform

Posted by "dragan.sahpaskix@gmail.com" <dr...@gmail.com>.
Hi,

On Tue, Jul 26, 2011 at 5:15 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Mon, 25 Jul 2011 23:29:20 -0300, TG <ta...@hotmail.com> wrote:
>
>  I use beaneditform to generate my CRUD UI and web tiers automagically. I
>> would like to have Delete action prompt me to confirm or cancel the
>> action, no customization required, plain confirmation box.
>>
>
> Most of what you want is done by using a BeanEditor and a couple Submit
> instances inside a Form instead of using BeanEditForm. No additional Java
> code needed. The confirmation box needs JavaScript and there are some
> examples in this list. JumpStart has at least one example of this (and lots
> of examples of many other things): http://jumpstart.**
> doublenegative.com.au/**jumpstart/<http://jumpstart.doublenegative.com.au/jumpstart/>
>
>
>  I saw some threads in
>> this forum, it does not seem to have any one link annotation or codes that
>> can let me just provide this simple functionalities.I do not want to write
>> any Java class or anything that is more than 1 or 2 lines of codes, is it
>> possible?
>>
>
> Don't you think you're asking too much? ;) As Howard once said,
> BeanEditForm, BeanEditor, and Grid are meant to be used to get something
> working quickly, not to be the solution of all scenarios.
>

Just customize the bean edit form by adding a delete button, by copying the
entire tml and java class in your components package and make the needed
changes. I use this approach and works for me.

I often use complex components, that let me assemble pages like lego boxes.
I prefer extreme scenarios where for CRUD pages (Even customized crud pages)
don't have ANY (or a few lines at max) java code in the page class, just TML
;)

Cheers,
Dragan Sahpaski


>
> --
> 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<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Delete confirmation with beaneditform

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 25 Jul 2011 23:29:20 -0300, TG <ta...@hotmail.com> wrote:

> I use beaneditform to generate my CRUD UI and web tiers automagically. I
> would like to have Delete action prompt me to confirm or cancel the  
> action, no customization required, plain confirmation box.

Most of what you want is done by using a BeanEditor and a couple Submit  
instances inside a Form instead of using BeanEditForm. No additional Java  
code needed. The confirmation box needs JavaScript and there are some  
examples in this list. JumpStart has at least one example of this (and  
lots of examples of many other things):  
http://jumpstart.doublenegative.com.au/jumpstart/

> I saw some threads in
> this forum, it does not seem to have any one link annotation or codes  
> that can let me just provide this simple functionalities.I do not want  
> to write any Java class or anything that is more than 1 or 2 lines of  
> codes, is it
> possible?

Don't you think you're asking too much? ;) As Howard once said,  
BeanEditForm, BeanEditor, and Grid are meant to be used to get something  
working quickly, not to be the solution of all scenarios.

-- 
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