I see. I am not sure if there is anything that "comes with" Appfuse that models the behavior you are talking about. Appfuse can generate basic CRUD functions and there are some examples through the user management or administration pages. But for things like a web ui to manage an object's relationships, I don't think there is anything there.
That said, it seems like I do something like this on every project, since almost all models have relationships to other models in any reasonable domain. I create something over and over again, sometimes different within the same project. One pattern I try to follow to make things easier is to try and do your wiring apart from your text field editing. So I can browse a read-only version of my model or from the list I can click a link. The link brings up a lightbox with a list of things I can relate to. This form posts back to the server that redirects you back to the list or the read-only page. I have done some work on creating relationships within a form, but that was with Webwork/Struts and I am not sure if it translates to Spring MVC. In Struts, I use TypeConversion and field naming conventions to represent a set of relationships in an editable form. The tricky part is to not commit your relationship changes unless the user submits the whole form. Usually you have to go to some other page to create a relationship. You have to be able to store all the information you need in the actual form to recreate the relationships when you repost. I suppose you could use the Session but I just think thats wrong (opinion). Aled Rhys Jones wrote: > > Thanks for your answer Dusty. > I have a table that has company data, and one that has association data > (not > the relationship, but associations that the company belongs to). They are > linked many to many, but the relationship also stores a reference number > allocated to the company by the association. > The user should be able to re-wire the relationship as well as edit the > reference number. > I've made a company association model that has crud. > What I'd like to know is how best to allow the user to do it in Spring > mvc. > I'm quite new to it having used jsf before (which unfortunately I can't > use > for this project). I've noticed that the existing appfuse jsp's make use > of > appfuse tags and so forth, so I'm keen to re-use any functionality that > exists already to speed up the process. > > Cheers > Aled > > -----Original Message----- > From: dusty [mailto:[EMAIL PROTECTED] > Sent: 29 June 2007 05:30 > To: [email protected] > Subject: Re: [appfuse-user] Many to many relationship with data > > > So you have an association class with some properties like "type of > relationship", "time of union", etc. You want users to edit these > properties or rewire the relationships or both? > > If its just modifying the "modifiers" of the relationship then I believe > you > can treat the association object as a simple CRUD pattern. But you will > need to be sure to load the object in Prepare and then apply parameters so > that you don't lose your relationships when you save the updated > properties. > > > > Aled Rhys Jones wrote: >> >> Hi all >> >> I've got a many to many relationship between two models, but in this >> case the relationship is also represented by a model as it contains data >> that represents a reference of sorts between both models. Its table >> therefore has data in addition to the UID's of the other models. >> >> Any one got any pointers what the best method is for allowing the user >> to edit the relationship data in the web interface? I'm using Spring MVC >> with hibernate. One idea I had was to emulate the many to many table >> e.g. used by the user-role relationship in the user form, but make the >> added models on the right clickable so the user could edit the >> relationship data. Feasible? Appfuse has a load of great tools and I'd >> hate to be reinventing the wheel here. >> >> Cheers >> Aled >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- > View this message in context: > http://www.nabble.com/Add-ManyToOne-relationship-between-user-and-a-new-pojo > -tf3993393s2369.html#a11354912 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Add-ManyToOne-relationship-between-user-and-a-new-pojo-tf3993393s2369.html#a11363039 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
