Aller au contenu principal

Select CMS_INPUT_CHECKBOX per script

Commentaires

1 commentaire

  • Zendesk API User
    Author: broszeit - 2/11/2013 13:10

    Hi Steffi,

    i asked for this problem myself and was briefed about the following issue:

    - the FormField of a checkbox contains a Set of Options but you were trying to set a Set of Strings (HashSet<String> instead of HashSet<Option>)

    In order to get the needed options you have to use the class "OptionFactory".

    The OptionFactory can be fetched with the help of the GomEditorProvider of your template:

    optionFactory = element.getFormData().getForm().findEditor("pt_checkbox").getOptionFactory()

    Afterwards you can use the OptionModel to get the Options:

    optionModel = optionFactory.getOptionModel(context,language,false);

    theSet.add(optionModel.getOption("A")) will activate the checkbox with value "A".

    If you want to activate _all_ checkboxes you can use the Iterator which is provided by the optionModel.

    Regards

    Rouven

    0

Vous devez vous connecter pour laisser un commentaire.