jason.johnson.081 at gmail.com
Mon Nov 19 22:14:27 MET 2007
I'm using Magritte to model some objects of mine and basically if the
user edits the object I want the description to be the same, just the
"unique key" to become read only. If they add then of course all
fields are modify-able.
I have done this by overriding #description on instance side to do
result := self class description.
ifNil: [ result ] "new instance"
result collect: [e|
e label = 'Name Im interested in'
ifTrue: [ e beReadonly; yourself ]
ifFalse: [ e ] ] ]
Now of course what happens is, if I click edit first then the fields
are always read only and vice versa if I click new first, due to
caching. That is, it works perfectly.... the first use, and from then
on #description is called. Before I fought with this anymore I
thought I would check if there is a simpler way to do what I'm trying
Thanks in advance,
More information about the smallwiki