本文整理汇总了Java中javax.faces.event.AjaxBehaviorEvent类的典型用法代码示例。如果您正苦于以下问题:Java AjaxBehaviorEvent类的具体用法?Java AjaxBehaviorEvent怎么用?Java AjaxBehaviorEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AjaxBehaviorEvent类属于javax.faces.event包,在下文中一共展示了AjaxBehaviorEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectSubscriptionRole
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
public void selectSubscriptionRole(AjaxBehaviorEvent event) {
String roleWithId = (String) ((javax.faces.component.html.HtmlSelectOneMenu) event
.getSource()).getValue();
String subscriptionId = (String) event.getComponent().getAttributes()
.get("subscriptionId");
List<SelectItem> items = (List<SelectItem>) event.getComponent()
.getAttributes().get("items");
for (SelectItem item : items) {
if (item.getValue().equals(roleWithId)) {
model.getChangedRoles().put(subscriptionId, item.getLabel());
}
}
System.out.println(event);
}
示例2: addCountryVat
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
/**
* Also called from client via AJAX to add a new row to the table with the
* country specific VAT rates
*
*/
@SuppressWarnings("unused")
public void addCountryVat(final AjaxBehaviorEvent event) {
// remove any used country from the countries list
final List<String> beanCountries = this.getCountries();
final List<VOCountryVatRate> countryVatRates = this.getCountryVats();
for (VOCountryVatRate voCountryVatRate : countryVatRates) {
if (voCountryVatRate != null) {
beanCountries.remove(voCountryVatRate.getCountry());
}
}
if (beanCountries.size() > 0) {
final VOCountryVatRate vo = new VOCountryVatRate();
countryVatRates.add(vo);
addToVatStrings(vo);
}
}
示例3: getFiltroPersonalizado
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
public void getFiltroPersonalizado(AjaxBehaviorEvent ajaxBehaviorEvent) {
FiltroPersonalizado filtroPadrao = new FiltroPersonalizado();
FuncaoUsuarioEnum funcao = securityService.getUserProfile();
if(!(funcao == FuncaoUsuarioEnum.ADMINISTRADOR || funcao == FuncaoUsuarioEnum.OUVIDOR)) {
filtroPadrao.setMetodoBusca("and");
filtroPadrao.addManIdStatus(StatusManifestacaoEnum.EM_ANDAMENTO.getId());
filtroPadrao.addEncIdUnidadeRecebeu(securityService.getUser().getIdUnidade().getIdUnidade());
}
filtroEscolhido = filtroPersonalizadoDAO.find(filtroEscolhido.getIdFiltroPersonalizado());
XStream xs = new XStream();
filtroAtual = (FiltroPersonalizado) xs.fromXML(filtroEscolhido.getDsParticao());
nomeFiltro = filtroEscolhido.getNmFiltroPersonalizado();
setListaManifestacoes(manifestacaoDAO.getManifestacoes(filtroPadrao, filtroAtual));
}
示例4: queueEvent
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
public void queueEvent(FacesEvent event) {
FacesContext context = getFacesContext();
if (isRequestSource(context, this) && event instanceof AjaxBehaviorEvent) {
Map<String, String> params = context.getExternalContext().getRequestParameterMap();
String eventName = params.get(Constants.RequestParams.PARTIAL_BEHAVIOR_EVENT_PARAM);
String clientId = this.getClientId(context);
AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;
String activeIndex = params.get(clientId + "_active");
Tab tab = activeIndex != null ? getTabWithIndex(Integer.valueOf(activeIndex)) : null;
if (eventName.equals("tabChange")) {
TabChangeEvent changeEvent = new TabChangeEvent(this, behaviorEvent.getBehavior(), tab);
changeEvent.setPhaseId(behaviorEvent.getPhaseId());
super.queueEvent(changeEvent);
}
} else {
super.queueEvent(event);
}
}
示例5: queueEvent
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
public void queueEvent(FacesEvent event) {
FacesContext context = getFacesContext();
if (isRequestSource(context, this) && event instanceof AjaxBehaviorEvent) {
Map<String, String> params = context.getExternalContext().getRequestParameterMap();
String eventName = params.get(PARTIAL_BEHAVIOR_EVENT_PARAM);
AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;
if (eventName.equals("flip")) {
FlipPanelEvent flipPanelEvent = new FlipPanelEvent(this, behaviorEvent.getBehavior());
flipPanelEvent.setPhaseId(behaviorEvent.getPhaseId());
super.queueEvent(flipPanelEvent);
}
} else {
super.queueEvent(event);
}
}
示例6: queueEvent
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
public void queueEvent(FacesEvent event) {
FacesContext context = getFacesContext();
if (isRequestSource(context, this) && event instanceof AjaxBehaviorEvent) {
Map<String, String> params = context.getExternalContext().getRequestParameterMap();
String eventName = params.get(Constants.RequestParams.PARTIAL_BEHAVIOR_EVENT_PARAM);
String clientId = getClientId(context);
AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;
String expandedRowKey = getRequestedExpandRowKey(context);
if (expandedRowKey != null)
setRowIndexForRowKey(expandedRowKey);
if (eventName.equals("rowSelect")) {
String selectedRowKey = params.get(clientId + "_selected");
setRowIndexForRowKey(selectedRowKey);
SelectionEvent se = new SelectionEvent(this, behaviorEvent.getBehavior(), getRowData());
se.setPhaseId(behaviorEvent.getPhaseId());
super.queueEvent(se);
return;
}
}
super.queueEvent(event);
}
示例7: queueEvent
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
public void queueEvent(FacesEvent event) {
FacesContext context = getFacesContext();
if (isRequestSource(context, this) && event instanceof AjaxBehaviorEvent) {
Map<String, String> params = context.getExternalContext().getRequestParameterMap();
String eventName = params.get(PARTIAL_BEHAVIOR_EVENT_PARAM);
AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;
if (eventName.equals("change")) {
SwitchEvent switchEvent = new SwitchEvent(this, behaviorEvent.getBehavior());
switchEvent.setPhaseId(behaviorEvent.getPhaseId());
super.queueEvent(switchEvent);
}
} else {
super.queueEvent(event);
}
}
示例8: onChangeDateBefore
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
/**
* Validación del Rango de fechas.
*
* <p>
* Considera válida una fecha posterior, si la fecha anterior es nula, o la
* fecha posterior ocurrio despues
* </p>
*
* <p>
* Genera un mensaje de error en el componente en el caso de que la fecha no
* sea posterior
* </p>
**/
@Override
public void onChangeDateBefore(AjaxBehaviorEvent event) {
Date dateBefore = (Date) ((UICalendar) event.getComponent()).getValue();
Date dateAfter = (Date) getFilterOptions().get(DATE_AFTER);
if (DateUtils.isBeforeOrEqual(dateBefore, dateAfter)) {
getFilterOptions().put(DATE_BEFORE, dateBefore);
} else {
controllerHelper.createFacesMessageSimple(
FacesMessage.SEVERITY_WARN,
createMessageDate(dateAfter, MESSAGE_BEFORE),
createMessageDate(dateAfter, MESSAGE_BEFORE),
controllerHelper.getClientId("fecha_desde"));
getFilterOptions().put(DATE_BEFORE, null);
}
}
示例9: onChangeDateAfter
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
/**
* Validación del Rango de fechas.
*
* <p>
* Considera válida una fecha posterior, si la fecha anterior es nula, o la
* fecha posterior ocurrio despues
* </p>
*
* <p>
* Genera un mensaje de error en el componente en el caso de que la fecha no
* sea posterior
* </p>
**/
@Override
public void onChangeDateAfter(AjaxBehaviorEvent event) {
Date dateAfter = (Date) ((UICalendar) event.getComponent()).getValue();
Date dateBefore = (Date) getFilterOptions().get(DATE_BEFORE);
if (DateUtils.isAfterOrEqual(dateBefore, dateAfter)) {
getFilterOptions().put(DATE_AFTER, dateAfter);
} else {
controllerHelper.createFacesMessageSimple(
FacesMessage.SEVERITY_WARN,
createMessageDate(dateBefore, MESSAGE_AFTER),
createMessageDate(dateBefore, MESSAGE_AFTER),
controllerHelper.getClientId("fecha_hasta"));
getFilterOptions().put(DATE_AFTER, null);
}
}
示例10: onCheckboxHeaderClicked
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
@Override
public void onCheckboxHeaderClicked(final AjaxBehaviorEvent event) {
HtmlSelectBooleanCheckbox checkBox = (HtmlSelectBooleanCheckbox) event
.getSource();
UIExtendedDataTable dataTable;
UIComponent test = checkBox;
while (test != null && !(test instanceof UIExtendedDataTable)) {
test = test.getParent();
}
dataTable = (UIExtendedDataTable) test;
Boolean selected = (Boolean) checkBox.getValue();
// XXX por que va a realizar otra llamada a la base de datos
if (dataTable != null) {
@SuppressWarnings("unchecked")
List<T> items = (List<T>) dataTable.getValue();
for (T item : items) {
getSelectedMap().put(item, selected);
}
}
}
示例11: keyUpListener
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
/**
* Listener que escucha las peticiones del field codigo y llama al
* correspondiente {@link KeyListener} cuando un evento ocurre, si el
* correspondiente {@link KeyListener} no maneja el evento, se setea a null
* el objeto seleccionado
*
* @param event
*/
public void keyUpListener(final AjaxBehaviorEvent event) {
Object submitted = ((HtmlInputText) event.getSource())
.getSubmittedValue();
FacesContext fc = FacesContext.getCurrentInstance();
if (keyListener != null) {
boolean bool = keyListener.onBlur(this, event, submitted);
// Tratar cuadno se selecciona un valor nulo
if (!bool) {
getValueExpression().setValue(fc.getELContext(), null);
createFacesMessage(FacesMessage.SEVERITY_WARN,
COMPONENT_PICKER_INPUT_NOT_FOUND,
COMPONENT_PICKER_INPUT_NOT_FOUND);
}
}
}
示例12: addAjaxButton
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
/**
* Agrega un botón ajax, que se ejecuta cuando se presiona click.
*
* @return this
*/
public StepBuilder addAjaxButton(String i18nKey,
final OnClickCallBack clickCallBack, boolean immediate,
boolean inLeft) {
Button b = new Button();
b.setText(i18nKey);
b.setImmediate(immediate);
b.setStyle(inLeft ? FLOAT_LEFT : FLOAT_RIGTH);
AjaxBehavior ab = KarakuComponentFactory.getAjaxBehavior();
ab.addAjaxBehaviorListener(new AjaxBehaviorListener() {
@Override
public void processAjaxBehavior(AjaxBehaviorEvent event) {
clickCallBack.onClick();
}
});
ab.setRender(ListHelper.getAsList("@form"));
b.addAjaxBehavior(ButtonAction.ACTION, ab);
step.getToolBar().addItem(b);
return this;
}
示例13: calculateTotal
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
public void calculateTotal(AjaxBehaviorEvent event)
throws AbortProcessingException {
int ticketsNum = 1;
int ticketPrice = 0;
int total;
if (tickets.trim().length() > 0) {
ticketsNum = Integer.parseInt(tickets);
}
if (price.trim().length() > 0) {
ticketPrice = Integer.parseInt(price);
}
total = (ticketsNum * ticketPrice);
totalValue = String.valueOf(total) + ".00";
}
示例14: goToDestination
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
/**
* Go to the page number specified by the request param "pageNumber".
*
* @param event JSF action event.
*/
public void goToDestination(AjaxBehaviorEvent event) {
try {
List selected = currentDocumentState.getSelected();
if (selected != null && selected.size() > 0){
OutlineItemTreeNode selectedNode = (OutlineItemTreeNode)selected.get(0);
int pageNumber = ((OutlineItemTreeNode.NodeUserObject)selectedNode.getUserObject()).getGoToPage();
currentDocumentState.setPageCursor(pageNumber + 1);
refreshDocumentState();
}
// int pageNumber = Integer.parseInt(
// FacesUtils.getRequestParameter("pageNumber"));
// currentDocumentState.setPageCursor(pageNumber + 1);
// refresh current page state.
} catch (Throwable e) {
logger.log(Level.WARNING, "Error going to specified page number.");
}
}
示例15: onFilterOperationsChange
import javax.faces.event.AjaxBehaviorEvent; //导入依赖的package包/类
public void onFilterOperationsChange(final AjaxBehaviorEvent event) {
final Boolean myOpsOnlyNegated = BooleanUtils.negate(this.isMyOperationsOnly());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(String.format(
"onFilterOperationsChange(event=%s) triggered, reloading records with myOperationsFlag=%s", event,
myOpsOnlyNegated));
}
this.loadOperationRecords(myOpsOnlyNegated);
}