Hi Geert,
Thanks for the great answer. :)
I have an additional question to the second option(input, output,
datalink).
My embedded element 'MAINMENU' includes a link that set the output
'mainMenuSelection':
template.setValue("subsite_url", getExitQueryUrl("import",
new String[]{"mainMenuSelection", "import"}));
The element 'MAINMENU' has the following definition:
<element id="MAINMENU" file="elements/termmanagement/mainMenu.xml"
inherits=".IDENTIFIED">
<flowlink srcexit="import" destid="IMPORT"/>
<datalink srcoutput="mainMenuSelection" destid="IMPORT"
destinput="mainMenuSelection"/>
</element>
Content of mainMenu.xml:
<element
implementation="com.acrolinx.portal.termmanagement.elements.MainMenu">
<input name="mainMenuSelection"/>
<output name="mainMenuSelection"/>
<exit name="import"/>
</element>
The element 'IMPORT' gets the value 'import' of the input
'mainMenuSelection'.
The element 'MAINMENU' is embedded in the template of the 'IMPORT'
element.
So the 'MAINMENU' element is processed again and it has an input
'mainMenuSelection'.
But the value of the input 'mainMenuSelection' is null for the element
'MAINMENU'.
What must I change, or did I missunderstand you a little bit?
Cheers,
Lars
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin
> Sent: 16 December 2005 22:34
> To: RIFE users list : questions, bug reports and suggestions.
> Subject: Re: [Rife-users] menu as embedded element
>
>
> Hi Lars,
>
> you have several options, all depend on your preference:
>
> * Use a globalvar that indicates the selected menu, this will be
> present in every element and thus also your menu.
>
> * You have to be aware of the fact that a datalink is only
> responsible for bringing the data from an output to the target
> element, it doesn't tie the input of the destination element to that
> particular datalink. This means that as long as a value with
> the same
> name as your input is present when your embedded element is
> processed, the embedded element will get it too.
>
> * You can use embed values. When an embedded element is
> processed, it
> will receive the current content of its value tag and use that to
> adapt to the context in which it sits. So using <!--V 'ELEMENT:.ID'--
> >menuitem1<!--/V--> will provide "menuitem1" when you call
> getEmbedValue() from within the embedded element. You can
> also use BV
> tags and template hierarchies to override this value.
>
> * You can use request attributes. By using getRequestAttribute and
> setRequestAttribute, you can freely interchange data in between
> elements in the same request. Nothing will live longer than the
> request and it doesn't interact with state storage.
>
> * You can implement a well defined API with your embedding elements
> and use getEmbeddingElement() to access a method that will for
> instance provide the current menu item.
>
> * You can access the embedding element's template with
> getEmbeddingTemplate and by simply deciding upon a variable
> name, you
> can easily retrieve it from your embedding element.
>
> That's about it I think.
>
> Best regards,
>
> Geert
>
> On 14 Dec 2005, at 18:45, Lars Grupe wrote:
>
> > Hi,
> >
> > Maybe I want to solve to many things with embedded elements.
> >
> > I use an embedded element for my main menu. That's fine as
> long as I
> > didn't want to highlight the menu item that was selected actually.
> >
> > I could define an output value that contains the selected menu item.
> >
> > E.g.:
> > template.setValue("subsite_url", getExitQueryUrl("home",
> > new String[]{"mainMenuSelection", "home"}));
> >
> > But how can the embedded element get the input value,
> because there is
> > no flowlink that directs the output to the input of the embedded
> > element?
> >
> > Is there another way to have an element (embedded or not)
> only for a
> > menu? Or should I call a function for filling the menu block in the
> > code of each element that should display the menu?
> >
> > Cheers,
> > Lars
> > _______________________________________________
> > Rife-users mailing list
> > [email protected] http://www.uwyn.com/mailman/listinfo/rife-users
> >
>
> --
> Geert Bevin Uwyn bvba
> "Use what you need" Avenue de Scailmont 34
> http://www.uwyn.com 7170 Manage
> gbevin[remove] at uwyn dot com Tel +32 64 84 80 03
>
> PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D
> 309F D6A9 Public PGP key : available at servers pgp.mit.edu,
> wwwkeys.pgp.net
>
>
>
> _______________________________________________
> Rife-users mailing list
> [email protected] http://www.uwyn.com/mailman/listinfo/rife-users
>
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users