[Seaside] Re: Broken Seaside on SqueakMap
Nevin Pratt
nevin at smalltalkpro.com
Wed Jul 2 21:12:51 CEST 2003
Avi Bryant wrote:
>Ok - probably not how I would do things, but I can see the point (and the
>caching is interesting - introducing a more general component caching
>scheme may be useful at some point).
>
>However, I don't see where the problem of #call: not working comes in -
>can you show some example code for this?
>
>
>
As I mentioned, I rarely use #call:, or #inform:. But, here is an
abbreviated example of when I do use it:
One of the components is BBItem, for showing an item for sale. The
#renderContentOn: method of it looks like this:
*****
renderContentOn: html
" .. snipped some stuff .. "
html
form: [html bold: (item dollarFormatted: item salePrice) , '
' , item salesPack.
html space; space; space; space.
html
submitButtonWithAction: [self addToCart]
text: 'Add To Cart'].
*****
#addToCart is implemented thus:
*****
addToCart
| ses |
ses _ self session.
(ses shoppingCart addToCart: item)
ifFalse: [self inform: 'There is insufficient stock on
hand to add this item add this time. Please try again later!'].
ses topComponent viewcart.
*****
And, the shopping cart #addToCart: method answers true or false
depending on whether it actually added the item to the cart. Currently
the only reason why it won't add the item to the cart is if there is
insufficient stock on hand.
And actually, even the above example rarely invokes #inform:, because
the "...snipped some stuff.." code in #renderContentOn: keeps the submit
button from showing in most such cases.
Avi, don't spend too much of your valuable time on this. Give me a
chance to look deeper first. Besides, as I mentioned before, your newer
Seaside2.3b4.st snapshot might not have the problem. And also not to
mention that there's still a reasonable possibility that it is my code.
If I remember right, the last couple of times I wrote about Seaside
issues, they also turned out to be with my own code. And you've been
wonderful with your responsiveness.
--
Nevin Pratt
Bountiful Baby
http://www.bountifulbaby.com
(801) 992-3137
More information about the Seaside
mailing list