Boa tarde…
Estou tentando fazer um rich:comboBox atualizar outro rich:comboBox devido cada valor, ou seja, um combo estado dependendo o estado selecionado o combo cidade atualiza seus valores.
Até agora só consegui fazer mas com botão, ou seja, só atualiza se a pessoa pressionar o botão.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<html>
<head>
<title>RichFaces Greeter</title>
</head>
<body>
<f:view>
<h:form>
<rich:comboBox value="#{beanItens.opcPais}">
<f:selectItems value="#{beanItens.itensPaises}"/>
</rich:comboBox>
<a4j:commandButton value="update" reRender="comboCidade"/>
<rich:comboBox value="#{beanItens.opcCidade}" id="comboCidade">
<f:selectItems value="#{beanItens.itensCidades}"/>
</rich:comboBox>
</h:form>
</f:view>
</body>
</html>
tentei adicionar a linha no primeiro combo:
<a4j:support event="onchange" action="#{beanItens.atualizaComboCidade}" reRender="comboCidade"/>
Porém gera uma excessão:
[color=red]Exception while calling encodeEnd on component : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /echo.jsp][Class: javax.faces.component.html.HtmlForm,Id: j_id_jsp_443181147_1][Class: org.richfaces.component.html.HtmlComboBox,Id: comboCidade]}
Caused by:
java.lang.IllegalArgumentException - Value of tag attribute is incorrect. [/color]
Se alguém tiver uma ideia, ou exemplo agradeço!