Hi :)
the descriptions are already within a collection
accessible from the
class-side, even-tough you define them within separate methods. Send
the message #description to your class and you get your collection.
Well actually it is a bit more, you get an instance of
MAPriorityContainer supporting the whole collection protocol.
Actually I've been learning quite a bit how descriptions are generated
as it's necessary for what I want to achieve.
To sum up, I have an attribute which is a container (wrapper) that
points to an object model (domain) and to an analysis element (a simple
object that has a value)
nb: for now I have two parallel hierarchies. One for ExpAttributes and
one for the domain objects.
ExpAttribute
model:= aMAPerson
analyse:= anAnalyse
All my domain objects are meta described as the analyse one.
So now I have an experience that is composed of ExpAttribute and for
these I'd like to dynamically generate the description what is not so
easy as the model element is not of the same type for all ExpAttribute
(I only differentiate Attribute that are Leaf (equivalent to Magritte
descriptions minus MARelationDescription...) and those that are composed
(equivalent to MARelationDescription)).
Whereas on your slides, "dynamic descriptions" are build from existing
descriptions on class side, here I need to build them according to the
object wrapped in the ExpAttribute>>model
So that is why I was interested in description generation. Is it
possible for instance to overwrite description like:
Model>>description
container := super description <- return a MAPriorityContainer
container add: aNewDescription etc...
doing like that, I had a problem because descriptions are added over and
over after each new session because MACachedBuilder keeps a cache with
the previous descriptions.
I've overwritten in my ExpAttribute class
description
^MABuilder default build: self
It now works but not sure it's a good solution...
What is the purpose of MACachedBuilder instead of MABuilder? avoiding
creating descriptions over and over?
Also I was thinking of doing that:
Model>>description
^MASpecificBuilder new build: self
So before going further, can you tell me if it is a good practice
- to redefine description on the instance side ?
- to use a specific builder ?
Is there a better way to create dynamically descriptions according to
the Magritte framework (when some descriptions are accessible in the
class side and others in class side of other objects class side...)...
Maybe I should do that with a MAScafolder ??
I ve tried to
adapt what Michel Bany did (http://
cdrick.seasidehosting.st/seaside/LiveTests the scrollbar) to the
new renderer to have a MARangeComponent compatible with all browser
but without success... Does it seems possible to you as it uses
some functions of seaside Async ? anyway, I'll see that point later...
No, MARangeComponent only works in KHTML based browsers, such as
Safari or Konqueror. It is based on the draft of the next XHTML
standard and it gently degenerates to a plain input box if not
supported.
Yes I knew that... but what I tried was to adapt the scrollbar component
as provided in the exemple (http://
cdrick.seasidehosting.st/seaside/LiveTests) to WARenderCanvas. It's a
live div but Michel Bany (I think he made that) did it for WAHtmlRenderer.
WAHtmlRenderer>>scrollbarWithHeight: heightNumber size: sizeNumber
liveCallback: liveBlock
| id uri |
id := self ensureId.
self attributeAt: 'style'
put: 'position: relative; left: -3px; width: 19px; overflow: auto;
height: ', heightNumber displayString 'px'.
self div:
[self attributeAt: 'style' put: 'width: 1px; height: ',
sizeNumber displayString, 'px'. self div: ''].
uri := self **urlForLiveRequest:** [:t :h | liveBlock value:
t asInteger value: h].
self
script: 'document.getElementById('
, id asString printString
, ').onscroll = liveScroll('
, id asString printString
, ', '
, (self class encode: **uri** asString) printString
, ')'
I just started to do it "like" you did with MARangeComponent
(renderEditorOn: and updateScript) so as to adapt to WARenderCanvas but
I didnt' succeed yet and as it is not that important, I gave up for now
;)...
I don't use SeasideAsync, there are a few experimental controls using
script.aculo.us. This library works nicely together with seasides
canvas framework and would also provide a cross-browser compatible
slider, that could be integrated if I (or somebody else) had the time.
ok didn't know that :)
where can I find the javascript code for that ?
see you
Cédrick
--------------------------------
L'ENIT vous invite a sa journee portes ouvertes le 17 mars 2006 de 13h30 a 19h30
Enit , 47 avenue d'Azereix 65000 Tarbes
Bus N°1, arret ENI