[Seaside] Anonymous Component
J.F. Rick
self at je77.com
Thu Jan 21 21:07:34 UTC 2016
Too funny that I guessed something that would actually work. Awesome,
Jeff
On Wed, Jan 20, 2016 at 5:40 PM Johan Brichau <johan at inceptive.be> wrote:
> Jeff,
>
> As others have mentioned, this should work as you wrote it.
> The argument to replaceWith: is any renderable. This can be component but
> also a rendering block ( [:html | …. ] )
>
> Just one thing:
>
> It’s better style to write:
>
> (html tag: ‘b’) with: [ …. ] instead of html html: ‘<b>’
>
> cheers
> Johan
>
> > On 19 Jan 2016, at 19:11, J.F. Rick <self at je77.com> wrote:
> >
> > 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>' ].
> >
> > Thanks,
> >
> > Jeff
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20160121/f9be2149/attachment-0001.htm
More information about the seaside
mailing list