Examples of HtmlSelectOneRadio


Examples of javax.faces.component.html.HtmlSelectOneRadio


    @Override
    protected UIComponent createComponentToTest()
    {
        UIComponent component = new HtmlSelectOneRadio();
        UISelectItem item = new UISelectItem();
        item.setItemValue("value1");
        component.getChildren().add(item);
        return component;
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneRadio

    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
    }

    @Override
    protected void doDecode(FacesContext context, UIComponent component) {
        HtmlSelectOneRadio radio = (HtmlSelectOneRadio) component;
        if (radio.isReadonly() || radio.isDisabled() || !component.isRendered()) {
            return;
        }
        super.doDecode(context, component);
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneRadio

  @SuppressWarnings("unchecked")
  public void testRISelectOneRadio() throws IOException
  {
    //
    HtmlSelectOneRadio radio = new HtmlSelectOneRadio();
    radio.setValue(new Integer(2));
    for (int i = 0 ; i < 10; i++)
    {
      UISelectItem selectItem  = new UISelectItem();
      selectItem.setItemLabel("Item " + i);
      selectItem.setItemValue("" + i);
      radio.getChildren().add(selectItem);
    }

    UIViewRoot root = createTestTree(radio, "testRISelectOneRadio");
    renderRoot(root);
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneRadio

   
    Sections exclusive = getExclusiveSiblings(schema);
    boolean bIsFirstExclusive = (exclusive.size() > 0) &&
                                (this == exclusive.values().iterator().next());
    if (bIsFirstExclusive) {
      HtmlSelectOneRadio radio = new HtmlSelectOneRadio();
      radio.setId(sRadioId);
      radio.setStyleClass("optionalSectionHeader");
      radio.setOnclick(sbOnclick.toString());
      ArrayList<SelectItem> radioItems = new ArrayList<SelectItem>();
      UISelectItems uiItems = new UISelectItems();
      uiItems.setValue(radioItems);
      radio.getChildren().add(uiItems);
      panel.getChildren().add(radio);
      int nIdx = 0;
      for (Section sibling: exclusive.values()) {
        String sItemLabel = "";
        String sItemId = sibling.getFacesId();
        if (sibling.getLabel() != null) {
          sItemLabel = msgBroker.retrieveMessage(sibling.getLabel().getResourceKey());
        }
        if (sItemLabel.length() == 0) {
          sItemLabel = sibling.getKey();
        }
        radioItems.add(new SelectItem(sItemId,sItemLabel));
        if (sibling.getOpen()) {
          radio.setValue(sItemId);
        }
        nIdx++;
      }
    }
   
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneRadio

    boolean bIsFirstExclusive = (exclusive.size() > 0) &&
                                (this == exclusive.values().iterator().next());
    if (bIsFirstExclusive) {
      component = editorForm.findComponent(sRadioId);
      if ((component != null) && (component instanceof HtmlSelectOneRadio)) {
        HtmlSelectOneRadio radio = (HtmlSelectOneRadio)component;
        if ((radio.getValue() != null) && (radio.getValue() instanceof String)) {
          String sChosenId = Val.chkStr((String)radio.getValue());
          for (Section sibling: exclusive.values()) {
            boolean bOpen = sChosenId.equals(sibling.getFacesId());
            sibling.setOpen(bOpen);
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.