dev@jsftemplating.java.net

Re: JSFTemplating: Question about drop downs with jsftemplating

From: Karam Singh Badesha <Karam.Badesha_at_Sun.COM>
Date: Mon, 22 Jan 2007 15:59:02 -0800

Ok, I can get it using from javascript using:

document.form1.lavaReleaseMenu.options[document.form1.lavaReleaseMenu.selectedIndex].value

But how do I really specify this in a value attribute to create a
pageSession variable out of this?

<sun:staticText value="#{pageSession.lavaRelease}" >
                <!beforeEncode
                setPageSessionAttribute(key="lavaRelease" value="?");
                />

thanks
Karam

Karam Singh Badesha wrote:
> Hi,
> Here is the scenario:
> In my page, I get the values for my dropdowns using the beforeCreate:
>
> <!beforeCreate
> getReleases(lavaReleases=>$attribute{lavaReleasesList});
> getBuilds(lavaBuilds=>$attribute{lavaBuildsList});
> getProjects(lavaProjects=>$attribute{lavaProjectsList});
> />
>
> Now at some where on the page I show these dropdowns and I have the
> following to fill the dropDowns:
>
> <sun:dropDown id="lavaReleaseMenu"
> toolTip="#{msgs.chooseLavaRelease}"
> labels="$attribute{lavaReleasesList}"
> />
>
> Now I would like to show the selected items in those dropDowns at
> another part of the page. How would I get the selected value at render
> time so that I can also show it at the later point on the same page? I
> vaguely remember that in javascript you could get it by doing
> something like form1.lavaReleaseMenu. How can I take care of this
> situation?
>
> thanks
> Karam