WAComponent subclass: #EditorOsoby instanceVariableNames: 'osoba' classVariableNames: '' poolDictionaries: '' category: 'MyWebApplication'! !EditorOsoby methodsFor: 'rendering' stamp: 'pk 4/2/2005 21:15'! renderContentOn: html html form: [ html table: [ html tableRowWithLabel: 'Jmeno:' column: [ html textInputOn: #jmeno of: self osoba ]. html tableRowWithLabel: 'Prijmeni:' column: [ html textInputOn: #prijmeni of: self osoba ] ]. html submitButtonWithAction: [ self answer: self osoba ] ].! ! !EditorOsoby methodsFor: 'initialization' stamp: 'pk 4/2/2005 21:12'! initialize super initialize. osoba := Osoba new.! ! !EditorOsoby methodsFor: 'accessing' stamp: 'pk 4/2/2005 21:14'! osoba ^osoba! ! !EditorOsoby methodsFor: 'accessing' stamp: 'pk 4/2/2005 21:14'! osoba: anObject osoba := anObject! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! EditorOsoby class instanceVariableNames: ''! !EditorOsoby class methodsFor: 'instance creation' stamp: 'pk 4/2/2005 21:24'! withValidation ^ self new validateWith: [ :osoba | osoba validate].! ! Object subclass: #Osoba instanceVariableNames: 'jmeno prijmeni' classVariableNames: '' poolDictionaries: '' category: 'MyWebApplication'! !Osoba methodsFor: 'accessing' stamp: 'pk 4/2/2005 21:10'! jmeno ^jmeno! ! !Osoba methodsFor: 'accessing' stamp: 'pk 4/2/2005 21:10'! jmeno: anObject jmeno := anObject! ! !Osoba methodsFor: 'accessing' stamp: 'pk 4/2/2005 21:10'! prijmeni ^prijmeni! ! !Osoba methodsFor: 'accessing' stamp: 'pk 4/2/2005 21:10'! prijmeni: anObject prijmeni := anObject! ! !Osoba methodsFor: 'printing' stamp: 'pk 4/2/2005 21:11'! printOn: aStream aStream nextPutAll: self jmeno; space; nextPutAll: self prijmeni.! ! !Osoba methodsFor: 'initialization' stamp: 'pk 4/2/2005 21:10'! initialize super initialize. self jmeno: String new. self prijmeni: String new.! ! !Osoba methodsFor: 'validation' stamp: 'pk 4/2/2005 21:15'! validate ^ (jmeno isEmpty or: [ prijmeni isEmpty ]) ifTrue: [ self error: 'Udaje nejsou uplne'].! ! WAComponent subclass: #Root instanceVariableNames: 'osoby' classVariableNames: '' poolDictionaries: '' category: 'MyWebApplication'! !Root methodsFor: 'initialization' stamp: 'pk 4/2/2005 21:17'! initialize super initialize. osoby := OrderedCollection new.! ! !Root methodsFor: 'rendering' stamp: 'pk 4/2/2005 21:21'! renderContentOn: html html heading: 'Osoby'. html list: osoby do: [ :osoba | html anchorWithAction: [ self call: (EditorOsoby withValidation osoba: osoba) ] text: osoba asString ]. html anchorWithAction: [ osoby add: (self call: EditorOsoby withValidation) ] text: 'Pridat'. html break. html anchorWithAction: [ (self confirm: 'Opravdu smazat vsechny osoby?') ifTrue: [ osoby := OrderedCollection new ] ] text: 'Smazat vse'. ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! Root class instanceVariableNames: ''! !Root class methodsFor: 'initialize-release' stamp: 'pk 4/2/2005 21:23'! initialize self registerAsApplication: 'Osoby'! ! !Root class methodsFor: 'testing' stamp: 'pk 4/2/2005 21:20'! canBeRoot ^ true! ! Root initialize!