|
Hi David! Thanks for your input. I really appreciate your advice! David LeBer wrote: My head hurts. Yes, I am trying to take arrays of objects and reduce their values to comma separated strings. This is for a client request to provide an editable text field where values of objects (email contacts, specifically) are displayed for an end user to add new e-mail addresses (Strings) to send out broadcast messages. I have something like this on an Email Contacts HTML page (four editable text fields):
I am NOT trying to save the server.getEmailContacts text field to the database in this EmailContacts HTML page. I am merely trying to provide the end user with the functionality to append any additional strings/email addresses to the server.getEmailContacts WOTextField. For example, in my To: field, I will have something like To: "[EMAIL PROTECTED], [EMAIL PROTECTED]" (server.getEmailContacts WOTextField) Now, an endUser will mosey along and say, 'Why, I'd like to add [EMAIL PROTECTED] to the e-mail contacts values'. In the WOTextField, endUser will add, "[EMAIL PROTECTED]m" to "[EMAIL PROTECTED], [EMAIL PROTECTED]". However, when I click on my "sendMail" submit button, "[EMAIL PROTECTED]" is not appended to the getEmailContacts string, and poor "[EMAIL PROTECTED]" doesn't receive any e-mail notifications, unbeknownst to endUser. I do not know why this is not working properly... (I've replaced my mess of code with Chuck's elegant solution already too).
Yes! I am using a WORepetition already to display values of objects that are NOT separated by commas. To clarify, there is no need for any comma separated strings of my values to go back to my database again. The comma separated strings are only used for the EmailContacts HTML page. I have a ViewServerDetail HTML page that contains two WORepetitions, with various string values of objects pulled from the database. Instead of something like server.getEmailContacts(), I have two WORepetitions with the following bindings: Repetition1: WORepetition{ item=m_ServerContract; list=server.serverContracts; } TextField1: WOTextField{ value=m_serverContract.contact.fullName; } TextField2: WOTextField{ value=m_serverContract.contact.email; } Hypothetically, the values within these WOTextFields should also save properly with saveChanges() to the database. However, changes to these text fields are not being updated, but only for one of the two WORepetitions (which are identical aside from the fact that one is filtered by Conditionals for billing Contacts, while the other is filtered by Conditionals for administrative contacts). Specifically, Billing Contact edits are being saved, but AdministrativeContacts are not, although they are using the same WORepetition and textField values. In addition, other TextFields (which also do not contain any comma separated values) that return object values are not saving to the database. These are also based on flattened relationships. More specifically, I have something like this: public String getSerial(){ NSArray pc=(NSArray)storedValueForKey("toDevice"); java.util.Enumeration e=pc.objectEnumerator(); String serials=""; while (e.hasMoreElements()){ Device dev=(Device)e.nextElement(); if (dev.serialNum()!=null){ serials=serials+((dev.serialNum())); } } return serials; } and in my binding, I have: TextField3: WOTextField{ value=server.getSerial; /* --------------------------------THIS WON'T SAVE :( ------------------------------------*/ } However, if I re-write TextField3 in the following manner the value will save correctly: TextField3: WOTextField{ value=server.toDevice.serialNum /* -------------------------------- THIS WILL SAVE! ------------------------------------*/ } The reason why I opted not to retrieve the serialNum values in this manner is because the WOTextField will return with an infinite number of parentheses and quotes (something like this) upon each incremental save: ("("("78-0lys1231251")")") which would appear somewhat dizzying and undesirable for endUsers to peer at. Am I missing something trivial? Am I overlooking things and barraging too much messy code on my project? I am sorry I am baffling people with my wayward means of implementation... but I really appreciate any help and advice. Thank you very much for your time and attention to this important matter. Kindest regards, Janice
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]
