Re: Pharo-users Digest, Vol 75, Issue 41

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
ian
Reply | Threaded
Open this post in threaded view
|

Re: Pharo-users Digest, Vol 75, Issue 41

ian
On Mon, Jul 29, 2019 at 12:00:07PM -0400, [hidden email] wrote:

> Send Pharo-users mailing list submissions to
> [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.pharo.org/mailman/listinfo/pharo-users_lists.pharo.org
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Pharo-users digest..."
>
>
> Today's Topics:
>
>    1. Warning Newbie Question: Bootstrap Navbar example works my
>       copy and paste fails? (ian)
>    2. Re: Warning Newbie Question: Bootstrap Navbar example works
>       my copy and paste fails? ([hidden email])
>    3. Re: Warning Newbie Question: Bootstrap Navbar example works
>       my copy and paste fails? (Esteban Maringolo)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 28 Jul 2019 21:02:01 -0400
> From: ian <[hidden email]>
> To: [hidden email]
> Subject: [Pharo-users] Warning Newbie Question: Bootstrap Navbar
> example works my copy and paste fails?
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Hi All,
>
> Hopefully this is an easy one?
>
> I have been going through the MOOC exercises and have come across something I can't seem to figure out.
>
> In the example the code reads:
>
> ----
> renderExampleOn: html
>
> | bar id|
> id := 'navbarSupportedContent'.
> bar := html navigationBar.
> bar beLight; expandLarge.
> bar background beLight.
> bar with: [
> html navigationBarBrand: 'Navbar'. ]
>
> ----
>
> Mine reads exactly the same but errors in the browser with:
>
> ----
>
> Seaside Walkback
> MessageNotUnderstood: WAHtmlCanvas>>navigationBar
>
> Debug Proceed Full Stack
> Possible Causes
>
>     you sent a message this type of object doesn't understand
>
> Stack Trace
>
>     thisContext
>         WAHtmlCanvas(Object)>>doesNotUnderstand: #navigationBar
>     self
>         a WAHtmlCanvas
>
>     thisContext
>         VIHeaderComponent>>renderContentOn:
>     self
>         a VIHeaderComponent
>
>     thisContext
>         WARenderVisitor>>visitPainter:
>     self
>         a WARenderVisitor
>
>     thisContext
>         WARenderVisitor(WAPainterVisitor)>>visitPresenter:
>     self
>         a WARenderVisitor
>
>     thisContext
>         WARenderVisitor(WAPainterVisitor)>>visitComponent:
>     self
>         a WARenderVisitor
>
> ----
>
> When using Finder to locate the selector, navigationBar, I notice that it is a selector of SBSHtmlCanvas.
>
> So my question is: How to I set up my rendering class in seaside properly?  Currently, as per all I can find I am properly using WAComponent as application super class.
>
> I don't see anything in the seaside book regarding bootstrap and I am fallowing the MOOC section on bootstrap almost to a tee.  Accepting the fact that the library is now SBSDeploymentLibrary rather than TBSDeploymentLibrary.
>
> Any help would be greatly appreciated.
>
> Kindly,
>
> Ian
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 29 Jul 2019 09:40:31 -0300
> From: Esteban Maringolo <[hidden email]>
> To: Any question about pharo is welcome <[hidden email]>
> Subject: Re: [Pharo-users] Warning Newbie Question: Bootstrap Navbar
> example works my copy and paste fails?
> Message-ID:
> <CAJMgPC+TGk+q-8QU9S7im06ARgkKT-3eC51hCNMRuB=[hidden email]>
> Content-Type: text/plain; charset="UTF-8"
>
> You're using the Bootstrap 4 library and methods.
>
> I don't know about the one referenced in the MOOC, but there are
> several differences between Torsten's Bootstrap 3 (TBS prefixed
> classes) and Bootstrap 4 (SBS prefix), in particular because Bootstrap
> 4 library wrapper uses a subclass of WAHtmlCanvas where all the
> methods are implemented.
>
> See if your component implements #rendererClass it should return
> SBSHtmlCanvas as its renderer class instead of the default, inherited,
> WAHtmlCanvas.
>
> Regards,
>
>
> Esteban A. Maringolo
>
Thanks Esteban,

In the playground:

----
        | header |

                header := VIHeaderComponent new.
                header rendererClass.

----

        Returns: WAHtmlCanvas and not SBSHtmlCanvas.

----

Thus the fix was to override rendererClass and return the correct rendering class.

Nowhere in the documentation is this evident (although if I was ST proficient I would have been able to figure that out?

Thanks Muchly Esteban!!