Hey community,
again and again these annoying checkboxes 
I would like to select (de-selection is easy) all checkboxes in a CMS_INPUT_CHECKBOX per FS_BUTTON:
Formular:
<CMS_INPUT_CHECKBOX name="pt_checkbox" useLanguages="no">
<ENTRIES>
<ENTRY value="A">
<LANGINFOS>
<LANGINFO lang="*" label="A"/>
</LANGINFOS>
</ENTRY>
<ENTRY value="B">
<LANGINFOS>
<LANGINFO lang="*" label="B"/>
</LANGINFOS>
</ENTRY>
<ENTRY value="C">
<LANGINFOS>
<LANGINFO lang="*" label="C"/>
</LANGINFOS>
</ENTRY>
</ENTRIES>
<LANGINFOS>
<LANGINFO lang="*" label="the options"/>
</LANGINFOS>
</CMS_INPUT_CHECKBOX>
<FS_BUTTON name="pt_select" allowEmpty="yes" onClick="script:select_all" useLanguages="no">
<LANGINFOS>
<LANGINFO lang="*" label="select all"/>
</LANGINFOS>
<PARAMS>
<PARAM name="check">#field.pt_checkbox</PARAM>
</PARAMS>
</FS_BUTTON>
Script "select_all":
context.logInfo("checked 1 = " + theCheckbox.get());
Set theSet = new HashSet();
theSet.add("A");
theSet.add("C");
theCheckbox.set(theSet);
context.logInfo("checked 2 = " + theCheckbox.get());
No rocket science, but after clicking the button nothing happens :smileydevil:. The log says everything is ok, the selection works, but does not have any effect in the formular.
INFO 06.02.2013 15:17:00.543 (de.espirit.firstspirit.access.BaseContextImpl): checked 1 = []
INFO 06.02.2013 15:17:00.543 (de.espirit.firstspirit.access.BaseContextImpl): checked 2 = [A, C]
When I try to update an CMS_INPUT_FIELD per script everything works fine.
Where is the mistake? Any hints?
I guess this is the same error Re: Scripting: Zugriff auf die Werte einer CMS_INPUT_CHECKBOX, but Reza's solution doesn't work for me, because I NEED a Button to select....
Thanks & greets,
Steffi
FirstSpirit 4.2.484.54957