You are right, Jessica. There is no partialSubmit on SelectManyListBox,
so it should work AFAIK.
Could you check it out with later Trinidad versions (and use JSPX
instead of JSP)?
Regards,
Max Starets
Jessica Johnson wrote:
Hi Max,
Thanks for your response. According to the TLD, SelectManyListBox
doesn't have partialSubmit
http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_selectManyListbox.html
<http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_selectManyListbox.html>
and I get this exception when trying to use it
org.apache.jasper.JasperException: Attribute partialSubmit invalid
for tag selectManyListbox according to TLD
I am using autoSubmit, as suggested in this tutorial:
http://wiki.apache.org/myfaces/Partial-page_rendering but as I said
earlier, it is re-rendering the whole page. Other ideas?
jessica
On Nov 7, 2007 3:04 PM, Max Starets <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Jessica,
have you tried setting partialSubmit="true" on the listbox A?
Regards,
Max Starets
Jessica Johnson wrote:
> Hi all,
>
> I just started using Trinidad 1.0.1 and would like to use PPR so
that
> when a value is selected in a SelectManyListBox A, it re-renders
> SelectManyListBox B with some of the options disabled. The
problem is
> that whenever I select something is the first list box, the entire
> page is re-rendered. I am outputting a random number at the bottom
> of the page so I know that the entire page is being re-rendered. I
> assume that I am missing something simple, but for the life of me I
> can't figure out what. If someone could take a look at the code
below
> and let me know what is wrong, I would greatly appreciate it.
>
> Thanks in advance,
>
> jessica
>
>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri=" http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri=" http://myfaces.apache.org/trinidad/html"
prefix="trh" %>
> <%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr" %>
> <[EMAIL PROTECTED] errorPage="/exception_error.jsp"%>
>
>
> <f:view>
>
> <h:form id="filter_results_form">
>
> <tr:subform id="select_box_form" >
> <h:panelGrid columns="2" width="100%"
align="center">
>
>
> <tr:selectManyListbox id="selectA"
> size="4"
> autoSubmit="true"
>
> valueChangeListener="#{testLoader.aChanged}"
>
value="#{testLoader.AList }" >
> <tr:selectItem label="--- All As ---"
> value="-1" />
> <f:selectItems
value="#{testLoader.origAList}" />
> </tr:selectManyListbox>
>
> <tr:selectManyListbox
> id="selectB"
> size="4"
>
> valueChangeListener="#{testLoader.bChanged}"
> value="#{
testLoader.BList}"
>
> partialTriggers="filter_results_form:select_box_form:selectA" >
> <tr:selectItem label="--- All Bs ---"
> value="-1" />
> <f:selectItems
value="#{testLoader.origBList}" />
>
> </tr:selectManyListbox>
>
> <tr:outputText styleClass="message"
> value="Selected As: #{ testLoader.selectedAs}" />
> <tr:outputText styleClass="message"
> value="Selected Bs: #{testLoader.selectedBs}" />
>
> </h:panelGrid>
> </tr:subform>
>
> <tr:outputText styleClass="message" value="#{
testLoader.random}" />
>
> </h:form>
> </f:view>
>
>
> package com.imi.jsf.pageloaders ;
>
> import java.util.ArrayList;
> import java.util.List;
> import java.util.Random;
> import javax.faces.event.ValueChangeEvent;
> import javax.faces.model.SelectItem;
>
>
> public class TestLoader {
>
>
> public TestLoader() {
>
> origAList = new ArrayList();
> origAList.add(new SelectItem("853", "A1"));
> origAList.add(new SelectItem("862", "A2"));
>
> origBList = new ArrayList();
> origBList.add(new SelectItem("862,4748", "B1"));
>
> }
>
> private List aList;
> public List getAList() { return aList; }
> public void setAList(List aList) { this.aList = aList; }
>
> private List bList;
> public List getBList() { return bList; }
> public void setBList(List bList) { this.bList = bList; }
>
> private List origAList;
> public List getOrigAList() { return origAList; }
> public void setOrigAList(List origAList) { this.origAList =
> origAList; }
>
> private List origBList;
> public List getOrigBList() { return origBList; }
> public void setOrigBList(List origBList) { this.origBList =
> origBList; }
>
> public List getSelectedAs() { return selectedAs; }
> public List getSelectedBs() { return selectedBs; }
>
> private List selectedAs;
> public void aChanged(ValueChangeEvent vce) {
> selectedAs = (List) vce.getNewValue();
> aList = selectedAs;
> }
>
> private List selectedBs;
> public void bChanged(ValueChangeEvent vce) {
> selectedBs = (List) vce.getNewValue();
> bList = selectedBs;
> }
>
>
> private Random generator = new Random();
> public int getRandom() {
> return generator.nextInt();
> }
> }
>