You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eric Miles <em...@cstone.net> on 2003/06/01 04:24:12 UTC

Re: Basic CRUD

Problem solved.

Basically, I added a hidden form property called 'key' that gets set 
during the onclick event of either the 'update' or 'delete' buttons.  
I used the nested taglib from the keyboardmonkey, making things 
easier to update the collection.  I used 1 form in the jsp.  I used 
bean:define to capture the primary key id of the record during the 
iteration, which was passed to the javascript onclick event to set 
the hidden form parameter, 'key'.

IMHO, the interaction with the javascript code is sloppy.  Hopefully, 
something is in the works to clean this up.  I believe struts-el 
might do this, I don't know.  The html taglib would not evaluate a 
bean:write tag within the onclick event.  That's why I had to add the 
bean:define and a setKey() javascript function.

If anyone is interested in more details, send me an email, or answer 
to this post and I'll post the details.

Thanks.
-Eric


--- In struts@yahoogroups.com, "Eric Miles" <em...@c...> wrote:
> Chicks that don't lay eggs are still good for cooking, eh?  ;-)
> 
> Jing,
> Your source code is Open Source licensing, right?  Not going to sue 
> me when I resell or make $$$ off your code?!?
> 
> Although, Carrier looks like a nice product, my hope was to do the 
> grunt work myself, to get a feel for persisting objects through 
> struts and to do it via several methods.  Once I can get the 
correct 
> object from the view to the action, everything should work nice.  
On 
> the backend, I'm persisting objects by using a stateless session 
EJB 
> talking to Hibernate.  Plus, using XDoclet is the best thing since 
> Ant.
> 
> I'll post back when I get this thing hammered out.
> 
> Thanks for the feedback.
> -Eric
> 
> --- In struts@yahoogroups.com, "Andrew Hill" 
<an...@g...> 
> wrote:
> > Yeh, alright. Fair enough.
> > 
> > So your license does allow him to extract that particular code 
out 
> of the
> > Carrier source , and use it in his own product without having to 
> join the
> > Carrier group etc... if he wants to distribute whatever it is he 
is 
> writing?
> > 
> > -----Original Message-----
> > From: Jing Zhou [mailto:jing@n...]
> > Sent: Thursday, 29 May 2003 13:36
> > To: Struts Users Mailing List; andrew.david.hill@g...
> > Subject: Re: Basic CRUD
> > 
> > 
> > 
> > ----- Original Message -----
> > From: "Andrew Hill" <an...@g...>
> > To: "Struts Users Mailing List" <st...@j...>
> > Sent: Wednesday, May 28, 2003 9:57 PM
> > Subject: RE: Basic CRUD
> > 
> > 
> > > Mate, that answer is about as useful as a chook that doesnt lay 
> eggs.
> > > If you go answering peoples _struts_ questions on the _struts 
> list_ by
> > > carping on about how great some product of yours is then you 
will 
> make
> > > yourself unpopular very quickly.
> > 
> > Have you ever thought someone might be interested in a *general*
> > purpose CRUD algorithm? We got such an algorithm with its core 
codes
> > open for every one.
> > 
> > 
> > >
> > > -----Original Message-----
> > > From: Jing Zhou [mailto:jing@n...]
> > > Sent: Thursday, 29 May 2003 12:43
> > > To: Struts Users Mailing List
> > > Subject: Re: Basic CRUD
> > >
> > >
> > > >
> > > > -----Original Message-----
> > > > From: emiles@c... [mailto:emiles@c...]
> > > > Sent: Wednesday, 28 May 2003 3:02 p.m.
> > > > To: struts-user@j...
> > > > Subject: Basic CRUD
> > > >
> > > > I am putting together a simple web app that performs CRUD 
> operations on
> > a
> > > > database table.  The web app consists of 1 jsp page which 
> handles all
> > CRUD
> > > > actions.  The first part of the page contains a form with 2 
> fields and
> > > > 'create' and 'retrieve' buttons.  Both these functions work 
> fine.  When
> > a
> > > > 'retrieve' (select id,field1,field2 from table1) is done, a 
> table is
> > > > rendered with the resultset on the same page.  For each 
record 
> of the
> > > > recordset, there exists an 'update' and 'delete' button.  The 
> problem is
> > > > how do I tell my action class which record to act on?
> > >
> > > The difficulty of this kind of problems is that there is no 
> *standard* way
> > > to
> > > handle CRUD operations in general. However, the just unveiled 
> Carrier
> > > allows you to visually compose hyper action wizards. In 
> particular, the
> > > demo for the Ant Project Configuration has a lot of CRUD 
> operations.
> > >
> > > If I understand your business problem, here is a very similar 
> situation:
> > > an Ant project may contain several targets, so there are CRUD 
> operations
> > > on the targets. For each target, there are several tasks. So we 
> have
> > > CRUD operations on the tasks. For each task, there might be 
> several
> > > nested attributes, so more CRUD operations. Some we do it on the
> > > same page, some we do it on different page in the demo. There 
are
> > > total of 39 pages just for this demo with nested level up to 5.
> > >
> > > This demo is done exclusively within Struts. No javascript! Even
> > > there is no custom code for this demo. You compose
> > > the Ant Project Configuration as hyper action wizards completely
> > > within Carrier rich client. And any submited forms will be 
> automatically
> > > persisted and restored for you as necessary.
> > >
> > > The algorithms that makes this happen is called Wheels. When you
> > > download Carrier at www.netspread.com, the source codes for the
> > > Wheels will be available for you.
> > >
> > > Jing
> > >
> > 
> > 
> > ------------------------------------------------------------------
--
> -
> > To unsubscribe, e-mail: struts-user-unsubscribe@j...
> > For additional commands, e-mail: struts-user-help@j...
> > 
> > 
> > ------------------------------------------------------------------
--
> -
> > To unsubscribe, e-mail: struts-user-unsubscribe@j...
> > For additional commands, e-mail: struts-user-help@j...
> 
> 
> --------------------------------------------------------------------
-
> To unsubscribe, e-mail: struts-user-unsubscribe@j...
> For additional commands, e-mail: struts-user-help@j...


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org