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. - 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. 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 |
On Tue, Dec 10, 2013 at 7:50 AM, Diego Lont <[hidden email]> wrote: Hi all, All these for sure! - A renderer, that renders the component, using Ajax. (QCGroupedFormRenderer) 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. Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by DiegoLont
Ciao,
i work with a Pharo 2.0 20628 image. I report error: [Pharo-dev] MessageNotUnderstood: SmallInteger>>isEmpty to <[hidden email]> After i first do: ( ConfigurationOfSeaside3 project version: '3.1.0') load and test it ( it work fine ). Now the ((Smalltalk at: #ConfigurationOfQCMagritte) project version: '0.2') load: #( 'Demo' ) erase the error : MetacelloMCVersionSpec(Object)>>error: MetacelloMCVersionSpec>>resolveToLoadableSpec:forMap:packages: in Block: [^ self error: 'Name not found: ' , aString] MetacelloMCVersionSpec>>packageNamed:forMap:ifAbsent: MetacelloMCVersionSpec>>resolveToLoadableSpec:forMap:packages: MetacelloMCVersionSpec>>resolveToLoadableSpecs:map: in Block: [:req | (self... Set>>do: MetacelloMCVersionSpec>>resolveToLoadableSpecs:map: MetacelloMCVersionSpecLoader>>resolveToLoadableSpecs MetacelloMCVersionSpecLoader>>load MetacelloMCVersion>>executeLoadFromArray: MetacelloMCVersion>>fetchRequiredFromArray: in Block: [:dict | ^ self executeLoadFromArray: anArray] MetacelloPharoPlatform(MetacelloPlatform)>>useStackCacheDuring:defaultDictionary: in Block: [^ aBlock value: dict] BlockClosure>>on:do: MetacelloPharoPlatform(MetacelloPlatform)>>useStackCacheDuring:defaultDictionary: MetacelloMCVersion>>fetchRequiredFromArray: in Block: [self versionSpec loader: newLoader.... BlockClosure>>ensure: MetacelloMCVersion>>fetchRequiredFromArray: in Block: [[self versionSpec loader: newLoader.... MetacelloPharoPlatform>>do:displaying: in Block: [aBlock value] BlockClosure>>ensure: RPackageSet class>>withCacheDo: MetacelloPharoPlatform>>do:displaying: in Block: [:bar | ... BlockClosure>>cull: Job>>run in Block: [result := block cull: self] BlockClosure>>on:do: Job>>run in Block: [self prepareForRunning.... BlockClosure>>ensure: Job>>run MorphicUIManager(UIManager)>>displayProgress:from:to:during: ByteString(String)>>displayProgressFrom:to:during: MetacelloPharoPlatform>>do:displaying: I wrong something ? I can load QCMagritte with Seaside 3.1.0 ? Thanks for any considerations Dario _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
I forgot:
> Ciao, > > i work with a Pharo 2.0 20628 image. > > I report error: [Pharo-dev] MessageNotUnderstood: SmallInteger>>isEmpty to <[hidden email]> > > After i first do: ( ConfigurationOfSeaside3 project version: '3.1.0') load > > and test it ( it work fine ). > > > Now the ((Smalltalk at: #ConfigurationOfQCMagritte) project version: '0.2') load: #( 'Demo' ) > > erase the error : Error: Name not found: Base > > MetacelloMCVersionSpec(Object)>>error: > MetacelloMCVersionSpec>>resolveToLoadableSpec:forMap:packages: in Block: [^ self error: 'Name not found: ' , aString] > MetacelloMCVersionSpec>>packageNamed:forMap:ifAbsent: > MetacelloMCVersionSpec>>resolveToLoadableSpec:forMap:packages: > MetacelloMCVersionSpec>>resolveToLoadableSpecs:map: in Block: [:req | (self... > Set>>do: > MetacelloMCVersionSpec>>resolveToLoadableSpecs:map: > MetacelloMCVersionSpecLoader>>resolveToLoadableSpecs > MetacelloMCVersionSpecLoader>>load > MetacelloMCVersion>>executeLoadFromArray: > MetacelloMCVersion>>fetchRequiredFromArray: in Block: [:dict | ^ self executeLoadFromArray: anArray] > MetacelloPharoPlatform(MetacelloPlatform)>>useStackCacheDuring:defaultDictionary: in Block: [^ aBlock value: dict] > BlockClosure>>on:do: > MetacelloPharoPlatform(MetacelloPlatform)>>useStackCacheDuring:defaultDictionary: > MetacelloMCVersion>>fetchRequiredFromArray: in Block: [self versionSpec loader: newLoader.... > BlockClosure>>ensure: > MetacelloMCVersion>>fetchRequiredFromArray: in Block: [[self versionSpec loader: newLoader.... > MetacelloPharoPlatform>>do:displaying: in Block: [aBlock value] > BlockClosure>>ensure: > RPackageSet class>>withCacheDo: > MetacelloPharoPlatform>>do:displaying: in Block: [:bar | ... > BlockClosure>>cull: > Job>>run in Block: [result := block cull: self] > BlockClosure>>on:do: > Job>>run in Block: [self prepareForRunning.... > BlockClosure>>ensure: > Job>>run > MorphicUIManager(UIManager)>>displayProgress:from:to:during: > ByteString(String)>>displayProgressFrom:to:during: > MetacelloPharoPlatform>>do:displaying: > > > I wrong something ? > > I can load QCMagritte with Seaside 3.1.0 ? > > > Thanks for any considerations > > Dario > > > _______________________________________________ > Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Mariano Martinez Peck
Hi Mariano,
So basically you say yes, but my renderer does too much. Ok, I will try to make a stripped version of this renderer. Cheers, Diego On Dec 10, 2013, at 6:37 PM, Mariano Martinez Peck wrote:
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Wed, Dec 11, 2013 at 7:04 AM, Diego Lont <[hidden email]> wrote:
Thanks Diego. Yes, or have a minimal render with the minimal needed behavior for such a features, or at least to be able to plug that features over the default render.
Thanks!! let me know if I can help with something. I can start using it right ahead :)
Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Mariano Martinez Peck
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:
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Wed, Dec 11, 2013 at 9:25 AM, Diego Lont <[hidden email]> wrote:
Hi Diego, thanks for doing that! A quick tests shows me that it works! The only small detail is that
QCAjaxMemento #procesHiddenFor: aDescription value: anObject sends #hiddenValues to the description and #readUsing: sends #isWrapped. We don't have either of them. So I think we either move those 2 to QC-Magritte-Ajax or we put a dependency to QC-Magritte-Other (and hence also QC-Magritte-Core). Maybe the first option is easier.
In my particular use-case, I usually have many combos lists in which the "options and values" comes from a DB query. Even if I do have caches etc I would try to avoid doing such a queries each time a field is modified. So I will see if I can adapt QCAjaxTableRenderer to perform the ajax only for groups (as it was the previous render). I think that having ALSO such feature also in QCAjaxTableRenderer would be awesome. Then we can have simple flags to update all fields or update only by groups :)
Thanks Diego, it is good to see Magritte-Seaside moving forward!
Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Hi Mariano,
Yes, I will move those to QC-Magritte-Ajax (done). QC-Magritte-Other is a collection of all the things that do not have a good place yet. One thing in trying do separate them into groups: a table can only re-render a single row, or an entire table. So you will have to create subtables, or some other structure to allow that in Ajax. And I see I missed a question. Yes, QC-Magritte-Ajax depends on JQuery. Cheers, Diego On Dec 11, 2013, at 2:07 PM, Mariano Martinez Peck wrote:
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Wed, Dec 11, 2013 at 10:38 AM, Diego Lont <[hidden email]> wrote:
Cool, thanks!
Good point. Well...did you remember I told you I have my own subclass of MATableRenderer? Well...my subclass DOES NOT user HTML tables. Instead, it uses DIVs (actually Bootstrap tbsColumns, and tbsRows, etc... (I can share this render if someone is interested) So in such a case I would not have this problem right?
So probably I can extract such behavior from QCGroupedFormRenderer. Could you tell me which is the key part to extract? Thanks Diego,
Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by dtrussardi@tiscali.it
Hi,
yesterday i submit to this wiki a question titled: Error: Name not found: Base At today i don't solve the problem. I'm interested to understund the new QCMagritte support, but i can't load it into Pharo 2.0 >> >> i work with a Pharo 2.0 20628 image. >> >> Yesterday i report error: [Pharo-dev] MessageNotUnderstood: SmallInteger>>isEmpty to <[hidden email]> As Eliot write in <[hidden email]> I suspect you have an older, buggy, VM. What does the VM say to -version ( you can view my answer into <[hidden email]> ) >> >> After i first do: ( ConfigurationOfSeaside3 project version: '3.1.0') load >> >> and test it ( it work fine ). >> But Seaside is load and work fine. Now the ((Smalltalk at: #ConfigurationOfQCMagritte) project version: '0.2') load: #( 'Demo' ) erase the error : Error: Name not found: Base MetacelloMCVersionSpec(Object)>>error: MetacelloMCVersionSpec>>resolveToLoadableSpec:forMap:packages: in Block: [^ self error: 'Name not found: ' , aString] MetacelloMCVersionSpec>>packageNamed:forMap:ifAbsent: MetacelloMCVersionSpec>>resolveToLoadableSpec:forMap:packages: MetacelloMCVersionSpec>>resolveToLoadableSpecs:map: in Block: [:req | (self... Set>>do: MetacelloMCVersionSpec>>resolveToLoadableSpecs:map: MetacelloMCVersionSpecLoader>>resolveToLoadableSpecs MetacelloMCVersionSpecLoader>>load MetacelloMCVersion>>executeLoadFromArray: MetacelloMCVersion>>fetchRequiredFromArray: in Block: [:dict | ^ self executeLoadFromArray: anArray] MetacelloPharoPlatform(MetacelloPlatform)>>useStackCacheDuring:defaultDictionary: in Block: [^ aBlock value: dict] BlockClosure>>on:do: MetacelloPharoPlatform(MetacelloPlatform)>>useStackCacheDuring:defaultDictionary: MetacelloMCVersion>>fetchRequiredFromArray: in Block: [self versionSpec loader: newLoader.... BlockClosure>>ensure: MetacelloMCVersion>>fetchRequiredFromArray: in Block: [[self versionSpec loader: newLoader.... MetacelloPharoPlatform>>do:displaying: in Block: [aBlock value] BlockClosure>>ensure: RPackageSet class>>withCacheDo: MetacelloPharoPlatform>>do:displaying: in Block: [:bar | ... BlockClosure>>cull: Job>>run in Block: [result := block cull: self] BlockClosure>>on:do: Job>>run in Block: [self prepareForRunning.... BlockClosure>>ensure: Job>>run MorphicUIManager(UIManager)>>displayProgress:from:to:during: ByteString(String)>>displayProgressFrom:to:during: MetacelloPharoPlatform>>do:displaying: I wrong something ? I can load QCMagritte with Seaside 3.1.0 ? I need to load ConfigurationOfQCMagritte-DiegoLont.19 ? Thanks for any consideration. Dario _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Mariano Martinez Peck
OK....I started to merge QCGroupedFormRenderer with my own table. So far so good. I have one question. I am trying to put 3 descriptions into the same group. For some reasons I cannot discover, 2 out of 3, gets re-render. One of them isn't (its description method is not even called). And as far as I can see it looks the same as one of the other descriptions that does get call and re-render.
Any bell? Thanks! On Wed, Dec 11, 2013 at 11:01 AM, Mariano Martinez Peck <[hidden email]> wrote:
Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Ok, the problem was that renderEditorOn: html ajaxScript: aScript (self magritteDescription isGrouped and: [ self magritteDescription groupBy canRead: self value ])
ifTrue: [ self renderEditorForGroupedOn: html ] ifFalse: [ self renderEditorForUngroupedOn: html ajaxScript: aScript ]
MASingleOptionDescription implements #isGrouped answering: isGrouped
^ self groupBy notNil and of course, in my description groupBy was giving nil.... mmmm I have never ever used #groupBy: so I don't know... thoughts? On Wed, Dec 11, 2013 at 2:29 PM, Mariano Martinez Peck <[hidden email]> wrote:
Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Forget what I have just sent....it is nonesense On Wed, Dec 11, 2013 at 3:19 PM, Mariano Martinez Peck <[hidden email]> wrote:
Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Hi Diego, I have a question. I think I reached a limitation. From what I understand, you put a div for the group and you use that ID for the AJAX. Since you use a close priotity between each description that belongs to the same group, then it is not a problem...all labels/controls end up inside that DIV for the group with the defined ID for the AJAX.
I wonder....is there a way/workaround if I want to have the descriptions belonging to a group separated? I know... probably I should use a better name since Group in magritte is for displaying them together etc. In my case is about "refresh connectivity" or "value dependency" or something like that, but not necessary they should be displayed one after the other one.
Is there any workaround? For example, what if I do something similar to what you did in QCAjaxTableRenderer but instead of rendering the whole container, I take 'containerDescription' instVar, ask the descriptions for the group XXX and send a an AJAX for them?
Thoughts? On Wed, Dec 11, 2013 at 3:22 PM, Mariano Martinez Peck <[hidden email]> wrote:
Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On 11 dec. 2013, at 21:09, Mariano Martinez Peck <[hidden email]> wrote:
> I have a question. I think I reached a limitation. From what I understand, you put a div for the group and you use that ID for the AJAX. Since you use a close priotity between each description that belongs to the same group, then it is not a problem...all labels/controls end up inside that DIV for the group with the defined ID for the AJAX. > I wonder....is there a way/workaround if I want to have the descriptions belonging to a group separated? I know... probably I should use a better name since Group in magritte is for displaying them together etc. In my case is about "refresh connectivity" or "value dependency" or something like that, but not necessary they should be displayed one after the other one. You can of course make the update much more complex, but we found (in what we build) simply refreshing either the whole page or a common parent sufficiently performant. If you connect arbitrary (nested) elements you need to avoid update cycles. Stephan _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Wed, Dec 11, 2013 at 5:28 PM, Stephan Eggermont <[hidden email]> wrote:
Ok, I understand. What I need is: 1) To not re-render all fields (I have many forms where I have many lists that are queried from a DB) for every single field modification.
2) I don't want to have to display some fields together in order to have them been re-rendered when one of them has been modified. 3) I am not obligued to use #group: I can use something different, like #dependentsGroups or something like that
Any hint on how to implement that adapting your very cool stuff will be very much appreciated! Stephan Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by DiegoLont
Mariano wrote: >Any hint on how to implement that adapting your very cool stuff will be very much appreciated! Instead of a single id, you'd then use a set of pairs id->containerDescription, I guess. You might want to use a separate class for that once you want to minimize updates. And be careful to avoid cycles. Stephan _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Mariano Martinez Peck
Yes, that should not be the problem. That was what the rendering in groups was for. The method that creates the script does it on a single id, and creates and updater for this part of the page only.
That implies adding multiple updates, so multiple scripts to the same input. So instead of adding a "script: aScript" parameter, we probably should have a variant that adds a "scripts: aCollection" parameter. I am not sure how the implementation should look like exactly. You can try simply adding all scripts. Of course: beware of loops, because otherwise the loading will never stop.
Point taken. I misused group here. I probably should have introduced another term. Do you have a good suggestion? I do not think we should couple this to group. Diego P.S. If added you as contributor to QCMagritte _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Fri, Dec 13, 2013 at 12:59 PM, Diego Lont <[hidden email]> wrote:
Yes, I saw that. You either create the script for the whole form or for the group div.
Yes. Each element of the group has multiple scripts (one for each other of the group), right?
What if: - We store the container (as you did with the AjaxTable..) - to the container we ask the "dependencyGroups" (I pick this name for this mail).
- We create a script for each element of each dependencyGroup. - To each element of each dependencyGroup we set all the scripts of that group. Sounds ok but no idea how to implement it heheheh. But the flexibility is huge. You decouple from #group, you decouple from the fact of having to display dependent fields one below another one...
OK
#dependenciesGroup: ? #notificationGroup: #updaterGroup: same of above but using the word "set" instead of group (to avoid any confusion with Magritte groups). Like "dependenciesSet"
Thanks! _______________________________________________ Mariano http://marianopeck.wordpress.com _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Free forum by Nabble | Edit this page |