當前位置: 首頁>>代碼示例>>Java>>正文


Java ValueChangeEvent類代碼示例

本文整理匯總了Java中javax.faces.event.ValueChangeEvent的典型用法代碼示例。如果您正苦於以下問題:Java ValueChangeEvent類的具體用法?Java ValueChangeEvent怎麽用?Java ValueChangeEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ValueChangeEvent類屬於javax.faces.event包,在下文中一共展示了ValueChangeEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleValueChange

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
public void handleValueChange (ValueChangeEvent event)
{
    PhaseId
        phaseId = event.getPhaseId();

    String
        oldValue = (String) event.getOldValue(),
        newValue = (String) event.getNewValue();

    if (phaseId.equals(PhaseId.ANY_PHASE))
    {
        event.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
        event.queue();
    }
    else if (phaseId.equals(PhaseId.UPDATE_MODEL_VALUES))
    {
    // do you method here
    }
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:20,代碼來源:EventPager.java

示例2: landingpageTypeChanged

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
/**
 * value change listener for landingpage type
 * 
 * @param event
 */
public void landingpageTypeChanged(ValueChangeEvent event) {
    String marketplaceId = model.getSelectedMarketplace();
    String selectedLandingpageType = (String) event.getNewValue();
    try {
        if (!LandingpageType.contains(selectedLandingpageType)) {
            model.setLandingpageType(""); // nothing selected
        } else if (LandingpageType.isDefault(selectedLandingpageType)) {
            Response r = getLandingpageService()
                    .loadPublicLandingpageConfig(marketplaceId);
            switchtToPublicLandingpage(r);
        } else {
            switchToEnterpriseLandingpage();
        }
    } catch (SaaSApplicationException e) {
        ui.handleException(e);
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:23,代碼來源:CustomizeLandingpageCtrl.java

示例3: serviceChanged

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
public void serviceChanged(ValueChangeEvent event) {
    long selectedServiceKey = ((Long) event.getNewValue()).longValue();
    if (selectedServiceKey != model.getSelectedServiceKey()) {
        POPartnerServiceDetails service = new POPartnerServiceDetails();
        boolean isError = false;
        if (selectedServiceKey > 0) {
            try {
                Response response = getPartnerService()
                        .getServiceDetails(selectedServiceKey);
                service = response.getResult(POPartnerServiceDetails.class);
            } catch (SaaSApplicationException e) {
                ui.handleException(e);
                isError = true;
                selectedServiceKey = 0L;
            }
        }
        model.setSelectedServiceKey(selectedServiceKey);
        model.setPartnerServiceDetails(service);
        model.setDisabled(isDisabled());
        model.setRolePrices(new ArrayList<RoleSpecificPrice>());
        initializePriceModel();
        if (isError) {
            initializeServices();
        }
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:27,代碼來源:PartnerServiceViewCtrl.java

示例4: processValueChange

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
/**
 * This methods is used as a callback for value-changed-event of the select
 * marketplace facelet.
 */
public void processValueChange(ValueChangeEvent event)
        throws AbortProcessingException {
	
	String selectedMarketplaceId = (String) event.getNewValue();
	
	if (selectedMarketplaceId.equals("0")) {
		marketplaceBean.setMarketplaceId(null);
	} else{
		marketplaceBean.setMarketplaceId(selectedMarketplaceId);
	}
	
    resetMembers();
    resetStage();
    this.marketplaceBean.processValueChange(event);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:20,代碼來源:TranslationBean.java

示例5: processValueChange

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
/**
 * Marketplace chooser
 * 
 * @param event
 */
public void processValueChange(ValueChangeEvent event) {
    String selectedMarketplaceId = (String) event.getNewValue();
    this.marketplaceBean.processValueChange(event);
    if (selectedMarketplaceId.equals("0")) {
        marketplace = null;
        setBrandingUrl(null);
    } else {
        try {
            marketplace = getMarketplaceService().getMarketplaceById(
                    selectedMarketplaceId);
            setBrandingUrl(getMarketplaceService().getBrandingUrl(
                    selectedMarketplaceId));
        } catch (ObjectNotFoundException e) {
            getMarketplaceBean().checkMarketplaceDropdownAndMenuVisibility(
                    null);
            marketplace = null;
            setBrandingUrl(null);
        }
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:26,代碼來源:BrandBean.java

示例6: templateChanged_toSameValue

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
@Test
public void templateChanged_toSameValue() {
    // given
    ValueChangeEvent event = new ValueChangeEvent(mock(UIComponent.class),
            Long.valueOf(101L), Long.valueOf(101L));
    ManageOperatorRevenueShareModel model = new ManageOperatorRevenueShareModel();
    model.setSelectedTemplateKey(101L);
    ctrl.setModel(spy(model));

    // when
    ctrl.templateChanged(event);

    // then
    assertEquals(101L, ctrl.getModel().getSelectedTemplateKey());
    verify(ctrl.getModel(), times(0)).setSelectedTemplateKey(eq(101L));
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:17,代碼來源:ManageOperatorRevenueShareCtrlTest.java

示例7: processValueChange

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
@Test
public void processValueChange() {
    // given
    givenGroupedOperations();
    model.setSelectedGroup(null);
    model.setOperationGroups(operationGroups);
    model.setOperations(availableOperations);

    ValueChangeEvent mockedEvent = mock(ValueChangeEvent.class);
    doReturn("OPERATIONS_ORGANIZATION_ADMIN").when(mockedEvent)
            .getNewValue();

    // when
    ctrl.processValueChange(mockedEvent);

    // then
    assertNotNull(model.getSelectedGroup());
    assertEquals(operationGroups.get("OPERATIONS_ORGANIZATION_ADMIN")
            .split(",").length, model.getAvailableOperations().size());
    assertEquals(Boolean.FALSE,
            Boolean.valueOf(ctrl.isAllServicesSelected()));

}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:24,代碼來源:ExportAuditLogDataCtrlTest.java

示例8: processValueChange_SelectAll

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
@Test
public void processValueChange_SelectAll() {
    // given
    availableOperations.clear();
    operationGroups.clear();
    givenGroupedOperations();
    model.setSelectedGroup(null);
    model.setOperationGroups(operationGroups);
    model.setOperations(availableOperations);
    ValueChangeEvent mockedEvent = mock(ValueChangeEvent.class);
    doReturn(OPERATIONS_ALL).when(mockedEvent).getNewValue();

    // when
    ctrl.processValueChange(mockedEvent);

    // then
    assertEquals(16, model.getAvailableOperations().size());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:19,代碼來源:ExportAuditLogDataCtrlTest.java

示例9: processValueChange_EmptyOperationsOfOperationGroups

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
@Test
public void processValueChange_EmptyOperationsOfOperationGroups() {
    // given
    availableOperations.clear();
    operationGroups.put(SUBSCRIBE_SERVICE, "");
    model.setOperationGroups(operationGroups);
    model.setOperations(availableOperations);
    model.setSelectedGroup(null);
    ValueChangeEvent mockedEvent = mock(ValueChangeEvent.class);
    doReturn(OPERATIONS_ALL).when(mockedEvent).getNewValue();

    // when
    ctrl.processValueChange(mockedEvent);

    // given
    model.setOperationGroups(operationGroups);

    // when
    ctrl.processValueChange(mockedEvent);

    // then
    assertEquals(0, model.getAvailableOperations().size());
    assertEquals(Boolean.FALSE,
            Boolean.valueOf(ctrl.isAllServicesSelected()));
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:26,代碼來源:ExportAuditLogDataCtrlTest.java

示例10: serviceChanged_Error

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
@Test
public void serviceChanged_Error() throws Exception {
    // given
    ctrl.initializePartnerServiceView();
    ctrl.partnerServices = mock(PartnerService.class);
    doThrow(new ServiceStateException()).when(ctrl.partnerServices)
            .getServiceDetails(3L);

    // when
    ctrl.serviceChanged(new ValueChangeEvent(new UIComponentStub(null),
            null, Long.valueOf(3)));

    // then
    assertEquals(0L, ctrl.getModel().getSelectedServiceKey());
    assertEquals(0L, ctrl.getModel().getPartnerServiceDetails()
            .getServiceKey());
    List<RoleSpecificPrice> rolePrices = ctrl.getModel().getRolePrices();
    assertEquals(new ArrayList<RoleSpecificPrice>(), rolePrices);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:20,代碼來源:PartnerServiceViewCtrlTest.java

示例11: billingTypeChanged

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
@Test
public void billingTypeChanged() {
    // given
    UIInput input = mock(UIInput.class);
    ValueChangeEvent e = new ValueChangeEvent(input, null,
            BillingDataType.RevenueShare);

    // when
    ctrl.billingTypeChanged(e);

    // then
    assertEquals(BillingDataType.RevenueShare,
            model.getSelectedBillingDataType());
    assertNull(model.getFromDate());
    assertNull(model.getToDate());
    assertNull(model.getSelectedSharesResultType());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:18,代碼來源:ExportBillingDataCtrlTest.java

示例12: processValueChange_ObjectNotFoundException

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
@Test
public void processValueChange_ObjectNotFoundException() throws Exception {
    ValueChangeEvent eventMock = mock(ValueChangeEvent.class);
    doReturn("newMarketplaceId").when(eventMock).getNewValue();

    doThrow(new ObjectNotFoundException()).when(marketplaceServiceMock)
    .getBrandingUrl("newMarketplaceId");

    doReturn(marketplaceServiceMock).when(categoryBean)
    .getMarketplaceService();
    doThrow(new ObjectNotFoundException()).when(marketplaceServiceMock)
    .getMarketplaceById("newMarketplaceId");

    categoryBean.processValueChange(eventMock);
    assertEquals(0, facesMessages.size());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:17,代碼來源:CategoryBeanTest.java

示例13: makeChanged

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
public void makeChanged(ValueChangeEvent vce)
{
     
  if ("".equals(vce.getNewValue()))
    _modelItems.setValue(Collections.EMPTY_LIST);
    
  Object newValue = vce.getNewValue();
  if (newValue instanceof Car)
  {
    String newCar = ((Car)newValue).getName();
    if ("cordera".equals(newCar))
      _modelItems.setValue(_CORDERA_MODELS);
    else if ("autumno".equals(newCar))
      _modelItems.setValue(_AUTUMNO_MODELS);
    else if ("grabowski".equals(newCar))
      _modelItems.setValue(_GRABOWSKI_MODELS);
  }
    
  _options.setValue(null);
  _price.setValue(null);
  _launchOptions.setDisabled(true);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:23,代碼來源:CarBackingBean.java

示例14: updateSelectedTemplate

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
public void updateSelectedTemplate(ValueChangeEvent event) {

        selectedTemplate = (Template) event.getNewValue();
        if (selectedTemplate != null) {
            workingVersion = dataset.getEditVersion(selectedTemplate);
            updateDatasetFieldInputLevels();
        } else {
            dataset = new Dataset();
            dataset.setOwner(dataverseService.find(ownerId));
            workingVersion = dataset.getCreateVersion();
            updateDatasetFieldInputLevels();

            dataset.setIdentifier(datasetService.generateIdentifierSequence(protocol, authority, separator));
        }
        resetVersionUI();
    }
 
開發者ID:pengchengluo,項目名稱:Peking-University-Open-Research-Data-Platform,代碼行數:17,代碼來源:DatasetPage.java

示例15: userTypeChanged

import javax.faces.event.ValueChangeEvent; //導入依賴的package包/類
public void userTypeChanged(ValueChangeEvent event) {
    if ((UserType) event.getNewValue() == UserType.ORDINARY) {
        if (this.builtinUser != null) {
            this.builtinUser.setUserType(UserType.ORDINARY);
        }
        if (this.pkuIAAAUser != null) {
            this.pkuIAAAUser.setUserType(UserType.ORDINARY);
        }
    } else {
        if (this.builtinUser != null) {
            this.builtinUser.setUserType(UserType.ADVANCE);
        }
        if (this.pkuIAAAUser != null) {
            this.pkuIAAAUser.setUserType(UserType.ADVANCE);
        }
    }
    FacesContext.getCurrentInstance().renderResponse();
}
 
開發者ID:pengchengluo,項目名稱:Peking-University-Open-Research-Data-Platform,代碼行數:19,代碼來源:BuiltinUserPage.java


注:本文中的javax.faces.event.ValueChangeEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。