[Seaside] Problem with anchors (Canvas API) generating bad links

Wilkes Joiner wilkesjoiner at gmail.com
Mon Mar 13 20:49:47 UTC 2006


You just need to reverse sending callback: and text:.  Using the
Canvas API, text: and with: need to come last.  There was a post
earlier today the same sort of thing.

Change:
html anchor text: 'About'; callback: [ self parent home ]

To:
html anchor callback: [ self parent home ]; text: 'About'

- Wilkes

On 3/13/06, Rick Flower <rickf at ca-flower.com> wrote:
> Hi all.. Every time I think I'm taking one step forward, I get stuck.
> The other day I found that my web links
> are no longer working for some reason after I had to regenerate my
> image.. For some reason, when the
> HTML is generated, they refer to links such as
> "http://localhost:8008/seaside/go/nil" which cause browser
> not found errors such as "Error: "/seaside/go/nil" not found...
> Unfortunately, when they were working, I
> didn't bother paying any attention to what they did point to -- I'm
> assuming some sort of internal link that
> Seaside generated.. For these links, they don't really need to point to
> any pages per-se, but are only used
> for their callbacks mechanism.
>
> Below is my current code -- keep in mind that my "self parent home" is a
> place holder until I plug in the functionality
> I want to those items.  I suspect I'm doing something wrong and perhaps
> another set of eyes can show me what
> goof up I did this time..   Many thanks in advance as usual!
>
> MSMenuArea>>renderContentOn: html
>         html unorderedList with: [
>             html listItem with: [ html anchor text: 'Home';
>         callback: [ self parent home ] ].
>             self session loggedIn ifFalse: [
>                 html listItem with: [ html anchor text: 'About';
> callback: [ self parent home ] ].
>                 html listItem with: [ html anchor text: 'Enroll';
>             callback: [ self parent home ] ].
>                 html listItem with: [ html anchor text: 'Contact Us';
>             callback: [ self parent home ] ].
>             ]
>             ifTrue: [
>                 html listItem with: [ html anchor text: 'Update Contact
> Info';     callback: [ self parent home ] ].
>                 html listItem with: [ html anchor text: 'My Orders';
>         callback: [ self parent home ] ].
>                 html listItem with: [ html anchor text: 'My Reports';
>             callback: [ self parent home ] ].
>                 html listItem with: [ html anchor text: 'Logout';
>             callback: [ self parent home ] ].
>             ]
>         ].
>
> The above code is called in turn by the first line in the "ifFalse"
> block where "menuArea" is rendered :
>
> MyWebApp>>renderContentOn: html
>    html div id: 'container'; with: [
>       html div id: 'header'.
>         self session loggedIn
>                 ifFalse: [
>                         html div id:'mainnav'; with: [html render:
> menuArea].
>                         html div style: 'height: 300px'; with: [
>                             html div id: 'loginLeftBox'; with: [html
> render: loginArea].
>                             html div id: 'loginRightBox';  with: [html
> render: MOTDarea].
>                        ]
>                 ]
>                 ifTrue: [
>                         html div id: 'mainnav'; with: [html render:
> menuArea].
>                         html div style: 'margin-bottom: 10px;
> background-color: #eee'; id: 'contents'; with: [html render: mainPage].
>                 ].
>         ].
> .
> .
> .
>
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the Seaside mailing list