Hi David,
There's probably a bug in
SW2PluggableComponent>>renderContentOn:
This class has a block as an inst var and in #renderContentOn: this
block is
analyzed if it expects two args. If not, it's tried to render this
block
with html render: block. But this won't work, because a block can't be
rendered directly.
well what do you do with your all your div, span, heading and
anchor-tags? There are blocks that are rendered all over the place :-)
html div: [
html span: [
html heading: [
html
anchorWith...
do: [ ... ] ] ] ].
Have a look at WAAbstractHtmlBuilder>>render: and
BlockContext>>renderOn: where the double dispatch on blocks happens. As
you can see Seaside accepts zero and one argument blocks, and I
enhanced this for SW2PluggableComponent to have two possible arguments.
However it is generally not a very good idea to use
SW2PluggableComponent extensively, but for fast prototyping its use
might be nice. Currently there is no use of SW2PluggableComponent in
SmallWiki2 anymore.
Another issue is that the style-sheet is stored in a
remote file which
we
could not change/extend. Wouldn't it be better to have the style
definitions
directly in the image? For instance you could create a style library
class
for SW2.
Please submit a patch to SmallWiki2-Seaside, I just didn't bothered to
put all those style-sheets and images into a style library class yet,
it was simply easier for me to edit the file in a css-editor. Check out
the new style, it has some fancy css-buttons in the heading-bar!
Then I have encountered a problem with the commands
for a structure. I
have
created a new subclass of Structure and now I would like to define some
commands for this new kind of structure. But then all the other
commands
that are bound to Structure (like Move, Copy, Add, ...) will also be
displayed in the command widget when browsing an instance of this new
structure. I see no way to specify that these commands should not be
available for my newly defined structure. It would be better to have
the
possibility to explicitly say for which structures a command should be
available. A collection of structure classes instead of SW2Command
class >>
defaultStructureClass maybe?
I see the problem, but having collection the commands (static state)
wouldn't solve the problem either, because one cannot know what
structure and commands (it is an m to n relationship) will exist in the
future. It also gets difficult because one doesn't know who has the
responsibility to register the commands, the command or the structure?
Generally I prefer dynamic state, that means we should introduce
another dispatch in SW2Context>>allValidCommands to let the command and
the structure have the possibility to reject a command.
Another problem with newly created subclasses of
Structure is that
they will
all appear in the 'type'-dropdown when adding a child structure with
the
AddCommand. This might not be desired for all subclasses of Structure.
Similar problem as above: I suggest that you submit a patch to the
latest SmallWiki2 package that fits your needs so that it can be merged
into the core code and everybody can profit.
It would be great to have a method
MAElementDescription >>
attributeAt:put:
to specify new attributes for the component of a description.
Currently, one
has to use #attributes which is not convenient.
Margritte is not a Seaside framework, generally speaking.
As far as I know there is just one use of #attributes: in SmallWiki
itself and as I don't write code that I don't need, I didn't felt the
need for such methods yet. However feel free to add them for your
convenience, that's the reason why there are class extensions ;-)
Then there are several components available that
render a text field
with a
button, such as MADateInputComponent, MATimestampInputComponent, ... I
tried
to create a subclass of such a component to change the button's
appearance
(different label or an image as button). But this is not possible
because
the button is rendered directly in #renderEditorOn:, so I can't
override
this method. It would be better to have a method #renderButtonOn: in
MATextInputComponent, so all subclasses with a button have to override
just
this method which would be empty in MATextInputComponent.
Yeah, I see, maybe sometimes I am too lazy.
But besides that, Magritte is really cool. :)
Thanks.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch