why is my css not found in a seaside project

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

why is my css not found in a seaside project

Pharo Smalltalk Users mailing list
Hello,

I have this in my library class on the instance side :
 
updateRoot: anHtmlRoot
    super updateRoot: anHtmlRoot.
    anHtmlRoot stylesheet url: self class / #mainCss.
    anHtmlRoot javascript url: self class / #mainJs
and a file mainCss on the instance side filled with css
and still the css is not found

anyone idea why ?

if needed I can put my whole code on github.


Regards,

Roelof

Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Sven Van Caekenberghe-2
Try putting a breakpoint inside the #updateRoot: of your library class. Is it even called ?

> On 4 Jan 2020, at 11:17, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>
>
> From: Roelof Wobben <[hidden email]>
> Subject: why is my css not found in a seaside project
> Date: 4 January 2020 at 11:17:13 GMT+1
> To: Any question about pharo is welcome <[hidden email]>
>
>
> Hello,
>
> I have this in my library class on the instance side :
>  
> updateRoot: anHtmlRoot
>     super updateRoot: anHtmlRoot.
>     anHtmlRoot stylesheet url: self class / #mainCss.
>     anHtmlRoot javascript url: self class / #mainJs
>
> and a file mainCss on the instance side filled with css
> and still the css is not found
>
> anyone idea why ?
>
> if needed I can put my whole code on github.
>
>
> Regards,
>
> Roelof
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Pharo Smalltalk Users mailing list
Yes. it is callled

Roelof


Op 4-1-2020 om 11:48 schreef Sven Van Caekenberghe:

> Try putting a breakpoint inside the #updateRoot: of your library class. Is it even called ?
>
>> On 4 Jan 2020, at 11:17, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>>
>>
>> From: Roelof Wobben <[hidden email]>
>> Subject: why is my css not found in a seaside project
>> Date: 4 January 2020 at 11:17:13 GMT+1
>> To: Any question about pharo is welcome <[hidden email]>
>>
>>
>> Hello,
>>
>> I have this in my library class on the instance side :
>>  
>> updateRoot: anHtmlRoot
>>      super updateRoot: anHtmlRoot.
>>      anHtmlRoot stylesheet url: self class / #mainCss.
>>      anHtmlRoot javascript url: self class / #mainJs
>>
>> and a file mainCss on the instance side filled with css
>> and still the css is not found
>>
>> anyone idea why ?
>>
>> if needed I can put my whole code on github.
>>
>>
>> Regards,
>>
>> Roelof
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Sven Van Caekenberghe-2
Did you add your library to your application ?

        | app |
        app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
        app addLibrary: YourLibrary;

> On 4 Jan 2020, at 11:58, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>
>
> From: Roelof Wobben <[hidden email]>
> Subject: Re: [Pharo-users] why is my css not found in a seaside project
> Date: 4 January 2020 at 11:58:46 GMT+1
> To: Any question about pharo is welcome <[hidden email]>
>
>
> Yes. it is callled
>
> Roelof
>
>
> Op 4-1-2020 om 11:48 schreef Sven Van Caekenberghe:
>> Try putting a breakpoint inside the #updateRoot: of your library class. Is it even called ?
>>
>>> On 4 Jan 2020, at 11:17, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>>>
>>>
>>> From: Roelof Wobben <[hidden email]>
>>> Subject: why is my css not found in a seaside project
>>> Date: 4 January 2020 at 11:17:13 GMT+1
>>> To: Any question about pharo is welcome <[hidden email]>
>>>
>>>
>>> Hello,
>>>
>>> I have this in my library class on the instance side :
>>>  updateRoot: anHtmlRoot
>>>     super updateRoot: anHtmlRoot.
>>>     anHtmlRoot stylesheet url: self class / #mainCss.
>>>     anHtmlRoot javascript url: self class / #mainJs
>>>
>>> and a file mainCss on the instance side filled with css
>>> and still the css is not found
>>>
>>> anyone idea why ?
>>>
>>> if needed I can put my whole code on github.
>>>
>>>
>>> Regards,
>>>
>>> Roelof
>>>
>>>
>>>
>>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Pharo Smalltalk Users mailing list
Yes, I added it by using localhost:8080/config and then choose for the
application.

In the tutorial Im following that was the way the application is
registered and the library.

So where should I add the code you are saying to use.

Here is the code I have so far: https://github.com/RoelofWobben/paintings

Roelof




Op 4-1-2020 om 12:58 schreef Sven Van Caekenberghe:

> Did you add your library to your application ?
>
> | app |
> app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
> app addLibrary: YourLibrary;
>
>> On 4 Jan 2020, at 11:58, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>>
>>
>> From: Roelof Wobben <[hidden email]>
>> Subject: Re: [Pharo-users] why is my css not found in a seaside project
>> Date: 4 January 2020 at 11:58:46 GMT+1
>> To: Any question about pharo is welcome <[hidden email]>
>>
>>
>> Yes. it is callled
>>
>> Roelof
>>
>>
>> Op 4-1-2020 om 11:48 schreef Sven Van Caekenberghe:
>>> Try putting a breakpoint inside the #updateRoot: of your library class. Is it even called ?
>>>
>>>> On 4 Jan 2020, at 11:17, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>>>>
>>>>
>>>> From: Roelof Wobben <[hidden email]>
>>>> Subject: why is my css not found in a seaside project
>>>> Date: 4 January 2020 at 11:17:13 GMT+1
>>>> To: Any question about pharo is welcome <[hidden email]>
>>>>
>>>>
>>>> Hello,
>>>>
>>>> I have this in my library class on the instance side :
>>>>   updateRoot: anHtmlRoot
>>>>      super updateRoot: anHtmlRoot.
>>>>      anHtmlRoot stylesheet url: self class / #mainCss.
>>>>      anHtmlRoot javascript url: self class / #mainJs
>>>>
>>>> and a file mainCss on the instance side filled with css
>>>> and still the css is not found
>>>>
>>>> anyone idea why ?
>>>>
>>>> if needed I can put my whole code on github.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Roelof
>>>>
>>>>
>>>>
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Pharo Smalltalk Users mailing list
In reply to this post by Sven Van Caekenberghe-2
So, if I understand the seaside book well , I have to add this to the
painting class :


initialize
  | app |
     app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
     app addLibrary: YourLibrary;


or must I use another class and if so, which class.

Roelof



Op 4-1-2020 om 13:32 schreef Roelof Wobben:

> Yes, I added it by using localhost:8080/config and then choose for the
> application.
>
> In the tutorial Im following that was the way the application is
> registered and the library.
>
> So where should I add the code you are saying to use.
>
> Here is the code I have so far: https://github.com/RoelofWobben/paintings
>
> Roelof
>
>
>
>
> Op 4-1-2020 om 12:58 schreef Sven Van Caekenberghe:
>> Did you add your library to your application ?
>>
>>     | app |
>>     app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
>>     app addLibrary: YourLibrary;
>>
>>> On 4 Jan 2020, at 11:58, Roelof Wobben via Pharo-users
>>> <[hidden email]> wrote:
>>>
>>>
>>> From: Roelof Wobben <[hidden email]>
>>> Subject: Re: [Pharo-users] why is my css not found in a seaside project
>>> Date: 4 January 2020 at 11:58:46 GMT+1
>>> To: Any question about pharo is welcome <[hidden email]>
>>>
>>>
>>> Yes. it is callled
>>>
>>> Roelof
>>>
>>>
>>> Op 4-1-2020 om 11:48 schreef Sven Van Caekenberghe:
>>>> Try putting a breakpoint inside the #updateRoot: of your library
>>>> class. Is it even called ?
>>>>
>>>>> On 4 Jan 2020, at 11:17, Roelof Wobben via Pharo-users
>>>>> <[hidden email]> wrote:
>>>>>
>>>>>
>>>>> From: Roelof Wobben <[hidden email]>
>>>>> Subject: why is my css not found in a seaside project
>>>>> Date: 4 January 2020 at 11:17:13 GMT+1
>>>>> To: Any question about pharo is welcome <[hidden email]>
>>>>>
>>>>>
>>>>> Hello,
>>>>>
>>>>> I have this in my library class on the instance side :
>>>>>   updateRoot: anHtmlRoot
>>>>>      super updateRoot: anHtmlRoot.
>>>>>      anHtmlRoot stylesheet url: self class / #mainCss.
>>>>>      anHtmlRoot javascript url: self class / #mainJs
>>>>>
>>>>> and a file mainCss on the instance side filled with css
>>>>> and still the css is not found
>>>>>
>>>>> anyone idea why ?
>>>>>
>>>>> if needed I can put my whole code on github.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Roelof
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Sven Van Caekenberghe-2
Yes, you typically put that code in a class side method, like #register.

Then you can call #register from your class' #initialize if you want.

The advantage is that your registration process is now written out programmatically, instead of being a UI procedure, so it is more repeatable, shareable, etc.

