Hi,
I need to render multiple fieldsets for a model. My
idea was to split up descriptions into multiple groups,
assign each of the group to a MAContainer and add the
containers into a root container. Something like this:
MAPriorityContainer
MAContainer
MAStringDescription
MAStringDescription
MAContainer
MAStringDescription
MAStringDescription
So I would be able to render a fieldset per container.
As containers have labels I could even render a legend
tag for the fieldsets.
But I wasn't very lucky to do so. Is this a conceptional
problem? I tried MAContainer new and setting an accessor
as well as self description copy setChildren to get a
container. But no luck.
Any help is appreciated. thanks,
Norbert
Hi,
I'm dealing now quite a bit of time with Magritte to do a
web application. It took a while to get into Magritte and
I'm not sure how much I've grasped til now. But I'm quite
impressed by the power of Magritte. It seems to be customiz-
able at the right places which distinguishes it from others.
At the moment I'm refactoring the code I hacked the last weeks.
I have a few questions about best practice patterns using
Magritte. For the demo, you have a model and you just need
any component, the case is quite easy. aModel asComponent
will do. But most of the tasks that have to be done for a
web application aren't that trivial. You need to have a
customized layout (which can be very complex), you need your
own components etc.
For customization I put every little bit in a wrapper class
around the generated Magritte component. This is for customizing
the generated component as well as to do some manual html if
it isn't avoidable. I have the feeling that this is not the
right way to do but I have no better idea. To minimize the effort
to do a component for a model component I've built a base class
which should ease the customization of the component. The parameters
for the base component are:
- descriptionSelector
This is a symbol which is invoke on the model if you need a subset
of the descriptions. The default value is #description
- componentRenderer
The visitor which is used to render the component
- buttons
A Collection of Associations (button label -> selector). MAForm-
Decoration is only useful if you have save and cancel buttons. As the
selectors are performed on the MAContainerComponent there is no way of
extending it. I extendend MAFormDecoration to have associations for
buttons (to distinguish the button label and the selector to use) and
to be created with a delegator. The selector is than performed on the
delegate which leads to a usage form
component addDecoration:
(WHFormDecoration delegate: self)
buttons: #( #ok -> commit. #abbrechen -> abort)
- validation
There are three choices:
* no validation
* validation by MAValidationDecoration (or similar)
I must confess that I never understood processChildCallbacks.
* manual validation and error handling
Using the form
[self component validate]
on: MAError
do: [:anException | self exception: anException].
- answering
Having a wrapper component I need to process answer in the wrapper.
This can be customized by defining answerBlock. Default value is
self component onAnswer: (
answerBlock ifNil: [
[:anAnswer | self answer: anAnswer]
]
)
- readonly/readwrite
I'm mimicking the behaviour in MAElementComponent having
renderViewerOn:/renderEditorOn:. This is a good way to switch a
component between readonly and readwrite mode. In my case the layout
of the component is completely different between those two modes. So
I use two different renderers for readonly and for readwrite mode.
- really complex layout cases
I have one case where it is necessary to put css classes to some of
the components of a form. The best way I found so far (being dirty)
is to use propertyAt:put: at description level and use this in a
specialized renderer
So far so good. I like to hear your oppions and experiences doing this
kind of stuff.
Another problem I have no solution til now is the mixture of models into
one component. Sometimes you build your data model and then page layout
forces you to edit two objects at the same time. I have no problem to
mix descriptions in a desired way. But by invoking asComponentOn: they
would have all the same model which is wrong for a subset of the
descriptions. Is there any clever way to mix descriptions, set the model
accordingly and then produce the component?
thanks in advance,
Norbert
Hi Lukas,
Smallwiki rocks! I made a custom stylesheet for Smallwiki, how can I
add it to the list of defaults?
My stylesheet is called "The Pixel is Dead" and can adapt to any user-
given font-size in the browser. for an example see http://
smallwiki.unibe.ch/moose/
cheers,
AA
All the latest versions of magritte in the
Monticello repository seem to be empty. For expample,
I downloaded the latest Magritte-Seaside (219) with my
web browser from mc.lukas-renggli.ch. The mcz file is
16205 bytes in size. source.st is just 279 bytes. This
doesn't seem to be a full release.
Norbert
This list used to be readable via gmane. That stopped in September 2006.
Did the list move or something like that? Would it be possible to update
the gmane information?
Elfi (again)
I get error's like this sometimes when I click a link in pier:
Error: "/seaside/mmiki/seaside/mmiki/A-Page" not found.
Notice the path is duplicated. I figure that this is an error that
occurs after the page time's out. yes?
How can I fix this? Why does this happen? Lukas mentioned a thread to
search for but I can't find that message (sorry!) and I haven't found a
good explanation.
Can anyone point me in the right direction?
thanks,
brad
--
brad fuller
http://www.Sonaural.com/
+1 (408) 799-6124
Hello,
I am trying to figure out the design of the classes in Pier Blog. I am
wondering why PBBlog is a subclass of PRCase, and not a direct
subclass of PRStructure:
PRStructure #('parent' 'name' 'title' 'tags')
PRCase #('document')
PBBlog #('managingEditor' 'webMaster' 'copyright' 'language'
'itemCount'
'feedTitle' 'commentTimeout')
PBEntry #('uuid' 'author' 'publication')
PBComment #()
PBPost #('sourceUrl' 'sourceTitle' 'enclosure')
PRPage #()
PRComponent #('componentClass' 'settings')
PRFile #('file')
PRForm #('model' 'metamodel')
PRCase's class comment says:"I am an abstract class holding onto a
document definition representing the contents of the receiver. Most of
my subclasses will allow user to edit myself using the Wiki syntax."
I guess my question is: for an application that is similar to a blog
(managing a list of homogeneous entries, maybe nested), is it a good
idea to make it a direct subclass of PRStructure?
Matthias
Hi,
I got it a 3.9 and installed pier from squeakmap. Then, from monticello,
I installed Pier plugin. I created a new bog, and when I try to open it,
I get the next error:
MessageNotUnderstood: WARenderedHtmlRoot>>rss
* WARenderedHtmlRoot(Object)>>doesNotUnderstand: #rss
self a WARenderedHtmlRoot
*temps*
aMessage rss
*inst vars*
docType '
title 'Pier: Giuseppe'
htmlAttrs a WAHtmlAttributes
headAttrs a WAHtmlAttributes
bodyAttrs a WAHtmlAttributes
headElements an OrderedCollection(a WAMetaElement a
WALinkElement a WALinkElement a WALinkElement a
WAScriptEleme...etc...
scripts an OrderedCollection()
styles an OrderedCollection('#toolbar { position: fixed;
bottom: 0; left: 0; right: 0; margin-top: 40px; pa...etc...
resourceBaseUrl nil
context a WARenderingContext
* PBBlogHtmlView(PBHtmlView)>>updateRoot:
self a PBBlogHtmlView
*temps*
aHtmlRoot a WARenderedHtmlRoot
*inst vars*
decoration a WAStateHolder(a WAAnswerHandler)
context a PRContext stucture: 'Giuseppe' command: 'View'
blog a PBBlog name: 'Giuseppe'
posts #()
batcher a WABatchedList
tag nil
* [] in WARender>>buildDocRoot {[:each | each updateRoot: docRoot]}
self a WARender
*temps*
docRoot a WARenderedHtmlRoot
each a PBBlogHtmlView
*inst vars*
root a WAToolFrame
context a WARenderingContext
request nil
url a WAUrl
* PBBlogHtmlView(WAPresenter)>>withNextPresentersDo:
self a PBBlogHtmlView
*temps*
aBlock [] in WARender>>buildDocRoot {[:each | each
updateRoot: docRoot]}
ea nil
*inst vars*
decoration a WAStateHolder(a WAAnswerHandler)
context a PRContext stucture: 'Giuseppe' command: 'View'
blog a PBBlog name: 'Giuseppe'
posts #()
batcher a WABatchedList
tag nil
* [] in WAAnswerHandler(WAPresenter)>>withNextPresentersDo: {[:ea |
ea withNextPresentersDo: aBlock]}
self a WAAnswerHandler
*temps*
aBlock [] in WARender>>buildDocRoot {[:each | each
updateRoot: docRoot]}
ea a PBBlogHtmlView
*inst vars*
next a WAStateHolder(a PBBlogHtmlView)
block [] in PRContentsWidget>>buildComponent: {[:value | self
onAnswerCommand: value]}
Thanks in advance.
--
Giuseppe Luigi Punzi
:: ZYO :: Solutions everywhere
email: glpunzi(a)zyoconsulting.com
tlfno: +34 675 145 912
web: http://www.zyoconsulting.com
Bugs of Magritte and Pier are now tracked on Mantis. To report chose
the project 'Squeak Packages' and an appropriate category, e.g.
'Magritte' or 'Pier'.
Of course, and this is still the preferred way, all the Monticello
repositories are open for your contribution. Therefor if you have
found and fixed a bug you can directly commit your changes there.
They will eventually be merged into the mainstream. That's simple and
generally more efficient. For all other cases there is Mantis now.
Cheers,
Lukas
PS: There is also a category for Seaside on Mantis, in case that's
the source of problems.
--
Lukas Renggli
http://www.lukas-renggli.ch