Hi Mariano,
Ok, I have extracted the functionality you need in QC-Magritte-Ajax. It contains a custom
renderer to override the table renderer (QCAjaxTableRenderer). Note that it re-renders the
entire table on each change … so it does not need groups. Unfortunately it does not keep
the focus, this is the only thing that bugs me, and rendering more of the page, gives a
bigger chance of giving the user some annoyance over this.
The package QC-Magritte-Ajax should work stand alone, I did not test this yet.
Cheers,
Diego
On Dec 10, 2013, at 6:37 PM, Mariano Martinez Peck wrote:
On Tue, Dec 10, 2013 at 7:50 AM, Diego Lont <diego.lont(a)delware.nl> wrote:
Hi all,
As you probably all know I have made a library (QC Magritte) that is build on top of
Magritte. I think it contains a lot of good add ons, maybe not structured enough. I am
trying to clean this code up, so it can be used easily by all. At this point I want to
move 2 things to Magritte. One as a change, and one as an add-on:
Change:
I would like to modify the basic MAContainerComponent to cache the description and
pre-process this with the description builders. I believe this is a missing hook in
Magritte. It is easy to add, and you do not notice it, if you do not use it. Also it
applies to all platforms, not just to Seaside, so if you think this is a good idea, I will
also modify the glamour container. The following problems can be solved using builders:
- separating display from the model. Now you have to set your custom component
classes in the model. It is much more elegant to do this from the display side. To add a
builder it can set the component class for each type of description (using visitors), for
the application you want to show.
- adding security. When you pre process the description before showing it, you
can set fields to readonly, or remove them entirely from the description if the user is
not allowed to see those properties.
Add-On:
I would ilke to add a package to Magritte3-AddOns called Magritte-Ajax. In this add-on I
will put the things that allow Ajax rendering of the components. Of course this is on top
of seaside and only valid for seaside, but that is why I think it should be an add-on and
not in the core. This would be:
- The AjaxMemento. (QCAjaxMemento)
- the extension methods for Ajax rendering.
- the extension methods for the added Ajax properties.
All these for sure!
- A renderer, that renders the component, using Ajax. (QCGroupedFormRenderer)
Please let me know if you think this is a good idea. If you know a better place to do
these things, or to put the code, let me know.
Hi Diego,
First, thanks for pushing this stuff. I also have many extensions I did myself to
Magritte and so far I have them as subclasses or extension methods etc. I need to clean
them up before asking if they are useful. I will send a separate mail for that.
For this particular email, I think that what you suggest makes sense. Magritte-Ajax will
depend on JQuery right?
I should have answered this email instead of the other one...anyway, I will repeat it
here. I would love if the first 3 points of the add on could be used WITHOUT the
QCGroupedFormRenderer. Or at least a class that doesn't imply many changes. In other
words...to plug that nice behavior with the default rendered class: MATableRenderer.
would that be possible?
Thanks in advance,
If people have questions about QC-Magritte, please do not hesitate to ask them. I will
try to respond them fast and I will be available on Skype and Google Hangouts.
Cheers,
Diego
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
--
Mariano
http://marianopeck.wordpress.com
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki