Ciao,
thanks Yanni.
On 04/01/13 9:03 AM, dtrussardi(a)tiscali.it wrote:
In my image i have a deprecated PRMenuWidget it can use for solve this problematic ?
I didn't know PRMenuWidget was still included. Try using PRMenuWidget instead of what
I said about looking at PRViewsWidget for code inspiration.
Have a look at PRMenuWidget class>>defaultDocument
I think the code you need is something like:
menuPage
| document widget |
document := PRDocumentParser parse:
'- *Home>/*
- *Chi siamo>/chisiamo*
- *Missione>/missione*
- *Catalogo>/catalogo*
- *Offerte>/offerte*
- *Ordini>/menuonline*
- *Blog>/blog*
- *Riferimenti>/riferimenti*'.
widget = PRMenuWidget new.
widget write: document using: widget descriptionDocument.
^ menuWidget ifNil:
[ menuWidget := (PRPage named: 'menu')
addChild: ((PRComponent named: 'widgetmenu')
prototypeInstance: widget;
yourself);
contents: '+widgetmenu+'
]
I followed your indications and the statements work.
The PRMenuWidget define :
renderContentOn: html
| visitor |
visitor := PRMostSpecificInternalLinkVisitor new
visit: self document.
PRMenuRenderer new
target: visitor target;
continue: self document
in: self on: html
But the menu anchor don't manage the _k parameter.
I don't understund how the widgets works but in this my case
the PRContext
urlOn: aRenderer
"Answer a Seaside URL to get into the receiving context."
| url |
^ aRenderer callbacks isNil
ifTrue: [ self url ]
ifFalse: [
url := aRenderer context actionUrl copy.
url purgeOtherFields; adaptToContext: self.
**** (self command isRestful and: [ self application hasCookieInContext: self
requestContext ])
ifTrue: [ url purgeSeasideFields ]
ifFalse: [
url queryFields
at: '_n' put: nil;
at: (aRenderer callbacks store: self activationCallback) put: nil ].
url ]
reference in any case the command ( see *** )
Now the PRViewCommand
isRestful
^ self viewComponentClass isRestful
and it answer the PRDefaultView isRestful -> ^true
So the problem remains.
I wonder if in any case the widget is managed as a PRViewCommand
or if they exist precisely to avoid such management.
Some considerations about it and my menu management problem?
Ciao, thanks,
Dario