Re: Display Group Component Editing Issue
Re: Display Group Component Editing Issue
- Subject: Re: Display Group Component Editing Issue
- From: Chuck Hill <email@hidden>
- Date: Thu, 15 Mar 2007 16:51:26 -0700
On Mar 15, 2007, at 4:37 PM, Jim Murry wrote:
Hi,
I am new to WO and I am trying to create a new "Display Group
Component" or "Display Group Application". It is created okay and
it displays correctly in Safari, I can select the items that are
listed in the repeat field, but if I edit any of the items it
always changes the first item in the repeat list. Any help would
be appreciated.
WOD listing
SelectionList: WORepetition {item = user; list =
userDisplayGroup.displayedObjects; };
SelectObjectLink: WOHyperlink {action = selectObject; };
ObjectIdentifier: WOString {value = user.username; };
ModificationForm: WOForm {multipleSubmit = true; };
usernameField: WOTextField {value =
userDisplayGroup.selectedObject.username; };
firstnameField: WOTextField {value =
userDisplayGroup.selectedObject.firstname; };
lastnameField: WOTextField {value =
userDisplayGroup.selectedObject.lastname; };
You are trying to edit in the repetition?
Shouldn't those the user.username etc instead of
userDisplayGroup.selectedObject.username?
Chuck
InsertActiveImage: WOImageButton {action = userDisplayGroup.insert;
filename = "DBWizardInsert.gif"; };
UpdateActiveImage: WOImageButton {action = saveChanges; filename =
"DBWizardUpdate.gif"; };
DeleteActiveImage: WOImageButton {action = userDisplayGroup.delete;
filename = "DBWizardDelete.gif"; };
WOO listing
{
"WebObjects Release" = "WebObjects 5.2";
variables = {
"userDisplayGroup" = {
class = WODisplayGroup;
dataSource = {
class = EODatabaseDataSource;
editingContext = "session.defaultEditingContext";
fetchSpecification = {
class = EOFetchSpecification;
entityName = User;
fetchLimit = 0;
isDeep = YES;
};
};
fetchesOnLoad = YES;
formatForLikeQualifier = "%@*";
localKeys = ();
numberOfObjectsPerBatch = 0;
selectsFirstObjectAfterFetch = YES;
};
};
}
JAVA listing
// Generated by the WebObjects Assistant Wed Mar 14 12:54:33 US/
Pacific 2007
import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
public class temp extends WOComponent {
/** @TypeInfo User */
protected EOEnterpriseObject user;
// This WODisplayGroup is initialized from the .woo archive in
the component's constructor method
protected WODisplayGroup userDisplayGroup;
public temp(WOContext context) {
super(context);
}
public void selectObject() {
userDisplayGroup.selectObject(user);
}
public void saveChanges() throws Exception {
try {
this.session().defaultEditingContext().saveChanges();
} catch (Exception exception) {
// An error occurred during the save. You could present
an error page which
// explains the reason for the save failure.
// The default is to raise an exception which presents
a diagnostic page.
NSLog.err.appendln("Cannot save changes ");
throw exception;
}
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden