Patch for WAApplicationEditor>>renderLibrariesOn:

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

Patch for WAApplicationEditor>>renderLibrariesOn:

Sebastian Sastre-2
Hi there,
 
    it's me again talking about libraries :)
 
    I saw the feature I was asking for already implemented with a minor bug which I patched with this method:
 
renderLibrariesOn: html
 html heading level2 with: 'Libraries'.
 self libraryOptions isEmpty ifFalse: [
  html text: 'Add Library: '.
  html select
   list: self libraryOptions;
   selected: nil;
   callback: [ :value | library := value ].
  html space.
  html submitButton
   callback: [ self addLibrary ];
   text: 'Add' ].
 html unorderedList: [
  application libraries do: [ :each |
   html listItem: [
    html text: each.
    html space.
    html anchor
     callback: [ application removeLibrary: each ];
     with: '(remove)' ] ] ].
 html submitButton
  text: 'write to disk';
  title: 'writes all the libraries to disk';
  callback: [ application writeLibrariesToDisk ]
 
The change is very subtle. In the last line #application instvar is used instead of calling it with "self application". That change was making that only the config application libraries where writed to disk instead of the application being configured.
 
    cheers,
 

Sebastian Sastre

 

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Patch for WAApplicationEditor>>renderLibrariesOn:

Conrad Taylor
Hi, is there a associated unit test for this functionality?

Thanks,

-Conrad

On 8/22/07, Sebastian Sastre <[hidden email]> wrote:
Hi there,
 
    it's me again talking about libraries :)
 
    I saw the feature I was asking for already implemented with a minor bug which I patched with this method:
 
renderLibrariesOn: html
 html heading level2 with: 'Libraries'.
 self libraryOptions isEmpty ifFalse: [
  html text: 'Add Library: '.
  html select
   list: self libraryOptions;
   selected: nil;
   callback: [ :value | library := value ].
  html space.
  html submitButton
   callback: [ self addLibrary ];
   text: 'Add' ].
 html unorderedList: [
  application libraries do: [ :each |
   html listItem: [
    html text: each.
    html space.
    html anchor
     callback: [ application removeLibrary: each ];
     with: '(remove)' ] ] ].
 html submitButton
  text: 'write to disk';
  title: 'writes all the libraries to disk';
  callback: [ application writeLibrariesToDisk ]
 
The change is very subtle. In the last line #application instvar is used instead of calling it with "self application". That change was making that only the config application libraries where writed to disk instead of the application being configured.
 
    cheers,
 

Sebastian Sastre

 

_______________________________________________
Seaside mailing list
[hidden email] [hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank"> http://lists.squeakfoundation<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">.org/cgi-bin/mailman/listinfo/seaside


 

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Patch for WAApplicationEditor>>renderLibrariesOn:

Philippe Marschall
In reply to this post by Sebastian Sastre-2
2007/8/23, Sebastian Sastre <[hidden email]>:

>
>
> Hi there,
>
>     it's me again talking about libraries :)
>
>     I saw the feature I was asking for already implemented with a minor bug
> which I patched with this method:
>
> renderLibrariesOn: html
>  html heading level2 with: 'Libraries'.
>  self libraryOptions isEmpty ifFalse: [
>   html text: 'Add Library: '.
>   html select
>    list: self libraryOptions;
>    selected: nil;
>    callback: [ :value | library := value ].
>   html space.
>   html submitButton
>    callback: [ self addLibrary ];
>    text: 'Add' ].
>  html unorderedList: [
>   application libraries do: [ :each |
>    html listItem: [
>     html text: each.
>     html space.
>     html anchor
>      callback: [ application removeLibrary: each ];
>      with: '(remove)' ] ] ].
>  html submitButton
>   text: 'write to disk';
>   title: 'writes all the libraries to disk';
>   callback: [ application writeLibrariesToDisk ]
>
> The change is very subtle. In the last line #application instvar is used
> instead of calling it with "self application". That change was making that
> only the config application libraries where writed to disk instead of the
> application being configured.

Done. Thanks again. It's kinda unfortunate that this instance variable
is named application and we can only have an accessor but no mutator.

Cheers
Philippe

>     cheers,
>
>
>
> Sebastian Sastre
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside