code: private void initDurationButtonGroup() {
  
          m_groupDuration = new CmsRadioButtonGroup();
  
          m_endsAfterRadioButton = new CmsRadioButton(
              EndType.TIMES.toString(),
              Messages.get().key(Messages.GUI_SERIALDATE_DURATION_ENDTYPE_OCC_0));
          m_endsAfterRadioButton.setGroup(m_groupDuration);
          m_endsAtRadioButton = new CmsRadioButton(
              EndType.DATE.toString(),
              Messages.get().key(Messages.GUI_SERIALDATE_DURATION_ENDTYPE_DATE_0));
          m_endsAtRadioButton.setGroup(m_groupDuration);
          m_groupDuration.addValueChangeHandler(new ValueChangeHandler<String>() {
  
              public void onValueChange(ValueChangeEvent<String> event) {
  
                  if (handleChange()) {
                      String value = event.getValue();
                      if (null != value) {
                          m_controller.setEndType(value);
                      }
                  }
              }
          });
  
      }
docs: Configure all UI elements in the "ending"-options panel.