This content has been marked as final.
Show 6 replies
-
1. Re: selectOneMenu with security-constraint
nbelaevski Feb 4, 2009 5:13 PM (in response to rogerioag)Hi,
Can you please paste page and bean code here? -
2. Re: selectOneMenu with security-constraint
rogerioag Feb 5, 2009 6:20 AM (in response to rogerioag)* JSF page
<%@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/tomahawk" prefix="t"%> <%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <%@taglib uri="http://richfaces.org/rich" prefix="rich"%> <f:view> <%@include file="abrePagina.jspf"%> <%@include file="menuLateral.jspf"%> <%@include file="camadaCentral.jspf"%> <a4j:form id="form1" focus="marca"> <h:panelGrid columns="3"> <f:facet name="header"> <h:outputText value="Informe os dados do novo veÃÂculo:" styleClass="tituloFormulario"/> </f:facet> <f:verbatim><br></f:verbatim> <f:verbatim><br></f:verbatim> <f:verbatim><br></f:verbatim> <h:outputText value="Marca do veÃÂculo:" style="font=12px"/> <h:selectOneMenu id="marca" valueChangeListener="#{afcMB.selecionarMarca}" styleClass="listbox" validator="#{afcMB.validaMarca}"> <f:selectItems value="#{afcMB.marcas}"/> <a4j:support event="onchange" reRender="tipo" focus="tipo"/> </h:selectOneMenu> <h:message for="marca" styleClass="mensagemErro"/> <h:outputText value="Tipo do veÃÂculo:" style="font=12px"/> <h:selectOneMenu id="tipo" valueChangeListener="#{afcMB.selecionarTipoVeiculo}" styleClass="listbox" validator="#{afcMB.validaTipo}"> <f:selectItems value="#{afcMB.tiposPorMarca}"/> <a4j:support event="onchange" reRender="veiculo" focus="veiculo"/> </h:selectOneMenu> <h:message for="tipo" styleClass="mensagemErro"/> <h:outputText value="Placa do veÃÂculo:" style="font=12px"/> <h:inputText id="veiculo" required="true" value="" size="40" styleClass="listbox"/> <h:inputHidden/> <h:panelGrid style="align:center"> <h:commandButton id="inserirVeiculo" value="OK" action="#{afcMB.inserirVeiculo}"/> </h:panelGrid> <h:inputHidden/> </h:panelGrid> </a4j:form> </f:view> <%@include file="fechaPagina.jspf"%>
P.S.: The code of the pages included through <%@ include file =...%> operate normally in other pages with access control, and should not affect this code.
* AfcMB.java (managed bean)
.
.public void selecionarMarca(ValueChangeEvent evento){ try{ //cria a primeira opção para a caixa de seleção tiposPorMarca.clear(); tiposPorMarca.add(new SelectItem(" -- selecione o tipo --")); for(TipoVeiculo t : tipoVeiculoFacade.getTiposVeiculos(evento.getNewValue().toString())){ tiposPorMarca.add(new SelectItem(t.getDescricao())); } } catch (PropertiesFileException e) { exibeMensagem(e.getMessage()); e.printStackTrace(); } } . . . public List<SelectItem> getMarcas(){ List<SelectItem> itens = new ArrayList<SelectItem>(); try{ //cria a opção em branco para marcas itens.add(new SelectItem("-- selecione a marca --")); for(Marca marca : marcaFacade.getMarcas()){ itens.add(new SelectItem(marca.getDescricao())); } return itens; } catch (PropertiesFileException e) { exibeMensagem(e.getMessage()); e.printStackTrace(); return null; } } . . . public void selecionarTipoVeiculo(ValueChangeEvent evento){ try{ //cria a primeira opção para a caixa de seleção veiculosPorTipo.clear(); veiculosPorTipo.add(new SelectItem("-- selecione a placa --")); if(!evento.getNewValue().toString().equals(" -- selecione o tipo --")){ for(Veiculo v : veiculoFacade.getVeiculos(evento.getNewValue().toString())){ veiculosPorTipo.add(new SelectItem(v.getPlaca())); } } } catch (PropertiesFileException e) { exibeMensagem(e.getMessage()); e.printStackTrace(); } } public List<SelectItem> getTiposPorMarca(){ return this.tiposPorMarca; } . . .
Using IE7, this page calls the request login/password and returns. When selecting an item in the first selectOneMenu, the second is completed.
Now with Firefox, to request the page it is displayed directly. When selecting an item in the first selectOneMenu is that the screen displays the login/password and not back it. Return to a blank screen with the HTML Select component filled with the items of the second selectOneMenu. -
3. Re: selectOneMenu with security-constraint
adubovsky Feb 5, 2009 10:23 AM (in response to rogerioag)Hi rogerioag
We have verified usage security for provided page and seems like all works fine on our side.
Our environment:
myfaces 1.2.5
jsp
richfaces 3.3.1.snapshot
java 1.5_12
Could you please to send us the simplest war file with described problem. -
4. Re: selectOneMenu with security-constraint
rogerioag Feb 5, 2009 1:19 PM (in response to rogerioag)Sorry, how can I send you the war file (I'm a beginner, never send files through the forum)?
-
5. Re: selectOneMenu with security-constraint
adubovsky Feb 6, 2009 3:15 AM (in response to rogerioag)You could send me war on my email directly: mailto:adubovsky@exadel.com
-
6. Re: selectOneMenu with security-constraint
adubovsky Feb 9, 2009 5:45 AM (in response to rogerioag)Issue was opened. You could comment it on https://jira.jboss.org/jira/browse/RF-6129
Behaviout on our environment some different from you described (in FF the same, but in IE7 ajax request is not triggered at all).