当前位置: 首页>>代码示例>>Java>>正文


Java ComponentSystemEvent类代码示例

本文整理汇总了Java中javax.faces.event.ComponentSystemEvent的典型用法代码示例。如果您正苦于以下问题:Java ComponentSystemEvent类的具体用法?Java ComponentSystemEvent怎么用?Java ComponentSystemEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ComponentSystemEvent类属于javax.faces.event包,在下文中一共展示了ComponentSystemEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processEvent

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void processEvent(ComponentSystemEvent event)
  throws AbortProcessingException
{
  boolean inContextAtMethodInvocation = _inContext;
  if (!inContextAtMethodInvocation)
  {
    _setupContextChange();
  }

  try
  {
    super.processEvent(event);
  }
  finally
  {
    if (!inContextAtMethodInvocation)
    {
      _tearDownContextChange();
    }
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:22,代码来源:UIXCollection.java

示例2: checkCart

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void checkCart(ComponentSystemEvent event) {
	if (logger.isDebugEnabled()) logger.debug("in check cart");
	FacesContext fc = FacesContext.getCurrentInstance();

	ConfigurableNavigationHandler nav = (ConfigurableNavigationHandler) fc.getApplication().getNavigationHandler();

	if (this.cart.isEmpty()) {
		if (logger.isDebugEnabled()) logger.debug("go direct to logout");
		HttpServletRequest req = (HttpServletRequest) FacesContext
				.getCurrentInstance().getExternalContext().getRequest();
		HttpServletResponse res = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
		try {
			res.sendRedirect("finish-logout.xhtml");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
 
开发者ID:TremoloSecurityRetired,项目名称:Scale,代码行数:20,代码来源:ScaleUser.java

示例3: loadGuest

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void loadGuest(ComponentSystemEvent evt) {
    if (null == this.publicGuestId) {
        this.guest = Guest.nullGuest();
        addMessage(SEVERITY_ERROR,
                "No guest id provided!");
        return;
    }
    if (null == this.guest) {
        this.guest = this.service.findByPublicId(this.publicGuestId)
                .orElseGet(() -> {
                    addMessage(SEVERITY_ERROR,
                            "Cannot find guest " + this.publicGuestId);
                    return Guest.nullGuest();
                });
    }
}
 
开发者ID:koenighotze,项目名称:Hotel-Reservation-Tool,代码行数:17,代码来源:GuestDetailsBean.java

示例4: processEvent

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
/**
 * Dario D'Urzo <br>
 * Dynamically add custom css to manage non-sticky footer. In this way, only
 * if fixed attribute is "non-sticky" the system load the correct css that
 * manages all style aspect of this functionlity.
 *
 * This is also cross-theme.
 */
@Override
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
	if (event instanceof PostAddToViewEvent) {
		if ("non-sticky".equals(getFixed()) || ("bottom".equals(getPosition()) && (!isSticky()))) {
			AddResourcesListener.addExtCSSResource("sticky-footer-navbar.css");
			/*UIOutput resource = new UIOutput();
			resource.getAttributes().put("name", "css/sticky-footer-navbar.css");
			resource.getAttributes().put("library", C.BSF_LIBRARY);
			resource.getAttributes().put("target", "head");
			resource.setRendererType("javax.faces.resource.Stylesheet");
			FacesContext.getCurrentInstance().getViewRoot().addComponentResource(FacesContext.getCurrentInstance(),
					resource);*/
		}
	}
	super.processEvent(event);
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:25,代码来源:NavBar.java

示例5: validateInformation

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
/**
 * Validate the password
 * @param event 
 */
public void validateInformation(ComponentSystemEvent event) {
    FacesContext fc = FacesContext.getCurrentInstance();

    UIComponent components = event.getComponent();
    // get password
    UIInput uiInputPassword = (UIInput) components.findComponent("password");
    String pwd = uiInputPassword.getLocalValue() == null ? ""
            : uiInputPassword.getLocalValue().toString();

    // get confirm password
    UIInput uiInputConfirmPassword = (UIInput) components.findComponent("confirmPassword");
    String confirmPassword = uiInputConfirmPassword.getLocalValue() == null ? ""
            : uiInputConfirmPassword.getLocalValue().toString();

    if (pwd.isEmpty() || confirmPassword.isEmpty()) {
        // Do not take any action. 
        // The required="true" in the XHTML file will catch this and produce an error message.
        return;
    }

    if (!pwd.equals(confirmPassword)) {
        message = "Passwords must match!";
    } else {
        message = "";
    }   
}
 
开发者ID:McBrosa,项目名称:MapChat,代码行数:31,代码来源:PasswordResetManager.java

示例6: validateInformation

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
/**
 * Make sure the two password are equal when the event is received
 * @param event the event to listen for
 */
public void validateInformation(ComponentSystemEvent event) {
    FacesContext fc = FacesContext.getCurrentInstance();

    UIComponent components = event.getComponent();
    // Get password
    UIInput uiInputPassword = (UIInput) components.findComponent("password");
    String pwd = uiInputPassword.getLocalValue() == null ? ""
            : uiInputPassword.getLocalValue().toString();

    // Get confirm password
    UIInput uiInputConfirmPassword = (UIInput) components.findComponent("confirmPassword");
    String confirmPassword = uiInputConfirmPassword.getLocalValue() == null ? ""
            : uiInputConfirmPassword.getLocalValue().toString();

    if (pwd.isEmpty() || confirmPassword.isEmpty()) {
        // Do not take any action. 
        // The required="true" in the XHTML file will catch this and produce an error message.
        return;
    }

    if (!pwd.equals(confirmPassword)) {
        statusMessage = "Passwords must match!";
    } else {
        statusMessage = "";
    }   
}
 
开发者ID:McBrosa,项目名称:MapChat,代码行数:31,代码来源:AccountManager.java

示例7: validatePassword

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void validatePassword(ComponentSystemEvent event) {
    FacesContext fc = FacesContext.getCurrentInstance();

    UIComponent components = event.getComponent();

    // get password
    UIInput uiInputPassword = (UIInput) components.findComponent("newPassword");
    String password = uiInputPassword.getLocalValue() == null ? ""
            : uiInputPassword.getLocalValue().toString();
    String passwordId = uiInputPassword.getClientId();

    // get confirm password
    UIInput uiInputConfirmPassword = (UIInput) components.findComponent("newConfirmPassword");
    String confirmPassword = uiInputConfirmPassword.getLocalValue() == null ? ""
            : uiInputConfirmPassword.getLocalValue().toString();

    // Let required="true" do its job.
    if (password.isEmpty() || confirmPassword.isEmpty()) {
        return;
    }

    if (!password.equals(confirmPassword)) {
        FacesMessage msg = new FacesMessage(bundle.getString("resetpassword.error.notmatch"));
        msg.setSeverity(FacesMessage.SEVERITY_ERROR);
        fc.addMessage(passwordId, msg);
        fc.renderResponse();
    }
}
 
开发者ID:SECQME,项目名称:watchoverme-server,代码行数:29,代码来源:ResetPasswordBean.java

示例8: preRender

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void preRender(ComponentSystemEvent event) {
	
	if (! FacesContext.getCurrentInstance().isPostback()) {
		
		this.attributes = new ArrayList<ScaleAttribute>();
		for (ScaleAttribute attr : this.scaleUser.getAttributes()) {
			this.attributes.add(new ScaleAttribute(attr.getName(),attr.getLabel(),attr.getValue()));
		}
		this.saveResult.reset();
	} else {
		
	}
}
 
开发者ID:TremoloSecurityRetired,项目名称:Scale,代码行数:14,代码来源:SaveUser.java

示例9: initReservationMessage

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
/**
 * Adds a message if a reservation is indicated via get parameters
 *
 * @param evt the event
 */
public void initReservationMessage(ComponentSystemEvent evt) {
    if (isBlank(publicGuestId) || isBlank(reservationNumber)) {
        return;
    }
    FacesMessage message = new FacesMessage(format("Room %s is booked for %s; Reservation number %s",
            roomNumber, publicGuestId, reservationNumber));
    getCurrentInstance().addMessage(null, message);
}
 
开发者ID:koenighotze,项目名称:Hotel-Reservation-Tool,代码行数:14,代码来源:GuestbookBean.java

示例10: loadRoom

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void loadRoom(ComponentSystemEvent evt) {
    if (null == this.roomId) {
        this.room = Room.nullValue();
        addMessage(SEVERITY_WARN, "No room id provided!");
        return;
    }

    if (null == this.room) {
        this.room = this.service.findRoomById(this.roomId)
                .orElseGet(() -> {
                    addMessage(SEVERITY_WARN, "Cannot find room " + this.roomId);
                    return Room.nullValue();
                });
    }
}
 
开发者ID:koenighotze,项目名称:Hotel-Reservation-Tool,代码行数:16,代码来源:RoomDetailsBean.java

示例11: renderAttribute

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void renderAttribute(ComponentSystemEvent event) {
	// Replace dummy component id with real one
	String dummyId = event.getComponent().getAttributes().get("aid").toString();
	String clientId = event.getComponent().getClientId();
	
	GluuAttribute attribute = this.attributeToIds.get(dummyId);
	this.attributeIds.put(attribute, clientId);
}
 
开发者ID:GluuFederation,项目名称:oxTrust,代码行数:9,代码来源:CustomAttributeAction.java

示例12: processEvent

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
@Override
public void processEvent(ComponentSystemEvent componentEvent) {
    final UIComponent listener = componentEvent.getComponent();
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final String listenerId = Components.getFullyQualifiedComponentId(facesContext, listener);
    provider.getMap(facesContext).add((String) listener.getAttributes().get(attribute), listenerId);
}
 
开发者ID:encoway,项目名称:edu,代码行数:8,代码来源:EventDrivenUpdatesListener.java

示例13: init

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void init(ComponentSystemEvent e){
    log.info("call init");
    log.info("flag @"+ flag);
    
    if(!FacesContext.getCurrentInstance().isPostback()){
        //initialized some data...but avoid loading in postback request
    }
    
    if("page2".equals(flag)){
        ConfigurableNavigationHandler handler=(ConfigurableNavigationHandler)  
                FacesContext.getCurrentInstance().getApplication().getNavigationHandler();      
        handler.performNavigation("page2");
    }
}
 
开发者ID:hantsy,项目名称:ee7-sandbox,代码行数:15,代码来源:PreRenderViewBean.java

示例14: loadFile

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
public void loadFile(ComponentSystemEvent event) {
    // TODO: The post-back check will become unnecessary in JSF 2.2,
    // when the <f:viewAction action="#{editMediaFileBean.loadFile}" onPostback="false" />
    // is introduced.
    if (!FacesContext.getCurrentInstance().isPostback()) {
        this.mediaFile = mediaFileEJB.findById(videoId);
        if ( mediaFile.getUserProvidedMetadata() != null ) {
            this.metaData = mediaFile.getUserProvidedMetadata();
        } else {
            this.metaData = new MediaFileUserProvidedMetaData();
        }
        this.thumbnailOffsetMs = mediaFile.getThumbnailData().getThumbnailOffsetMs();
    }
}
 
开发者ID:mymam,项目名称:mymam,代码行数:15,代码来源:EditMediaFileBean.java

示例15: validateSpeakers

import javax.faces.event.ComponentSystemEvent; //导入依赖的package包/类
/**
 * Validate that at least 1 speaker is assigned to the talk.
 *
 * @param event
 * 		the validation event
 */
public void validateSpeakers(ComponentSystemEvent event) {

	if (talk.getSpeakers().isEmpty()) {
		FacesContext facesContext = FacesContext.getCurrentInstance();
		facesContext.addMessage("talkForm:speakers",
				new FacesMessage(FacesMessage.SEVERITY_ERROR, "must be selected.",
						"At least one speaker must be selected."));

		facesContext.validationFailed();
	}
}
 
开发者ID:n-moser,项目名称:Conference,代码行数:18,代码来源:TalkAdminBean.java


注:本文中的javax.faces.event.ComponentSystemEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。