-
1. Re: Component creation: question on @Name and @Role
dhinojosa Apr 5, 2008 7:37 AM (in response to fsat.f_satyaputra.yahoo.co.uk)1. Yes, they are multiple mappings
2. I don't believe you can, and I can't see why that would be important.I think it would be best to rethink your design options in this case. Can you make a InvitationManager object to manage the invitations? Maybe a transient method in a model can handle this logic?
I don't know what your code is, or what is its intent. Something like this though screams for needing to rethink the problem.
-
2. Re: Component creation: question on @Name and @Role
fsat.f_satyaputra.yahoo.co.uk Apr 5, 2008 8:00 AM (in response to fsat.f_satyaputra.yahoo.co.uk)Thanks for the fast reply!
I have a page where someone can send invitation to their friends to sign up.
On that page there is a button called 'Add more friends'. When this button is clicked, a new sub form will be inserted. The sub form has textfields where the user can enter their friend's name and email address.
The plan I have right now is to create a new Component for every new sub form.
-
3. Re: Component creation: question on @Name and @Role
dhinojosa Apr 5, 2008 8:47 AM (in response to fsat.f_satyaputra.yahoo.co.uk)Oh yeah sure, a good clean redesign is in order. Just a rule of thumb, in any software/database design, if you find yourself naming things something1, something2, something3, something4 then you are are doing something wrong.
@Name("invitation") @Scope(ScopeType.CONVERSATION) public class Invitation { private String firstName; private String lastName; private String emailAddress; } @Name("inviteAction") @Scope(ScopeType.CONVERSATION) public class InviteAction { @In @Out private Invitation invitation; public void addInvitation() { //Here you can add the invite to a user account //and save it or send the invite or //do whatever you want } }