This content has been marked as final.
Show 22 replies
-
15. Re: SuggestionBox
cibermon Mar 3, 2009 11:21 AM (in response to cibermon)Does anyone know the solution to this problem, if it is a bug, anyone knows how to publish it on the tour?
-
16. Re: SuggestionBox
cibermon Mar 3, 2009 11:22 AM (in response to cibermon)
I meant to publish it in the jira"cibermon" wrote:
Does anyone know the solution to this problem, if it is a bug, anyone knows how to publish it on the tour? -
17. Re: SuggestionBox
nbelaevski Mar 3, 2009 11:57 AM (in response to cibermon)Please post full page and beans code. I cannot reproduce the issue.
-
18. Re: SuggestionBox
cibermon Mar 3, 2009 12:03 PM (in response to cibermon)"nbelaevski" wrote:
Please post full page and beans code. I cannot reproduce the issue.
listado.jsp
<!doctype html public "-//w3c//dtd html 4.01 transitional//en">
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@include file="../cabecera0.html"%>
function abrirVentanaInspectores() {
window
.open(
'../buscadores/buscadorInspectores.jsp',
'BuscadorInspectores',
'toolbar=no,location=yes,resizable=yes,menubar=no,statusbar=no,scrollbars=yes,width=700,height=600,top=50,left=100');
}
function abrirVentanaCentros() {
window
.open(
'../buscadores/buscadorCentros.jsp',
'BuscadorCentros',
'toolbar=no,location=yes,resizable=yes,menubar=no,statusbar=no,scrollbars=yes,width=700,height=600,top=50,left=100');
}
<f:view>
<jsp:include page="../cabecera1.jsp" />
<t:div styleClass="formulario">
<t:htmlTag value="br"></t:htmlTag>
<t:htmlTag value="fieldset">
<t:htmlTag value="legend">
<h:outputText value="Buscador Inspector-Centro" />
</t:htmlTag>
<h:form id="buscaInsCen">
<h:panelGroup>
<h:panelGrid width="85%">
<t:messages showDetail="true" showSummary="false"
styleClass="Mensaje" errorClass="MensajeError" />
</h:panelGrid>
<h:panelGrid columns="4">
<h:outputLabel value="Inspector" />
<h:inputText id="idInspector" value="#{usuarioCentroBean.usuarioLogin}" size="15"
styleClass="CampoSuggestion TextoMayusculas" style="text-align:left">
<a4j:support event="onblur" action="#{usuarioCentroBean.ponerNombreInspector}" reRender="apnInspector"/>
</h:inputText>
<rich:suggestionbox id="idSugerenciasIns" suggestionAction="#{usuarioCentroBean.listaInspectores}"
var="inspector" tokens="," fetchValue="#{inspector.login}" width="350" height="200"
for="idInspector" shadowOpacity="9" nothingLabel="Inspector no encontrado.">
<h:column>
<h:outputText value="#{inspector.login}" style="font-style:bold"/>
</h:column>
<h:column>
<h:outputText value="#{inspector.apn}"/>
</h:column>
</rich:suggestionbox>
<h:inputText id="apnInspector" value="#{usuarioCentroBean.apnLogin}" size="50" disabled="true"/>
<h:outputLabel value="Centro"/>
<h:inputText id="idCentro" value="#{usuarioCentroBean.centro}" size="15"
styleClass="CampoSuggestion TextoMayusculas">
<a4j:support event="onblur" action="#{usuarioCentroBean.ponerNombreCentro}" reRender="dencenCentro"/>
</h:inputText>
<rich:suggestionbox id="idSugerenciasCen" suggestionAction="#{usuarioCentroBean.listaCentros}"
var="centro" tokens="," fetchValue="#{centro.codcen}" width="500" height="200"
for="idCentro" shadowOpacity="9" nothingLabel="Centro no encontrado.">
<h:column>
<h:outputText value="#{centro.codcen}" style="font-style:bold"/>
</h:column>
<h:column>
<h:outputText value="#{centro.dencen}"/>
</h:column>
<h:column>
<h:outputText value="#{centro.loccen}"/>
</h:column>
</rich:suggestionbox>
<h:inputText id="dencenCentro" value="#{usuarioCentroBean.nomCentro}" size="50" disabled="true"/>
</h:panelGrid>
<h:panelGrid columns="2" width="10%" align="right">
<h:commandButton value="Buscar"
action="#{usuarioCentroBean.buscarUsuario}" />
<h:commandButton value="Limpiar"
action="#{usuarioCentroBean.limpiar}" />
</h:panelGrid>
</h:panelGroup>
</h:form>
</t:htmlTag>
</t:div>
<t:div styleClass="formulario">
<t:htmlTag value="br"></t:htmlTag>
<t:htmlTag value="fieldset">
<t:htmlTag value="legend">
<h:outputText value="Inspectores Centros" />
</t:htmlTag>
<h:form id="listaUsuCentros">
<a4j:region>
<h:panelGroup id="panel">
<t:div>
<rich:datascroller id="myScrollerTop" align="center"
for="tablaUsuCentros" renderIfSinglePage="false"
maxPages="#{configuracionBean.paginasVisibles}"
binding="#{usuarioCentroBean.myScrollerTop}" />
<t:dataTable id="tablaUsuCentros"
value="#{usuarioCentroBean.accesoCentrosBuscados}"
var="acCenUsu" width="100%"
rows="#{configuracionBean.numeroRegistros}">
<t:column width="50%" defaultSorted="true" sortable="true">
<!-- el uso de visita.valor se debe a que es de tipo Seleccionable -->
<f:facet name="header">
<h:outputText value="Inspector" />
</f:facet>
<h:outputText value="#{acCenUsu.usuarios.apn}" />
</t:column>
<t:column width="50%" sortable="true">
<f:facet name="header">
<h:outputText value="Centro" />
</f:facet>
<h:outputText
value="#{acCenUsu.centro.codcen} - #{acCenUsu.centro.dencen}" />
</t:column>
<f:facet name="footer">
<rich:datascroller id="myScrollerDown" align="center"
for="tablaUsuCentros" renderIfSinglePage="false"
maxPages="#{configuracionBean.paginasVisibles}"
binding="#{usuarioCentroBean.myScrollerDown}"
reRender="myScrollerTop" />
</f:facet>
</t:dataTable>
</t:div>
</h:panelGroup>
</a4j:region>
</h:form>
</t:htmlTag>
</t:div>
</f:view>
UsuarioCentroBean.java
public List listaInspectores(Object begin){
String prefijo = (String) begin;
List resultado;
if (listaUsuarios == null) {
AccesoCentroServicio servAcceso = (AccesoCentroServicio) catalogoDeServicios.getServicio(ServicioGestion.SERVICIOACCESOCENTRO);
listaUsuarios = servAcceso.getUsuarios();
}
resultado = new ArrayList();
for(Iterator itUsuarios = listaUsuarios.iterator(); itUsuarios.hasNext();){
Usuario usuario = itUsuarios.next();
if(((usuario != null) && ((usuario.getLogin().indexOf(prefijo.toUpperCase()) == 0) ||
(usuario.getApn().indexOf(prefijo.toUpperCase()) == 0)))){
resultado.add(usuario);
}
}
return resultado;
}
If you need the full code of the bean, send a email to cibermon@gmail.com and I reply with the code. -
19. Re: SuggestionBox
cibermon Mar 5, 2009 2:26 AM (in response to cibermon)
Have you been able to reproduce the error?"nbelaevski" wrote:
Please post full page and beans code. I cannot reproduce the issue. -
20. Re: SuggestionBox
nbelaevski Mar 5, 2009 6:53 AM (in response to cibermon)You should update to 3.3.0.GA or 3.1.6.GA
-
21. Re: SuggestionBox
cibermon Mar 5, 2009 7:00 AM (in response to cibermon)Thanks you very much, I'll try to update to 3.1.6.GA version
"nbelaevski" wrote:
You should update to 3.3.0.GA or 3.1.6.GA -
22. Re: SuggestionBox
cibermon Mar 5, 2009 8:05 AM (in response to cibermon)Perfect, I have updated to 3.1.6.GA version and
works perfectly
Thanks you nbelaevski