home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / WebObjects / WebObjectsDoc_HTML / Reuse / ReusableComponentsEx / AttributeEditorEx.wo / AttributeEditorEx.wos < prev   
Encoding:
Text File  |  1996-02-29  |  1.0 KB  |  49 lines

  1. ////////////////////////
  2. //  AttributeEditor
  3. //  by Charles Lloyd
  4. ////////////////////////
  5.  
  6.  
  7. //////////////////////////
  8. // User Settable Items
  9. //////////////////////////
  10. persistent id localKeyArray;
  11. persistent id localValueArray;
  12.  
  13. //////////////////////
  14. //    Internal State
  15. //////////////////////
  16. persistent id isEditable;
  17. persistent id cellPadding;
  18. persistent id editableString;
  19.  
  20. - awake
  21. {
  22.     if (!localKeyArray) {
  23.         localKeyArray = @("Title", "First Name", "Last Name",
  24.                           "Street", "City", "State", "Zip");
  25.         localValueArray = @("", "", "", "", "", "", "");
  26.         localValueArray = [[localValueArray mutableCopy] autorelease];
  27.         isEditable = NO;
  28.         [self toggleEditable];
  29.     }
  30. }
  31.  
  32. - processForm
  33. {
  34.     return self;
  35. }
  36.  
  37. - toggleEditable
  38. {
  39.     if (isEditable == YES) {
  40.         isEditable = NO;
  41.         editableString = @"Make Editable";
  42.         cellPadding = 4;
  43.     } else {
  44.         isEditable = YES;
  45.         editableString = @"Make Read Only";
  46.         cellPadding = 0;
  47.     }
  48. }
  49.