Skip to content

Instantly share code, notes, and snippets.

@Isxida
Last active December 16, 2015 10:38
Show Gist options
  • Save Isxida/5421174 to your computer and use it in GitHub Desktop.
Save Isxida/5421174 to your computer and use it in GitHub Desktop.
No logra conseguir los datos de selectedzonas.
@ManagedBean(name = "cTitulo")
@SessionScoped
public class BeanManegerRegisPublico implements Serializable {
private List<RegisPublico> sourceZN = new ArrayList<RegisPublico>();
private List<RegisPublico> targetZN = new ArrayList<RegisPublico>();
private DualListModel<RegisPublico> zonaRegistral;
private String selectedzonas;
public void onTransfer(TransferEvent event) {
for (RegisPublico p : zonaRegistral.getTarget()){
selectedzonas += p.getRegPubId() + "";
}
}
public List<BeanBuscarTituloNumero> getRtitNum() {
System.out.println(NTNroTitulo + NTanyo + selectedzonas);
//Al querer imprimir me lanza que selectedzonas es null
RtitNum = new ArrayList<BeanBuscarTituloNumero>();
RtitNum.addAll(getBusquedaTituloBo()
.buscarTituloNumero(NTNroTitulo, NTanyo, selectedzonas));
for (BeanBuscarTituloNumero a : RtitNum) {
System.out.println("Datos : "+ a.getNumTitu() +" "+a.getAreaRegId()+" "+a.getEstado()+" "+a.getNombreZona());
}
return RtitNum;
}
}
<h:form id="consultaTitulos">
<table width="588" height="20">
<tr>
<td bordercolor="AFAFAF" bgcolor="D7D7D7" colspan="6" height="230" width="230" align="center">
<p:pickList id="pickList"
value="#{cTitulo.zonaRegistral}"
var="zr"
itemLabel="#{zr.nombre}"
itemValue="#{zr.regPubId}" >
<p:ajax event="transfer" listener="#{cTitulo.onTransfer}" />
</p:pickList>
</td>
<td>
<p:selectOneMenu value="#{cTitulo.NTanyo}" >
<f:selectItem itemLabel="Seleccione un Año" itemValue="" />
<f:selectItem itemLabel="2002" itemValue="2002" />
<f:selectItem itemLabel="2003" itemValue="2003" />
</p:selectOneMenu>
</td>
<td>
<label>N&uacute;mero de T&iacute;tulo: </label>
</td>
<td>
<p:inputText id="ntNroTitulo" value="#{cTitulo.NTNroTitulo}"/>
</td>
<td>
<p:commandLink action="#{cTitulo.getRtitNum}">
<img src="../resources/img/btn_buscar.gif"/>
<br/><br/>
</p:commandLink>
</td>
</tr>
</table>
</h:form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment