WAExampleBrowser


Seaside-Examples-Test

Comment:

I browse all the examples available in the system ie all the results of class methods beginning with #example... 

point your browser to localhost:xxx/seaside/examples

If you want to see these examples

/seaside/config app:
- add a new application named "examples"
- choose WAExampleBrowser as the root component

Hierarchy:

ProtoObject
Object
WAPresenter
WAComponent
WAExampleBrowser

Summary:

instance variables:

answer class component hasAnswer selector

methods:

instance class
accessing helper initialize rendering as yet unclassified

Detail:

instance variables:

answer
class
component
hasAnswer
selector

instance methods:

accessing
children

	^ Array with: component
class: aClass

	class _ aClass.
	self selector: self allSelectors first
component: aComponent

	component _ aComponent.
	hasAnswer _ false.
	answer _ nil.
	component onAnswer: [:v | hasAnswer _ true. answer _ v].
selector: aSymbol

	selector _ aSymbol.
	self component: (class perform: selector)

helper
allClasses

	^ (WAComponent allSubclasses select: [:ea | ea class selectors anySatisfy: [:s | s beginsWith: self selectorPrefix]])
		asSortedCollection: [:a :b | a name < b name]
allSelectors

	^ (class class selectors select: [:s | s beginsWith: self selectorPrefix])
		asSortedCollection
selectorPrefix

	^ 'example'

initialize
initialize

	self class: self allClasses first

rendering
renderContentOn: html

	html cssId: 'test-forms'; table: [
		html tableRowWith: [
			html form: [
				html selectFromList: self allClasses selected: class callback: [:c | self class: c].
				html submitButtonWithText: 'OK'.
			].
		] with: [
			html form: [
				html selectFromList: self allSelectors selected: selector callback: [:s | self selector: s].
			 	html submitButtonWithText: 'OK'.
			]
		].
	].
	html horizontalRule.
	html render: component.
	hasAnswer ifTrue:
		[html horizontalRule.
		html bold: 'Answer '; text: answer printString]

class methods:

as yet unclassified
canBeRoot

	^ true
initialize

	self registerAsApplication: 'examplebrowser'.

^top


- made by Dandelion -