myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Heffelfinger" <>
Subject [Trinidad] <tr:selectOneChoice> and autoSubmit
Date Sat, 17 Nov 2007 21:19:26 GMT

Before describing my problem, I need to disclose that I am new to Trinidad,
therefore it is entirely possible I am missing something obvious.

I am using Trinidad 1.2.3, deploying on GlassFish 2.

I am trying to update the options in one <tr:selectOneOption> when the value
of another <tr:selectOneOption> changes. Based on what I read at, this should
be fairly simple:
set autoSubmit="true" on the first <tr:selectOneOption>, bind its
valueChangeListener property to a method to be executed when the value of
the component changes, and set the partialTriggers property of the second
<tr:selectOneOption> to the id of the first one.

I attempted this procedure to no avail, I don't think the first
<tr:selectOneOption> is triggering a partial submit at all. I Googled around
and found some example code in the archives for this list:

The code shown in this message was very similar to what I had, but since
mine wasn't working and this one allegedly was, I pretty much copied and
pasted both the JSP and the backing bean code, but unfortunately it still
didn't work.

The two <tr:selectOneChoice> tags look like this:

<tr:selectOneChoice label="Select one:"
                              requiredMessageDetail="You must select one"
                              unselectedLabel="Select one..."
            <f:selectItems value="#{testBean.firstList}" id="selectItems1"

          <tr:selectOneChoice  id="selectOneChoice2"
                               unselectedLabel="Select another one..."
            <f:selectItems value="#{testBean.secondList}" id="selectItems2"

The selectionChange() method on the backing bean looks like this:

public void selectionChange(ValueChangeEvent event)
    String value = (String) event.getNewValue();
    if (value.equals("a"))
      secondList = Arrays.asList(new SelectItem("apple"));
    else if (value.equals("b"))
      secondList = Arrays.asList(new SelectItem("blue"));

FWIW, the backing bean has a scope of session.

Any idea of what I am doing wrong?

Thanks in advance for any help,
-- - A Guide to Java, Linux and Other Technology Topics - Java EE 5 Development Using
GlassFish Application Server - JasperReports For Java Developers

View raw message