« Return to Thread: preferredUrl usage

Re: preferedUrl usage

by Janko Mivsek :: Rate this Message:

Reply to Author | View in Thread

Hi Leon,welcome to the mailing list!

About preferedUrl usage: this method is called only once per domain
object, when its Url is registered into an URLResolver. If  #preferedUrl
was changed later (or object was already registered with automatic Url
before prefered method was created), then you need to re-register it,
for example:

     (AIDASite named: 'aidademo')
        urlResolver changeToPreferedURL: myDomainObject

Also note that we are using *one r*, not two in preferedUrl! This also
can be a reason for your troubles.

So, try to do above for your ContestSite first to see if it works.

Best regards
Janko

Leon Smith wrote:

> I have only been using AIDA for two days so please forgive me if this a
> really stupid question. I have a simple site working following the tutorial,
> but using different domain objects; ContestSite and Contests. Both have App
> objects with view methods. The ContestSite lists contests in a tabular
> format with links to the underlying Contest object.
>
> I am trying to use preferredUrl to create nice links like this:
>
> preferedUrl
> | aTitle |
> aTitle := self title trimBlanks.
> aTitle := aTitle copyReplaceAll: ' ' with: '-'.
>
>         ^'/contest/',  aTitle, '.html'
>
> My problem is that my method seems to never get sent. I have stopped and
> restarted the server, removed and re-added the site, put halts in the method
> and tried implementing the method on both the App and the model object, but
> nothing works. Am I supposed to send this message explicitly in
> ContestSite's viewMain ?
>
> Thanks in advance for any help.

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida

 « Return to Thread: preferredUrl usage

LightInTheBox - Buy quality products at wholesale price