It appears that this method should live in the object (or superclass)
that is to be Magritte rendered.. I can't find it in my Squeak image
but it is referenced by #pull as seen below.. Up to now I thought I
was using the RealMemento class as specified by #mementoClass
but just found that it needs to be defined on the instance side not
the class side so my #mementoClass method was not being called
until now.. Unfortunately now I get the DNU as indicated above..
MARealMemento>>pull
"Utitlity method to copies the model into a cache populating nil
values with the defaults specified by the descriptions"
| result |
result := self model copyForRealMemento.
result description do: [ :each |
(result readUsing: each) ifNil: [ result update: each default using:
each ].
].
^ result
I am going to distribute different file libraries from my site(
http://w337.uni.cc) that contain css for different Pier looks. It seems to
me, as I was recently a Pier newbie, one of the things that could scare me
away was how hard it was to change the look of Pier, and I think this will
help. Could someone tell me how to set up a Monticello HTTP repository with
apache so I can host some of theses?
--
David Zmick
/dz0004455\
http://dz0004455.googlepages.comhttp://dz0004455.blogspot.com
I'm feeling like I need one.
I've been playing around with Pier for a couple days and well... I
don't feel much further along when than when I started.
Basic things like...
how you change the style, theme, layout whatever you want to call it
are simply a mystery to me.
Is there a 'these are the must know basics' guide?
I went back to sometime last year in the archives, tried googling,
read stuff on the wiki and off of Lukas's site
but still feel utterly lost.
I see there is a PRPierFrame that everything else is inside. Do I
remove the children
from it, rearrange them? Write my own?
That is just one basic thing I'm not grasping..
Any links to getting started basics would be greatly appreciated. in
the meantime, back
to trying to figure this out.
Thanks.
Sean
Hi All,
i work with Squeak and Magritte.
I have create my personal component "SUAddress" subclass of MAElementComponent.
And define the relative MAAddressDescription subclass of MAElementDescription with methods:
kind ^ OrderedCollection
defaultComponentClasses ^Array with: SUAddress
After i define in TestClass with:
descriptionAddress based on MAAddressDescription on addressData
and descriptionText based on MAStringDescription on textData.
Now when call: anTestClass asComponent addValidateForm; addMessage: 'message' ; yourself all work fine.
The problem is when in the form i do change on my component and after i clic the cancel button.
In this case the addressData result update to the change do in the form, and not to the last correct state.
The textData in this case work fine.
Where i wrong ?
Any pointers would be greatly appreciated!
Thanks!
Dario
Lukas et-al,
I've got my test Magritte form working from a renderContentOn: block
without issue (data is displayed,buttons exist,no complaints, etc)..
Anyway, at the bottom of the form (using the code below) are 3 buttons
(save,cancel and then my 'done' button).. The thing I'm having a hard
time with (which was easy when using #call and #answer) is how to
determine what button was pressed (save,cancel).. Ideally, I don't
care to have a "done" button but I do need to distinguish between save
and cancel.. What's the best approach for this? I copied the
onAnswer: block from another old Magritte email thread but its only
called when cancel is pressed.. Thx!
renderContentOn: html
component := (self session user) asComponent addValidatedForm;
onAnswer: [ :value | self answer: value ];
yourself.
html div id: 'fullwidthContent'; with: [
html div id: #fieldsetEnclosure; with: [
html render: component.
html submitButton
callback: [self answer: 'foo'];
text: 'Done'
]
]
-- Rick
I'm not completely following what its purpose is? Below is the code
from the Magritte, living in the SequenceableCollection object:
reduce: aBlock
| result |
self isEmpty
ifTrue: [ ^ nil ].
result := self first.
2 to: self size do: [ :index |
result := aBlock
value: result
value: (self at: index) ].
^ result
In my case, it is causing problems on VW when it calls aBlock (near
the end) and passes in a pair of Characters which are processed by
MAComponentRenderer>>classFor: which then tries to do a string append
(#,) which gives a DNU since VW's characters (and I think Squeak from
what I can tell) do not have concat methods (#,).. Am I missing
something? Below is the code that calls reduce:
MAComponentRenderer>>classFor: aDescription
| classes item |
item := (component description = aDescription
ifTrue: [ component ]
ifFalse: [ self childAt: aDescription ]) ifNotNilDo: [ :comp | comp
model ].
classes := aDescription cssClassesForItem: item.
(self hasError: aDescription) ifTrue: [ classes add: 'error' ].
^ classes reduce: [ :a :b | a , ' ' , b ]
Hi,
This is a "disgression" of something I thought/implement last week and
I want to put into consideration, in order to know if is a valuable
contribution or just another stupid idea :)
First let mu put some context information: I'm using magritte for some
production applications, who has two major requirements: L&F and L17N.
For major of my needs, magritte fits quite well, but it still have some
restrictions:
1) No L17N in labels and buttons.
2) Buttons are texts and usually clients ask for images, images/texts, etc.
There are some other restrictions, but achievable by simply extending
magritte system (such as image report columns, etc.)
How do I solved this problems?
Well, first I simply added a "localized" method on String who asks for
a property (language) in session and follow "translated" path to
translate the string, and then I modified each method in magritte who
outputs a label (they are not many, just 3 or 4).
That solves my L17N problem.
Now, I want to make my buttons more fashionable... this is harder
because of the places where I have to change things... but again,
extending MAFormDecoration and MACommandColumn... and aplying that to
every component who uses a report... problem solved.
But, what if I what my buttons different, or even configurable?
This is my approach: instead having buttons and links displayed in
columns or forms, I created a Command, and then I whant to add that
commands by visiting different renderers, magritte style visitors. So,
if I want to change the displaying style, I just add a new renderer...
And as an "extra bonus" there I can handle L17N stuff.
What do you think? is this good approach?