> On 4 Jan 2020, at 19:42, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>
>
> From: Roelof Wobben <[hidden email]>
> Subject: Re: [Pharo-users] why is my css not found in a seaside project
> Date: 4 January 2020 at 19:42:44 GMT+1
> To: Any question about pharo is welcome <[hidden email]>
>
>
> So, if I understand the seaside book well , I have to add this to the painting class :
>
>
> initialize
>  | app |
>     app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
>     app addLibrary: YourLibrary;
>
>
> or must I use another class and if so, which class.
>
> Roelof
>
>
>
> Op 4-1-2020 om 13:32 schreef Roelof Wobben:
>> Yes, I added it by using localhost:8080/config and then choose for the application.
>>
>> In the tutorial Im following that was the way the application is registered and the library.
>>
>> So where should I add the code you are saying to use.
>>
>> Here is the code I have so far: https://github.com/RoelofWobben/paintings
>>
>> Roelof
>>
>>
>>
>>
>> Op 4-1-2020 om 12:58 schreef Sven Van Caekenberghe:
>>> Did you add your library to your application ?
>>>
>>>     | app |
>>>     app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
>>>     app addLibrary: YourLibrary;
>>>
>>>> On 4 Jan 2020, at 11:58, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>>>>
>>>>
>>>> From: Roelof Wobben <[hidden email]>
>>>> Subject: Re: [Pharo-users] why is my css not found in a seaside project
>>>> Date: 4 January 2020 at 11:58:46 GMT+1
>>>> To: Any question about pharo is welcome <[hidden email]>
>>>>
>>>>
>>>> Yes. it is callled
>>>>
>>>> Roelof
>>>>
>>>>
>>>> Op 4-1-2020 om 11:48 schreef Sven Van Caekenberghe:
>>>>> Try putting a breakpoint inside the #updateRoot: of your library class. Is it even called ?
>>>>>
>>>>>> On 4 Jan 2020, at 11:17, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>>>>>>
>>>>>>
>>>>>> From: Roelof Wobben <[hidden email]>
>>>>>> Subject: why is my css not found in a seaside project
>>>>>> Date: 4 January 2020 at 11:17:13 GMT+1
>>>>>> To: Any question about pharo is welcome <[hidden email]>
>>>>>>
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I have this in my library class on the instance side :
>>>>>>   updateRoot: anHtmlRoot
>>>>>>      super updateRoot: anHtmlRoot.
>>>>>>      anHtmlRoot stylesheet url: self class / #mainCss.
>>>>>>      anHtmlRoot javascript url: self class / #mainJs
>>>>>>
>>>>>> and a file mainCss on the instance side filled with css
>>>>>> and still the css is not found
>>>>>>
>>>>>> anyone idea why ?
>>>>>>
>>>>>> if needed I can put my whole code on github.
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Roelof
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>>
>>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Pharo Smalltalk Users mailing list
Op 4-1-2020 om 22:48 schreef Sven Van Caekenberghe:
> | app |
>      app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
>      app addLibrary: YourLibrary;


Oke, so like I did in my last commit here :
https://github.com/RoelofWobben/paintings

but still I do not understand why the css is not used.

Roelof


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Sven Van Caekenberghe-2
In reply to this post by Sven Van Caekenberghe-2
You might want to read the following article:

  https://medium.com/concerning-pharo/reddit-st-in-10-cool-pharo-classes-1b5327ca0740

sections 7 & 8 are about the Seaside app, but it is simple enough to read completely.

It is a bit old, but as far as I know, it should still work, especially the part that you have trouble with (the CSS/WAComponent interaction). Maybe this helps a bit.

BTW, you can also add a #style method to any component returning a string with CSS.

> On 4 Jan 2020, at 23:16, Roelof Wobben <[hidden email]> wrote:
>
> Op 4-1-2020 om 22:48 schreef Sven Van Caekenberghe:
>> | app |
>>     app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
>>     app addLibrary: YourLibrary;
>
>
> Oke, so like I did in my last commit here : https://github.com/RoelofWobben/paintings
>
> but still I do not understand why the css is not used.
>
> Roelof
>


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Richard Sargent
Administrator
In reply to this post by Pharo Smalltalk Users mailing list
On Sat, Jan 4, 2020 at 2:17 AM Roelof Wobben via Pharo-users <[hidden email]> wrote:
Hello,

I have this in my library class on the instance side :
 
updateRoot: anHtmlRoot
    super updateRoot: anHtmlRoot.
    anHtmlRoot stylesheet url: self class / #mainCss.
    anHtmlRoot javascript url: self class / #mainJs
and a file mainCss on the instance side filled with css
and still the css is not found

I'm not familiar with Seaside programming and especially not CSS. However, I have to wonder whether "url: self class / #mainCss" makes it look for a class method rather than an instance method.


