<div dir="ltr">Hi Iwan,<div><br></div><div>Just for the record, I also workaround this with Jupiter way.</div><div><br></div><div>Cheers,</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 16, 2016 at 8:19 AM, Jupiter Jones <span dir="ltr">&lt;<a href="mailto:jupiter.jones@mail.com" target="_blank">jupiter.jones@mail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There are a lot of ways of achieving this, but if you’re after a simple solution, you can use the:<br>
<br>
MAObject-#propertyAt:put:<br>
<br>
eg.<br>
^ MAToManyRelationDescription new<br>
        ...<br>
        componentClass: MyFancyTableComponent;<br>
        propertyAt: #fancyItemsPerPage put: 10;<br>
        yourself<br>
<br>
Then within MyFancyTableComponent instances you can check for the for the property in the description with:<br>
<br>
MAObject-hasProperty: #fancyItemsPerPage<br>
or<br>
MAObject-#propertyAt: #fancyItemsPerPage<br>
<br>
As you suggest, you could also subclass MAToManyRelationDescription and implement the behaviour you want. You can then override MADescription-C-#defaultComponentClasses to automatically use your MyFancyTableComponent... but yes, this does add more classes and apparent complexity - however, it’s all quite neat and everything is in it’s place :)<br>
<br>
Is this what you were after?<br>
<br>
J<br>
<br>
&gt; On 16 May 2016, at 8:09 PM, Iwan Vosloo &lt;<a href="mailto:iwan@reahl.org">iwan@reahl.org</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi there,<br>
&gt;<br>
&gt; We have an issue related to magritte-seaside.<br>
&gt;<br>
&gt; When you set the Component to be used on a MADescription, eg:<br>
&gt;<br>
&gt; descriptionThings<br>
&gt;  ^ MAToManyRelationDescription new<br>
&gt;         ...<br>
&gt;         componentClass: MyFancyTableComponent;<br>
&gt;         yourself<br>
&gt;<br>
&gt; .. then there is no way (that I am aware of) to initialize the created MyFancyTableComponent in a customised way.<br>
&gt;<br>
&gt; In the example above, for instance one may have a MyFancyTableComponent that divides its items into several pages (like an MAReport would do). The number of items displayed per page has to be hard-coded in MyFancyTableComponent. It would be nice to have a way to initialize a newly created instance, something like:<br>
&gt;<br>
&gt; descriptionThings<br>
&gt;  ^ MAToManyRelationDescription new<br>
&gt;         ...<br>
&gt;         componentClass: MyFancyTableComponent;<br>
&gt;         initializeComponent: [ :newlyCreatedComponent| newlyCreatedComponent itemsPerPage: 40 ];<br>
&gt;         yourself<br>
&gt;<br>
&gt; There are, of course, several ways one could do this. I am not necessarily suggesting the above example as the way to do it... I am just illustrating the point.<br>
&gt;<br>
&gt; If you do not have such a mechanism, the only thing you can do is subclass MyFancyTableComponent with the express motivation - to be able to set a new instance up a certain way. We have a log of code that does this sort of subclassing. It makes things go really messy eventually. We&#39;d like to get rid of all those subclasses and rather let the user of a component &#39;configure&#39; it appropriately.<br>
&gt;<br>
&gt; Building something like what I am proposing means changes to magritte-seaside code though. So, if we do it we&#39;d prefer to contribute upstream.<br>
&gt;<br>
&gt; Has anyone else come across this issue? Any ideas? Worthwhile to others too?<br>
&gt;<br>
&gt; Regards<br>
&gt; - Iwan<br>
&gt;<br>
&gt; --<br>
&gt; Reahl, the Python only web framework: <a href="http://www.reahl.org" rel="noreferrer" target="_blank">http://www.reahl.org</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; <a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br></div>
</div>