Class { #name : 'WAContact', #superclass : 'SBSRootComponent', #instVars : [ 'contact' ], #category : 'ContactBook', #package : 'ContactBook' } { #category : 'as yet unclassified' } WAContact class >> editContact: aContact [ ^ self new setContact: aContact; yourself ] { #category : 'initialization' } WAContact >> contact [ ^ contact ] { #category : 'initialization' } WAContact >> initialize [ super initialize. contact := Contact new ] { #category : 'as yet unclassified' } WAContact >> renderButtonsOn: html [ html formGroup: [ html buttonGroup: [ self renderSubmitButtonOn: html; renderCancelButtonOn: html ] ] ] { #category : 'as yet unclassified' } WAContact >> renderCancelButtonOn: html [ html outlineButton beDanger; cancelCallback: [ self answer: nil ]; with: 'Cancel' ] { #category : 'as yet unclassified' } WAContact >> renderContentOn: html [ html container: [ html heading with: 'Contact Editing'. html form with: [ self renderFieldsOn: html. self renderButtonsOn: html ] ] ] { #category : 'as yet unclassified' } WAContact >> renderEmailFieldOn: html [ html formGroup: [ html label: 'Email'. html emailInput formControl; placeholder: 'your@email.eu'; callback: [ :value | self contact email: value address ]; value: (self contact email ifNil: '') ] ] { #category : 'as yet unclassified' } WAContact >> renderFieldsOn: html [ self renderFullnameFieldOn: html. self renderEmailFieldOn: html ] { #category : 'as yet unclassified' } WAContact >> renderFullnameFieldOn: html [ html formGroup: [ html label: 'Fullname'. html textInput formControl; placeholder: 'fullname'; callback: [ :value | self contact fullname: value ]; value: (self contact fullname ifNil: '') ] ] { #category : 'as yet unclassified' } WAContact >> renderSubmitButtonOn: html [ html formButton beSubmit; beSuccess; bePrimary; callback: [ self answer: self contact ]; with: 'Save' ] { #category : 'initialization' } WAContact >> setContact: aContact [ contact := aContact ]