anyone idea why ?

if needed I can put my whole code on github.


Regards,

Roelof

Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Pharo Smalltalk Users mailing list
In reply to this post by Sven Van Caekenberghe-2
Oke

if I understand that article  I have to put this :

initialize
  (WAAdmin register: self asApplicationAt: 'reddit')
    preferenceAt: #sessionClass put: RedditSession;
    addLibrary: RedditFileLibrary 

in the class side of the library and not at the class side of the class that descrives the thing I want
to display.

Roelof




Op 4-1-2020 om 23:44 schreef Sven Van Caekenberghe:
You might want to read the following article:

  https://medium.com/concerning-pharo/reddit-st-in-10-cool-pharo-classes-1b5327ca0740

sections 7 & 8 are about the Seaside app, but it is simple enough to read completely.

It is a bit old, but as far as I know, it should still work, especially the part that you have trouble with (the CSS/WAComponent interaction). Maybe this helps a bit.

BTW, you can also add a #style method to any component returning a string with CSS.

On 4 Jan 2020, at 23:16, Roelof Wobben [hidden email] wrote:

Op 4-1-2020 om 22:48 schreef Sven Van Caekenberghe:
| app |
    app := WAAdmin register: YourWAComponent asApplicationAt: 'my-app'.
    app addLibrary: YourLibrary;

Oke, so like I did in my last commit here : https://github.com/RoelofWobben/paintings

but still I do not understand why the css is not used.

Roelof



Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Pharo Smalltalk Users mailing list
Op 5-1-2020 om 11:36 schreef Roelof Wobben via Pharo-users:

hmm,

It looks like I had to do it like this :
https://github.com/RoelofWobben/paintings
for registering the project but I see then that the rootcomponent is not
changed and that still the css is not found or used.


So please help.

Roelof


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Pharo Smalltalk Users mailing list
In reply to this post by Pharo Smalltalk Users mailing list
I think I found the answer myself

when I put this in the RootComponent

updateRoot: anHtmlRoot
     super updateRoot: anHtmlRoot.
     anHtmlRoot stylesheet url: (PaintingLibrary  urlOf: #mainCss)

and this on the class side of the RootComponent


initialize
     | app |
     app := WAAdmin
         register: #stRootComponent
         asApplicationAt: 'Paintings2'.
     app addLibrary: PaintingLibrary


then I see some css. The page looks not what I expect but that can be
changed.

So does the code I have now on my github page well or do I use the
components still the wrong way ?

Roelof



Op 5-1-2020 om 12:48 schreef Roelof Wobben:

> Op 5-1-2020 om 11:36 schreef Roelof Wobben via Pharo-users:
>
> hmm,
>
> It looks like I had to do it like this :
> https://github.com/RoelofWobben/paintings
> for registering the project but I see then that the rootcomponent is
> not changed and that still the css is not found or used.
>
>
> So please help.
>
> Roelof
>


Reply | Threaded
Open this post in threaded view
|

Re: why is my css not found in a seaside project

Sven Van Caekenberghe-2


> On 5 Jan 2020, at 14:46, Roelof Wobben via Pharo-users <[hidden email]> wrote:
>
>
> From: Roelof Wobben <[hidden email]>
> Subject: Re: [Pharo-users] why is my css not found in a seaside project
> Date: 5 January 2020 at 14:46:24 GMT+1
> To: [hidden email]
>
>
> I think I found the answer myself
>
> when I put this in the RootComponent
>
> updateRoot: anHtmlRoot
>     super updateRoot: anHtmlRoot.
>     anHtmlRoot stylesheet url: (PaintingLibrary  urlOf: #mainCss)
>
> and this on the class side of the RootComponent
>
>
> initialize
>     | app |
>     app := WAAdmin
>         register: #stRootComponent
>         asApplicationAt: 'Paintings2'.
>     app addLibrary: PaintingLibrary
>
>
> then I see some css. The page looks not what I expect but that can be changed.
>
> So does the code I have now on my github page well or do I use the components still the wrong way ?

What you write above is correct, it is what I meant.

Good that you figured it out !

> Roelof
>
>
>
> Op 5-1-2020 om 12:48 schreef Roelof Wobben:
>> Op 5-1-2020 om 11:36 schreef Roelof Wobben via Pharo-users:
>>
>> hmm,
>>
>> It looks like I had to do it like this : https://github.com/RoelofWobben/paintings
>> for registering the project but I see then that the rootcomponent is not changed and that still the css is not found or used.
>>
>>
>> So please help.
>>
>> Roelof
>>
>
>
>
>