Re: Anonymous Component

"Esteban A. Maringolo" <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <CAJMgPCK=6rKGR+VKE8gJi-xrnT321iykZb_mOpOX8vPwc0GBCA@mail.gmail.com>
2016-01-19 15:11 GMT-03:00 J.F. Rick <[email protected]>:
> I'm using AJAX a decent amount with my Seaside application. One common thing
> is to replace an IDed element with a component using something like:
>     s << (s jQuery: #event) replaceWith: self.
> inside a "html jQuery ajax script: [ :s | ]" block.
>
> Is there a way to do this replacement without using a component that
> implements the renderContentOn: message? For instance, what could I just do
> to replace the #event component with this HTML: '<b>Success</b>'? I'm hoping
> there's something I can do along the lines of:
>     s << (s jQuery: #event) replaceWith: [ :html |
>         html html: '<b>'.
>         html text: (self isSuccess
>             ifTrue: [ 'Success' ]
>             ifFalse: [ 'Failed' ]).
>         html html: '</b>' ].

Unless you do some server-side component instantiation or instVar
assigment, then what you get to the block is just an WAHtmlCanvas (the
html var), it doesn't matter what/how you render on it.

So that should work out of the box.


Esteban A. Maringolo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.