@Override public void queueEvent(FacesEvent facesEvent) { // This method is called by the AjaxBehavior renderer's decode() method. If the specified event // is an ajax // behavior event that indicates a tab being collapsed/expanded, then if (facesEvent instanceof AjaxBehaviorEvent) { // Determine the client-side state of the selected tab index. FacesContext facesContext = FacesContext.getCurrentInstance(); Map<String, String> requestParameterMap = facesContext.getExternalContext().getRequestParameterMap(); String clientId = getClientId(facesContext); int selectedIndex = IntegerHelper.toInteger( requestParameterMap.get(clientId + AccordionRenderer.SELECTED_INDEX)); // If iterating over a data model, then determine the row data and tab associated with the // data model // iteration. Object rowData = null; Tab tab = null; String var = getVar(); if (var != null) { setRowIndex(selectedIndex); rowData = getRowData(); tab = TabUtil.getFirstChildTab(this); setRowIndex(-1); } // Otherwise, determine the tab associated with the client-side state of the selected tab // index. else { List<Tab> childTabs = TabUtil.getChildTabs(this); if (childTabs.size() >= (selectedIndex + 1)) { tab = childTabs.get(selectedIndex); } } // Queue an accordion tab event rather than the specified faces event. AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) facesEvent; Behavior behavior = behaviorEvent.getBehavior(); String eventName = requestParameterMap.get(FacesConstants.JAVAX_FACES_BEHAVIOR_EVENT); if (TabCollapseEvent.TAB_COLLAPSE.equals(eventName)) { TabCollapseEvent tabCollapseEvent = new TabCollapseEvent(this, behavior, tab, rowData); super.queueEvent(tabCollapseEvent); } else if (TabExpandEvent.TAB_EXPAND.equals(eventName)) { TabExpandEvent tabExpandEvent = new TabExpandEvent(this, behavior, tab, rowData); super.queueEvent(tabExpandEvent); } } // Otherwise, queue the specified faces event. else { super.queueEvent(facesEvent); } }
// Creates an AjaxBehaviorEvent for the specified component/behavior private static AjaxBehaviorEvent createEvent( FacesContext facesContext, UIComponent component, AjaxBehavior ajaxBehavior) { AjaxBehaviorEvent event = new AjaxBehaviorEvent(facesContext, component, ajaxBehavior); PhaseId phaseId = isImmediate(component, ajaxBehavior) ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.INVOKE_APPLICATION; event.setPhaseId(phaseId); return event; }
public void exibirPainel(AjaxBehaviorEvent event) throws Exception { setExibir(true); String exEvent = ""; exEvent = (String) event.getComponent().getAttributes().get("value"); }
public void localeCodeChanged(AjaxBehaviorEvent e) { String newLocaleValue = ((SelectOneMenu) e.getSource()).getValue() + ""; for (Entry<String, Locale> entry : countries.entrySet()) { if (entry.getValue().toString().equals(newLocaleValue)) { FacesContext.getCurrentInstance().getViewRoot().setLocale(entry.getValue()); } } }
/** * Check user name availability. UI ajax use. * * @param ajax event * @return */ public boolean checkAvailable(AjaxBehaviorEvent event) { InputText inputText = (InputText) event.getSource(); String value = (String) inputText.getValue(); boolean available = userDao.checkAvailable(value); if (!available) { FacesMessage message = constructErrorMessage( null, String.format(getMessageBundle().getString("userExistsMsg"), value)); getFacesContext().addMessage(event.getComponent().getClientId(), message); } else { FacesMessage message = constructInfoMessage( null, String.format(getMessageBundle().getString("userAvailableMsg"), value)); getFacesContext().addMessage(event.getComponent().getClientId(), message); } return available; }
public void cargarDocumentos(AjaxBehaviorEvent e) { FacesContext context = FacesContext.getCurrentInstance(); context.addMessage( null, new FacesMessage( "Advertencia", "Verfique la documentación faltante para continuar el tramite.")); String codigoTramite = e.getSource().toString(); documentos = new ArrayList<>(); try { for (EmisorDto emisor : emisores) { if (emisor.getCodigoEntidadEmisora() == emisorSeleccionado.getCodigoEntidadEmisora()) { for (TramiteDefinicionDto tramiteDefinicionDto : emisor.getTramiteDefinicionList()) { if (tramiteDefinicionDto.getCodigoTramiteDefinicion() == tramiteSeleccionado.getIdTramite()) { for (DocumentoRequeridoTramiteDto documento : tramiteDefinicionDto.getDocumentoRequeridoTramiteList()) { /*Validacion de los documentos faltantes*/ List<Integer> listaTramites = new ArrayList<>(); for (DocumentoRequeridoDto documentoRequeridoDto : documentos) { listaTramites.add(documentoRequeridoDto.getCodigoDocumento()); } /*Obtener el iddeusuario en sesion*/ HttpSession session = (HttpSession) context.getExternalContext().getSession(false); Integer codCiudadano = (Integer) session.getAttribute("codCiudadano"); com.making.co.cliente.ciudadano.CiudadanoDto ciudadanoDto = iCiudadanoServiceBean.obtenerCiudadanoPorCodigo("123456789", codCiudadano); com.making.cp.dto.CiudadanoDto ciudadano = Mapper.copyCompleto(ciudadanoDto, com.making.cp.dto.CiudadanoDto.class, false); List<Integer> idsFaltantes = iTramiteServiceLocal.getDocumentosFaltantes( listaTramites, codCiudadano, ciudadano); documentos.add( new DocumentoRequeridoDto( true, documento.getCodigoDocumentoRequerido(), documento .getCodigoMetadataTipoDocumento() .getDescripcionMetadataTipoDocumento(), new Date())); } } } } } } catch (Exception ex) { int i = 0; } }
public void clear(AjaxBehaviorEvent event) { groupEdit = new Group(); filmEdit = new Distribution(); filmEdit.setStatus(StatusEnum.NEW); clearSubmittedValues(event.getComponent(), "groupDialog"); clearSubmittedValues(event.getComponent(), "filmDialog"); if (!groupItem.isEmpty()) { filmEdit.setGroup((Group) groupItem.get(0).getValue()); } dialogChangeGroup(null); }
/** * fonction qui change la liste déroulante avec le bouton radio * * @param event */ public void choixIntegration(AjaxBehaviorEvent event) { // message += "dans de l'integration ||"; if (event.getBehavior() != null) { // message += "debut de l'integration ||"; Integrator = null; // Ligne pour recupere la valeur de l'object selectioner String valtmp = (String) event.getComponent().getAttributes().get("value"); // message += " ||" + valtmp + " ||" ; if (valtmp.equalsIgnoreCase("continu")) { Integrator = Integrator1; // message += "continu de l'integration ||"; } else if (valtmp.equalsIgnoreCase("discret")) { Integrator = Integrator2; // message += "descret de l'integration ||"; } else if (valtmp.equalsIgnoreCase("algebraic")) { Integrator = Integrator3; // message += "algebric de l'integration ||"; } } else Integrator = null; }
public void handleChangeKullaniciRapor(AjaxBehaviorEvent event) { try { HtmlSelectOneMenu menu = (HtmlSelectOneMenu) event.getComponent(); if (menu.getValue() instanceof Kullanicirapor) { setCalistirilacakRaporRID(((Kullanicirapor) menu.getValue()).getRID()); } else { setCalistirilacakRaporRID(0L); } } catch (Exception e) { logYaz("Error KisiRaporlamaController @handleChangeKullaniciRapor :" + e.getMessage()); logYaz("Exception @" + getModelName() + "Controller :", e); } }
public boolean handleIcerikOrEditor(AjaxBehaviorEvent event1) { try { HtmlSelectOneMenu menuForIcerikOrEditor = (HtmlSelectOneMenu) event1.getComponent(); if (menuForIcerikOrEditor.getValue() instanceof EvetHayir) { if (getIcerikOrEditor().equals(EvetHayir._EVET)) { return true; } else { return false; } } else { return false; } } catch (Exception e) { logYaz("Exception @" + getModelName() + "Controller :", e); } return true; }
public void cargarTramites(AjaxBehaviorEvent e) { String codigoEntidad = e.getSource().toString(); listaTramiteDefinicion = new ArrayList<>(); try { for (EmisorDto emisor : emisores) { if (emisor.getCodigoEntidadEmisora() == emisorSeleccionado.getCodigoEntidadEmisora()) { emisorSeleccionado = emisor; for (TramiteDefinicionDto tramiteDefinicionDto : emisor.getTramiteDefinicionList()) { SelectItem selectItem = new SelectItem( tramiteDefinicionDto.getCodigoTramiteDefinicion(), tramiteDefinicionDto.getDescripcion()); listaTramiteDefinicion.add(selectItem); } } } } catch (Exception ex) { } }
@Override public void handleChange(AjaxBehaviorEvent event) { try { HtmlSelectOneMenu menu = (HtmlSelectOneMenu) event.getComponent(); if (menu.getValue() instanceof Sehir) { changeIlce(((Sehir) menu.getValue()).getRID()); } else if (menu.getValue() instanceof Ilce) { changeMahalle(((Ilce) menu.getValue()).getRID()); } else if (menu.getValue() instanceof Ulke) { changeIl(((Ulke) menu.getValue()).getRID()); } else if (menu.getValue() instanceof AdresTipi) { changeUlke((AdresTipi) menu.getValue()); } else if (menu.getValue() instanceof Universite) { changeFakulte(((Universite) menu.getValue()).getRID()); } else if (menu.getValue() instanceof Fakulte) { changeBolum(((Fakulte) menu.getValue()).getRID()); } } catch (Exception e) { logger.error("Exception @" + getModelName() + "Controller :", e); } }
public void updateAttribute(AjaxBehaviorEvent event) throws AbortProcessingException { UIComponent component = (UIComponent) event.getSource(); String attributeName = (String) component.findComponent("name").getAttributes().get("value"); Object attributeValue = component.findComponent("value").getAttributes().get("value"); component.findComponent("fu").getAttributes().put(attributeName, attributeValue); }
public void editFilm(AjaxBehaviorEvent event) { clearSubmittedValues(event.getComponent().getParent().getParent().getParent(), "filmDialog"); filmEdit = filmModel.getRowData(); }
public void editGroup(AjaxBehaviorEvent event) { clearSubmittedValues(event.getComponent().getParent().getParent().getParent(), "groupDialog"); groupEdit = groupModel.getRowData(); }