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?
Keith --
I was trying out your MADivsRenderer this evening and found that if my
description class has no cssClass specified, that the following causes
problems when the call to "(self classFor: aDescription)" returns
nil.. It then tries to append "clear" to the list and that gets me a
DNU.. It took me a while to track it down as I initially thought it
might be a general Migritte issue.. Anyway,
MAComponentRenderer>>classFor: has a call to #reduce at the end and if
the class list is empty it returns nil which is where the initial nil
is coming from. I checked to see what Squeak has for the #reduce:
method and it also returns nil when the OrderedCollection is empty --
so this bug should be reproducible on Squeak as well..
I suppose one work-around would be to change
MAComponentRenderer>>classFor: to check if it gets nil back from the
reduce call and not return a nil object or perhaps something else like
changing MADivsRenderer>>renderContainer to check the return value of
#classFor: to see if it gets a nil back and if so create a string
object....
comments/suggestions welcome..
Greetings,
The videos at http://www.lukas-renggli.ch/smalltalk/pier are causing me
some problems.
When I download a video, e.g, "Creating Pages and Files" and play it,
all I see is the initial page just sitting there. No mouse movement,
nothing changes and there is no audio.
Is anyone else experiencing this? I am using Windoze XP and using VLC
Media Player to play the video.
Thanks,
Frank
---------- Forwarded message ----------
From: Paolo Bonzini <bonzini(a)gnu.org>
Date: Aug 14, 2008 10:45 AM
Subject: [Help-smalltalk] Magritte ported to GNU Smalltalk
To: help-smalltalk(a)gnu.org
I committed a port of Magritte and of the Seaside bindings to
Magritte. This highlighted a few bugs (in the class library and in
gst-convert) and provided a better stress test for the Seaside/Swazoo
pair.
You can test Magritte-Seaside by doing
gst-package --start Seaside Magritte-Seaside
and pointing your browser to http://localhost:8080/seaside/editor.
Paolo
_______________________________________________
help-smalltalk mailing list
help-smalltalk(a)gnu.org
http://lists.gnu.org/mailman/listinfo/help-smalltalk
--
Lukas Renggli
http://www.lukas-renggli.ch
Hi,
I'm trying to use MAOneToManyComponentEditInPlace, and can't realize
how it is supposed to work... what I want to do is add rows and edit
them "InPlace"... now I can add new rows, but empty ones. Is possible
to edit them? how?
Thanks in advance,
Esteban
Hi all..
I'm trying to wrap my brain around the above classes and what they
offer over the default rendering that Magritte offers
(MATableRenderer)... To that end, I've seen a few little snippets
using a little of the above but still can't seem to figure out the
typical usage scenario.. I've got existing css that I would like to
use to dress up various pieces of one or more objects -- similar to
what Keith has submitted in photo form here on this mailing list
earlier this year (enclosing various fields in boxes,etc).. Anyway, if
someone can post a little code that can do something akin to that,
that would get me past my current hurdle.. MANY thanks in advance!
-- Rick