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 = "" }; 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; };
InsertActiveImage: WOImageButton {action = "" filename = "DBWizardInsert.gif"; }; UpdateActiveImage: WOImageButton {action = "" filename = "DBWizardUpdate.gif"; }; DeleteActiveImage: WOImageButton {action = "" 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; } }
}
|