(unknown)
"jdgazer" <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.newbies |
|---|---|
| Message-ID | <[email protected]> |
Can someone help me with this, im really stuck with it, i know that
there have been some existing issues with WOPopUpButton, ive tried
working with but havent got it right, hopefully someone could give me
a precise guide on this, here is my schema:
two tables (reference tables)
- userinformation
->userid (primary)
->username
->userpassword
->userlevel
- authenticationlevel
->authid (primary)
->autdescription (values[admin,supervisor,staff])
So basically the scenario is that a page used to add users, having
WOPopUpButton displaying user authentication. I had it displayed,
Unfortunately i cant save it. Here some snippet with my code:
----------------------------------------------------------------
public class Main extends WOComponent {
protected AuthLevel auth;
protected AuthLevel authItem;
protected UserInfo user;
protected UserInfo userItem;
/** @TypeInfo AuthLevel */
protected NSMutableArray authList;
/** @TypeInfo UserInfo */
protected NSMutableArray userList;
private EOEditingContext editingContext;
private EOFetchSpecification fetchSpec;
private EOEditingContext editingContext2;
private EOFetchSpecification fetchSpec2;
public Main(WOContext context) {
super(context);
fetchSpec = new EOFetchSpecification
("userinformation", null, null);
editingContext = session().defaultEditingContext();
authList = new NSMutableArray
(editingContext.objectsWithFetchSpecification(fetchSpec));
auth = new AuthLevel();
//======
fetchSpec2 = new EOFetchSpecification
("authenticationlevel", null, null);
editingContext2 = session().defaultEditingContext();
userList = new NSMutableArray
(editingContext2.objectsWithFetchSpecification(fetchSpec2));
user = new UserInfo();
}
public WOComponent addUser()
{
if(!userList.containsObject(user)){
userList.addObject(user);
editingContext2.insertObject(user);
user = new UserInfo();
}
return null;
}
public WOComponent delUser()
{
userList.removeObject(userItem);
EOEditingContext ec = userItem.editingContext();
ec.deleteObject(userItem);
return null;
}
public WOComponent edtUser()
{
user = userItem;
return null;
}
public WOComponent updUser()
{
user = new UserInfo();
return null;
}
public WOComponent revChanges2()
{
editingContext2.revert();
userList = new NSMutableArray
(editingContext2.objectsWithFetchSpecification(fetchSpec2));
return null;
}
public WOComponent savChanges2()
{
editingContext2.saveChanges();
return null;
}
}
------------------------------------------------------
Any help would be much appreciated, this is the only thing that holds
me from my project completion.
Thank you
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/webobjects-newbies/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/