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


Java HtmlSelectBooleanCheckbox类代码示例

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


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

示例1: onCheckboxHeaderClicked

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的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);
		}
	}
}
 
开发者ID:fpuna-cia,项目名称:karaku,代码行数:23,代码来源:KarakuCheckListController.java

示例2: Switch

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的package包/类
public Switch() {
	super();
	setRendererType(SwitchRenderer.RENDERER_TYPE);
	checkbox = new HtmlSelectBooleanCheckbox();
	checkbox.setId("checkbox");
	getChildren().add(checkbox);
}
 
开发者ID:edvin,项目名称:tornadofaces,代码行数:8,代码来源:Switch.java

示例3: getRowCell

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的package包/类
/**
		 * This returns the actual Faces component for each cell.
		 * 
		 * @param rowId
		 *            The String name for the row being constructed (to be put
		 *            in column 0)
		 * 
		 * @param colNumber
		 *            Which column are we currently constructing
		 * 
		 * @param select
		 *            Whether the checkbox should be checked or not (ignored for
		 *            column 0)
		 * 
		 * @return Object Either the component passed in (column = 0) or a
		 *         HtmlSelectBooleanCheckbox (every other column)
		 */
		private Object getRowCell(String rowId, int colNumber, boolean select) {

			if (colNumber == 0) {
				// first column of row, add rowId
/*				HtmlOutputText labelCell = new HtmlOutputText();
				ValueBinding aRow = FacesContext.getCurrentInstance()
										.getApplication()
											.createValueBinding("#{" + firstColumnBindingVar + "}");
				labelCell.setValueBinding("value", aRow);

				return labelCell;
*/				return rowId;
			} 
			else {
				// Create a checkbox
				HtmlSelectBooleanCheckbox checkboxCell = new HtmlSelectBooleanCheckbox();

				checkboxCell.setSelected(select);
//				checkboxCell.setSubmittedValue(rowId + "_" + colNumber);
				checkboxCell.setRendererType("javax.faces.Checkbox");

				ValueBinding aRow = FacesContext.getCurrentInstance()
										.getApplication()
											.createValueBinding("#{" + checkboxBindingVar + "[" + (colNumber-1) + "]}");
				checkboxCell.setValueBinding("value", aRow);

				// create MethodBinding so when checkbox checked, can process it
				// Class [] classArray = new Class[1];
				// classArray[0] = new ValueChangeEvent(checkboxCell,
				// Boolean.FALSE, Boolean.FALSE);

				// MethodBinding mb =
				// FacesContext.getCurrentInstance().getApplication().createMethodBinding("processCheckboxStateChange",
				// classArray);
				// checkboxCell.setValueChangeListener(mb);
				return checkboxCell;

			}

		}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:58,代码来源:podPermBean.java

示例4: getCheckbox

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的package包/类
public HtmlSelectBooleanCheckbox getCheckbox() {
	return checkbox;
}
 
开发者ID:edvin,项目名称:tornadofaces,代码行数:4,代码来源:Switch.java

示例5: JsfCheckboxRenderer

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的package包/类
public JsfCheckboxRenderer(JsfCheckboxModel model) {
	super(HtmlSelectBooleanCheckbox.COMPONENT_TYPE, model, Boolean.class);
}
 
开发者ID:Doctusoft,项目名称:jsf-builder,代码行数:4,代码来源:JsfCheckboxRenderer.java

示例6: makeInputComponent

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的package包/类
/**
 * Makes a Faces HtmlPanelGroup of HtmlSelectBooleanCheckbox components
 * for a parameter.
 * <p/>
 * The check boxes are based upon the defined codes for the parameter.
 * <p/>
 * The multiple values associated with the parameter 
 * (parameter.getMultipleValues()) are used to establish the 
 * selected/unselected status for each check box.
 * @param context the UI context
 * @param section the parent section
 * @param parameter the associated parameter
 * @return the UI component
 */
public UIComponent makeInputComponent(UiContext context,
                                      Section section,
                                      Parameter parameter) {
  
  // initialize the panel
  MessageBroker msgBroker = context.extractMessageBroker();
  HtmlPanelGroup panel = new HtmlPanelGroup();
  String sIdPfx = getFacesId();
  panel.setId(sIdPfx);
  
  // build a map of values
  HashMap<String,String> valuesMap = new HashMap<String,String>();
  for (ContentValue value: parameter.getContent().getMultipleValues()) {
    valuesMap.put(value.getValue(),"");
  }
  
  // add a checkbox for each code
  Codes codes = parameter.getContent().getCodes();
  for (Code code: codes.values()) {
    
    // make the checkbox
    String sKey = code.getKey();
    String sFKey = sKey.replace('.','_');
    sFKey = sKey.replace(':','_');
    String sId  = sIdPfx+"-"+sFKey;
    HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
    checkBox.setId(sId);
    checkBox.setDisabled(!getEditable());
    checkBox.setSelected(valuesMap.containsKey(sKey));
    checkBox.setOnchange(getOnChange());
    checkBox.setOnclick(getOnClick());
    panel.getChildren().add(checkBox);
    
    // make the label
    String sLabel = sKey;
    String sResKey = code.getResourceKey();
    if (sResKey.length() > 0) {
      sLabel = msgBroker.retrieveMessage(sResKey);
    }
    HtmlOutputLabel outLabel = new HtmlOutputLabel();
    // even label has to have unique id (for GlassFish)
    outLabel.setId(sId+"label");
    outLabel.setFor(sId);
    outLabel.setValue(sLabel);
    panel.getChildren().add(outLabel);
    panel.getChildren().add(makeBR());
  } 

  return panel;
}
 
开发者ID:GeoinformationSystems,项目名称:GeoprocessingAppstore,代码行数:65,代码来源:InputSelectManyCheckbox.java

示例7: setCheckbox

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的package包/类
public void setCheckbox(HtmlSelectBooleanCheckbox checkbox) {
    this.checkbox = checkbox;
}
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:4,代码来源:CartActionBean.java

示例8: getCheckbox

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的package包/类
public HtmlSelectBooleanCheckbox getCheckbox() {
    return _checkbox;
}
 
开发者ID:NCIP,项目名称:nci-value-set-editor,代码行数:4,代码来源:ValueSetBean.java

示例9: setCheckbox

import javax.faces.component.html.HtmlSelectBooleanCheckbox; //导入依赖的package包/类
public void setCheckbox(HtmlSelectBooleanCheckbox checkbox) {
    _checkbox = checkbox;
}
 
开发者ID:NCIP,项目名称:nci-value-set-editor,代码行数:4,代码来源:ValueSetBean.java


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