Hi Amine,
> In the RestfulUrl tutorial, we learned that we can initialize a component using the URL and t...@presentation.init_for. decorator.
>
> In my application, I need to initialize a component if the URL is not defined, So I used the function @presentation.init_for(App, 'not url') in order to handle request without URL, but it doesn't work!
>
> In the attachment file, I defined an application App composed of a menu and a content, when the user clicks an item in the menu, it will be rendered in the content block. My aim is to display the first item if the user doesn't specify its name in the URL.
> (I know that I can init the first menu in the __init__ function of the App, but I need to set it in the @presentation.init_for function)
Yet this is exactly what we do. For an empty URL, the App component is initialized
by its ‘__init__()’ method. Normal behavior.
In your example that means simply adding line #9:
self.selectMenu(self.menuItems[0])
> Can you help me?
Why in your case aren’t you able to that? Why to you abolutely need to initialized
it in a @presentation.init_for function?
Best regards,
Alain