This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 9, 2012, 9:31 AM
68 Posts
topic has been resolvedResolved

Saving values of repeted radio button groups, checkbox groups etc.

  • Category: Server Side JavaScript
  • Platform: Linux
  • Release: 8.5.3
  • Role: Developer,Administrator
  • Tags:
  • Replies: 29
Hi all.
 
I have a problem that I cannot solve with any known me methods that's why I want ask you for help. 
 
Here is screen shot  of my Xpage:
 
 
As you can see I have here repeat control that contains radio buttons, checkbox, lists. I thought that simple: radioGroup1.getValue().toString(); etc. will work but I was wrong. I just want get all values from repeat control and save them to other document. Saving is not problem here but getting values is ... So if you can help me please, I would be more than happy. It could even save all values to arrary, list something that I can work with. 
 
Here is preview of this page:
 
May 9, 2012, 10:19 AM
126 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
Can you provide a code sample of what your trying to do, I don't quite understand the issue
May 9, 2012, 12:34 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
Hi Simon. I glad to see you here. 
 
 
 In xAnkieta_Podglad (xPage) I want to make button1 to save choices. The problem is pretty simple I don't know how to get values from radio buttons list when they are repeat (by control). 
 
Here is simple picture of what I want to do:
 
May 9, 2012, 12:35 PM
126 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
There is server side javascript    
 
getComponent(<id>).getValue() 
 
is this what your looking for?  generally there is an issue in repeats where if you call getComponent() for one control it will return all the repeated instances of that control, however it sounds like this is infact what your looking for no? as this would return the values of those controls which you could then add to a domino doc and save etc.
 
(haven't looked at the app yet, if this is wrong ill take a look) 
 
Simon 
May 9, 2012, 12:53 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
I'm using something like this:
 
var radioGroup1:com.ibm.xsp.component.xp.XspSelectOneRadio = getComponent("radioGroup1");
var newPytanieDoc = database.createDocument();
newPytanieDoc.appendItemValue("Form", "fWyslaneOdpowiedzi");
newPytanieDoc.appendItemValue("OdpowiedzID", radioGroup1.getValue());
newPytanieDoc.appendItemValue("WybraneOdpowiedzi", radioGroup1.getValue());
newPytanieDoc.save();

 
But this don't work. It create empty document. You write something about ID but how to get this (if its number or something). In java I would make simple for loop and get all values. Here I must say that I have no idea how to get them all.
May 9, 2012, 1:13 PM
126 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
ok so getComponent() takes the id of the control, so when you create a radioGroup you will see something like:
 
<xp:radioGroup id="radio1" ..... 
 
this is the id you pass into getComponent(). So what you would do is call
 
getComponent("radio1").getValue();
 
if this is giving you an empty document when you save then I would print it out to the console to see what you are getting.
 
e.g. 
 
var val =  getComponent("radio1").getValue();
print("selected value: " + val); 
 
this will now print to the server console so you can see is the issue with saving / getting the data. 
 
Now seperate to this is the issue i mentioned with the repeat. In a repeat say you have 5 rows, each one with a radioGroup all have the same id of "radio1", so calling
 
getComponenent("radio1") ;
 
could be returning 5 radio groups instead of 1. So your issue may be that you think your getting a single control / value, but your getting an array of controls / values. This is why you should print out what your trying to put in the document to see what the issue is. As well you mentioned that you have multiple controls that your trying to get so simply call this function for each control.
 
e.g. 
 
var chk = getComponent('checkbox1').getValue(); 
var radio = getComponent('radio1').getValue(); 
.... 
.... 
 
doc.replaceItem("field1", chk); 
doc.replaceItem("field2", radio); 
May 9, 2012, 2:25 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
Simon, I know that this may be weird or maybe I don't understand your point at all but such a command:
 
 
Is simply returning null, not array not single value just null... That is my problem I cant get single radio button when I'm using radio button list (or I simply don't know how). 

I looked at the source code after compiling and its pretty strange let me show you: 
 
<fieldset id="view:_id1:repeat1:0:radioGroup1" class="xspRadioButton"><table class="xspRadioButton">
	<tr>
<td>
<label><input type="radio" name="view:_id1:repeat1:0:radioGroup1" value="1"> 1</input></label></td>
	</tr>
	<tr>
<td>
<label><input type="radio" name="view:_id1:repeat1:0:radioGroup1" value="2"> 2</input></label></td>
	</tr>
<fieldset id="view:_id1:repeat1:1:radioGroup1" class="xspRadioButton"><table class="xspRadioButton">
	<tr>
<td>
<label><input type="radio" name="view:_id1:repeat1:1:radioGroup1" value="asd"> asd</input></label></td>
	</tr>
	<tr>
<td>
<label><input type="radio" name="view:_id1:repeat1:1:radioGroup1" value="zxc"> zxc</input></label></td>
	</tr>
 
I underline names. They are generated like automaticly, but with some kind of index values which I don't know how to get.
 
 
May 9, 2012, 2:34 PM
17 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
 Put the below code in onChange event of the radioGroup :
var thisVal = getComponent("radioGroup1").getValue();
viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
if (thisVal != null) {
//repeatIndex = Index name set on the repeat control.
viewScope.radioVals.put(repeatIndex,thisVal );
} else {
viewScope.radioVals.put(repeatIndex, '<No Value>');
}

Then modify the SSJS code for save/submit button like below:
var _radioVals = viewScope.radioVals.values().toArray().join(',');
var newPytanieDoc = database.createDocument();
newPytanieDoc.appendItemValue("Form", "fWyslaneOdpowiedzi");
newPytanieDoc.appendItemValue("OdpowiedzID", _radioVals);
newPytanieDoc.appendItemValue("WybraneOdpowiedzi", _radioVals);
newPytanieDoc.save();
viewScope.remove('radioVals');

It should work. I did the same thing for combo box. There are issues in IE for onchange event of radio. 
Test it out and let us know.
May 9, 2012, 2:59 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
It is almost working it get values but it get values of last (not empty) radio button values. For example like in this case when I'm having this control repeated 2times its only get values of second.
 
Here is screen:
 
May 9, 2012, 3:06 PM
126 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
Sry I couldn't get the app to work, the XPage only shows a single button, couldn't debug it.
 
Seems like you got a little further but now you are facing the issue i mentioned previously where getComponent() is returning all the radioGroups, in some cases the action executed will execute on all of them in others it will only happen on the last. When using repeats you will need to maintain an array or a map of the values.  
 
AdiBabu K    suggested this to you above. The code he suggested to put in the onChange event is what you need to do. This will maintain a hashMap with the values, where the key will be the row of the repeat control. This is the only way it will work. The templates that ship with upgrade pack one do this also with creating a javascript file for this sole purpose. You will need to add them to the hashMap and then pull out each value you need in the button on click and then pass it into the feilds in the domino document.
May 9, 2012, 3:15 PM
17 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
May be the issue with using repeatIndex as the key for viewScope. Try using collection name of the repeat as the keym like below. 
 
var thisVal = getComponent("radioGroup1").getValue();
viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
if (thisVal != null) {
//repeatCollection = collecton Name set on the repeat control.
viewScope.radioVals.put(repeatCollection,thisVal );
} else {
viewScope.radioVals.put(repeatCollection, '<No Value>');
}
 
Please test it out and let us know. 

May 9, 2012, 3:23 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
 
To get working this page go to ->  xAnkiety_Lista -> Chose "Ankieta 3" -> then press Button "Label". It is related with document above. I don't know how to get previous values from this hashMap I tried used this like an Array but even function .lenght don't work.
May 9, 2012, 3:35 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
AdiBabu K the same as in previous case. Maybe I'm not as good as you but don't we need some kind of loop to save or get other values ?
May 9, 2012, 3:52 PM
17 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
 Try the below code and let us know the result.
 
<xp:repeat id="r1" rows="2" value="#{javascript:['1','2']}" var="entry" indexVar="index">
<xp:this.facets>
<xp:text disableTheme="true" xp:key="header" escape="false">
<xp:this.value><![CDATA[<table>]]></xp:this.value>
</xp:text>
<xp:text disableTheme="true" xp:key="footer" escape="false">
<xp:this.value><![CDATA[</table>]]></xp:this.value>
</xp:text>
</xp:this.facets>
<xp:tr>
<xp:td>
<xp:radioGroup id="radioGroup1">
<xp:selectItem itemLabel="a" itemValue="a"></xp:selectItem>
<xp:selectItem itemLabel="b" itemValue="b"></xp:selectItem>
<xp:eventHandler event="onchange" submit="true" refreshMode="complete"
rendered="#{javascript:!context.getUserAgent().isIE()}">
<xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("radioGroup1").getValue();
viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
viewScope.radioVals.put(entry, (thisVal == null ? '<No Value>' : thisVal));
}]]></xp:this.action>
</xp:eventHandler>
<xp:eventHandler event="onclick" submit="true" refreshMode="complete"
rendered="#{javascript:context.getUserAgent().isIE()}">
<xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("radioGroup1").getValue();
viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
viewScope.radioVals.put(entry, (thisVal == null ? '<No Value>' : thisVal));
}]]></xp:this.action>
</xp:eventHandler>
</xp:radioGroup>
</xp:td>
</xp:tr>
</xp:repeat>
<xp:button value="save" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:getComponent('inputText1').setValue(viewScope.radioVals.values().toArray().join(','))}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:inputText id="inputText1"></xp:inputText>
 
May 9, 2012, 5:46 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
It works rly fine in your example only when I want to "bind" it to my data I got error500 while selecting and I can't locate error: (repete control seems to be problem)
 
Here is code:
 
<xp:repeat id="r1" var="pytanie" indexVar="index">
        <xp:this.facets>
            <xp:text disableTheme="true" xp:key="header"
                escape="false">
                <xp:this.value><![CDATA[<table>]]></xp:this.value>
            </xp:text>
            <xp:text disableTheme="true" xp:key="footer"
                escape="false">
                <xp:this.value><![CDATA[</table>]]></xp:this.value>
            </xp:text>
        </xp:this.facets>
        <xp:this.value><![CDATA[#{javascript:var pytaniaView = database.getView("vPytania");
pytaniaView.refresh();
return pytaniaView.getAllDocumentsByKey(AnkietaPodglad_Document.getNoteID(),true);}]]></xp:this.value>
        <xp:tr>
            <xp:td>
                <xp:radioGroup id="radioGroup1">


                    <xp:eventHandler event="onchange" submit="true"
                        refreshMode="complete"
                        rendered="#{javascript:!context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("radioGroup1").getValue();
viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
viewScope.radioVals.put(pytanie, (thisVal == null ? '<No Value>' : thisVal));
}]]></xp:this.action>
                    </xp:eventHandler>
                    <xp:eventHandler event="onclick" submit="true"
                        refreshMode="complete"
                        rendered="#{javascript:context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("radioGroup1").getValue();
viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
viewScope.radioVals.put(pytanie, (thisVal == null ? '<No Value>' : thisVal));
}]]></xp:this.action>
                    </xp:eventHandler>
                    <xp:selectItems>
                        <xp:this.value><![CDATA[#{javascript:var docArray = new Array();
var odpowiedz_PytanieID = new String();
var odpowiedz_Tresc_Odpowiedz = new String();
var PytanieID = pytanie.getNoteID();

var Odpowiedzi_View:NotesView = database.getView("vOdpowiedzi");
var Odpowiedzi_Doc:NotesDocument = Odpowiedzi_View.getFirstDocument();

    while (Odpowiedzi_Doc != null){
        if (Odpowiedzi_Doc.getItemValueString("PytanieID").endsWithIgnoreCase(PytanieID)) {
            odpowiedz_PytanieID = Odpowiedzi_Doc.getNoteID();
            odpowiedz_Tresc_Odpowiedz = Odpowiedzi_Doc.getItemValueString("Tresc_Odpowiedz");
            docArray.push(odpowiedz_Tresc_Odpowiedz+"|"+odpowiedz_Tresc_Odpowiedz);
        }
    Odpowiedzi_Doc = Odpowiedzi_View.getNextDocument(Odpowiedzi_Doc);   
    }

    Odpowiedzi_Doc = Odpowiedzi_View.getFirstDocument();

return docArray}]]></xp:this.value>
                    </xp:selectItems>
                </xp:radioGroup>
            </xp:td>
        </xp:tr>
    </xp:repeat>
 
EDIT1:
 
Seems that this lane is problem (still don't know how to solve this)
 
                    <xp:eventHandler event="onchange" submit="true"
                        refreshMode="complete"
                        rendered="#{javascript:!context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("radioGroup1").getValue();
viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
viewScope.radioVals.put(pytanie, (thisVal == null ? '<No Value>' : thisVal));
}]]></xp:this.action>
                    </xp:eventHandler>
May 9, 2012, 6:21 PM
17 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
 Here's the enhanced code:
                    <xp:eventHandler event="onchange" submit="true"
                        refreshMode="complete"
                        rendered="#{javascript:!context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("radioGroup1").getValue();
viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
viewScope.radioVals.put(pytanie, thisVal);
}]]></xp:this.action>
                    </xp:eventHandler>
 
The binding error which you're getting is nothing to do with the above code. Give a try... 
May 9, 2012, 6:44 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
Still same error I tried this on my own, but for 100% sure I copied your code and its still error 500
 
AdiBabu K rly thanks for all help from you ... Without you I would never even dream about solving this
May 9, 2012, 8:26 PM
17 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
 Final Vesion....
 
<xp:repeat id="r1" var="pytanie" indexVar="index">
        <xp:this.facets>
            <xp:text disableTheme="true" xp:key="header"
                escape="false">
                <xp:this.value><![CDATA[<table>]]></xp:this.value>
            </xp:text>
            <xp:text disableTheme="true" xp:key="footer"
                escape="false">
                <xp:this.value><![CDATA[</table>]]></xp:this.value>
            </xp:text>
        </xp:this.facets>
        <xp:this.value><![CDATA[#{javascript:var pytaniaView = database.getView("vPytania");
pytaniaView.refresh();
return pytaniaView.getAllDocumentsByKey(AnkietaPodglad_Document.getNoteID(),true);}]]></xp:this.value>
        <xp:tr>
            <xp:td>
                <xp:radioGroup id="radioGroup1">
                    <xp:eventHandler event="onchange" submit="true"
                        refreshMode="complete"
                        rendered="#{javascript:!context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
viewScope.radioVals.put(index, getComponent("radioGroup1").getSubmittedValue());
}]]></xp:this.action>
                    </xp:eventHandler>
                     <xp:selectItems>
                        <xp:this.value><![CDATA[#{javascript:var docArray = [];
var noteID = pytanie.getNoteID();
var vw:NotesView = database.getView("vOdpowiedzi");
var doc:NotesDocument = vw.getFirstDocument();
while (doc != null){
    var isMatch = doc.getItemValueString("PytanieID").endsWithIgnoreCase(PytanieID);
    if (isMatch)  docArray.push(doc.getItemValueString("Tresc_Odpowiedz"));
    var tmpDoc = vw.getNextDocument(doc);
    doc.recycle();
    doc = tmpDoc;
}
return docArray}]]></xp:this.value>
                    </xp:selectItems>
                </xp:radioGroup>
            </xp:td>
        </xp:tr>
    </xp:repeat> 
May 9, 2012, 9:14 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
I made some changes before it start working I bold and underline them:
 
<xp:repeat id="r1" var="pytanie" indexVar="index">
        <xp:this.facets>
            <xp:text disableTheme="true" xp:key="header"
                escape="false">
                <xp:this.value><![CDATA[<table>]]></xp:this.value>
            </xp:text>
            <xp:text disableTheme="true" xp:key="footer"
                escape="false">
                <xp:this.value><![CDATA[</table>]]></xp:this.value>
            </xp:text>
        </xp:this.facets>
        <xp:this.value><![CDATA[#{javascript:var pytaniaView = database.getView("vPytania");
pytaniaView.refresh();
return pytaniaView.getAllDocumentsByKey(AnkietaPodglad_Document.getNoteID(),true);}]]></xp:this.value>
        <xp:tr>
            <xp:td>
                <xp:radioGroup id="radioGroup1">
                    <xp:eventHandler event="onchange" submit="true"
                        refreshMode="complete"
                        rendered="#{javascript:!context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
//viewScope.radioVals.put(index, getComponent("radioGroup1").getSubmittedValue());
viewScope.radioVals.put(index, getComponent("radioGroup1").getValue());}]]></xp:this.action>
                    </xp:eventHandler>
                    <xp:selectItems>
                        <xp:this.value><![CDATA[#{javascript:var docArray = [];
var noteID = pytanie.getNoteID();
var vw:NotesView = database.getView("vOdpowiedzi");
var doc:NotesDocument = vw.getFirstDocument();
while (doc != null){
    var isMatch = doc.getItemValueString("PytanieID").endsWithIgnoreCase(noteID);
    if (isMatch)  docArray.push(doc.getItemValueString("Tresc_Odpowiedz"));
    var tmpDoc = vw.getNextDocument(doc);
    doc.recycle();
    doc = tmpDoc;
}
return docArray}]]></xp:this.value>
                    </xp:selectItems>
                </xp:radioGroup>
            </xp:td>
        </xp:tr>
    </xp:repeat> 
 
This is working so really thanks for help :) I Gave code for rest of people maybe they will use it someday. Thanks for help. If you can see any bug or something write here. 
 
Edit:
 One strange thing is that after using save button it add values in strange order but at this time the order isn't important for me :)
May 10, 2012, 9:19 AM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
I don't want to create new topic but problem with checkbox groups seems to be even bigger ...
 
Code:
 
<xp:repeat id="r1" var="pytanie" indexVar="index">
        <xp:this.facets>
            <xp:text disableTheme="true" xp:key="header"
                escape="false">
                <xp:this.value><![CDATA[<table>]]></xp:this.value>
            </xp:text>
            <xp:text disableTheme="true" xp:key="footer"
                escape="false">
                <xp:this.value><![CDATA[</table>]]></xp:this.value>
            </xp:text>
        </xp:this.facets>
        <xp:this.value><![CDATA[#{javascript:var pytaniaView = database.getView("vPytania");
pytaniaView.refresh();
return pytaniaView.getAllDocumentsByKey(AnkietaPodglad_Document.getNoteID(),true);}]]></xp:this.value>
        <xp:tr>
            <xp:td>
                <xp:radioGroup id="radioGroup1" layout="lineDirection">
                    <xp:this.rendered><![CDATA[#{javascript:if(pytanie.getItemValueString("Typ_Pytanie").equals("tak_nie")){
    return true;
}
else
{
    return false;
}}]]></xp:this.rendered>
                    <xp:eventHandler event="onchange" submit="true"
                        refreshMode="complete"
                        rendered="#{javascript:!context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
//viewScope.radioVals.put(index, getComponent("radioGroup1").getSubmittedValue());
viewScope.radioVals.put(index, getComponent("radioGroup1").getValue());}]]></xp:this.action>
                    </xp:eventHandler>
                    <xp:selectItems>
                        <xp:this.value><![CDATA[#{javascript:var docArray = [];
var noteID = pytanie.getNoteID();
var vw:NotesView = database.getView("vOdpowiedzi");
var doc:NotesDocument = vw.getFirstDocument();
while (doc != null){
    var isMatch = doc.getItemValueString("PytanieID").endsWithIgnoreCase(noteID);
    if (isMatch)  docArray.push(doc.getItemValueString("Tresc_Odpowiedz"));
    var tmpDoc = vw.getNextDocument(doc);
    doc.recycle();
    doc = tmpDoc;
}
return docArray}]]></xp:this.value>
                    </xp:selectItems>
                </xp:radioGroup>
            </xp:td>
        </xp:tr>
        <xp:checkBoxGroup id="checkBoxGroup1">
            <xp:this.rendered><![CDATA[#{javascript:if(pytanie.getItemValueString("Typ_Pytanie").equals("wielk_wyb")){
    return true;
}
else
{
    return false;
}}]]></xp:this.rendered>
            <xp:selectItems>
                <xp:this.value><![CDATA[#{javascript:var docArray = [];
var noteID = pytanie.getNoteID();
var vw:NotesView = database.getView("vOdpowiedzi");
var doc:NotesDocument = vw.getFirstDocument();
while (doc != null){
    var isMatch = doc.getItemValueString("PytanieID").endsWithIgnoreCase(noteID);
    if (isMatch)  docArray.push(doc.getItemValueString("Tresc_Odpowiedz"));
    var tmpDoc = vw.getNextDocument(doc);
    doc.recycle();
    doc = tmpDoc;
}
return docArray}]]></xp:this.value>
            </xp:selectItems>
           
            <xp:eventHandler event="onchange" submit="true"
                refreshMode="complete">
                <xp:this.action><![CDATA[#{javascript:viewScope.checkVals =  viewScope.checkVals || new java.util.HashMap();
//viewScope.radioVals.put(index, getComponent("radioGroup1").getSubmittedValue());
viewScope.checkVals.put(index, getComponent("checkBoxGroup1").getValue());}]]></xp:this.action>
            </xp:eventHandler></xp:checkBoxGroup>
        <xp:br></xp:br></xp:repeat>
 
 
 
The code is pretty same like in radio buttons I just simple changed variable names and commented radioGroup functions and I discovered a pretty bad bug. 
 
1. When there is only 1 repeat of radiobutton list this script don't wrok
2. Same with checkbox list if only 1 repeat don't work.
3. From checkbox list it take only last checkbox list values.
 
Here is screen that will explain all:
 
http://dl.dropbox.com/u/16887656/ibm/sceen2.PNG
May 10, 2012, 2:28 PM
126 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
What do you mean by "script don't work". Does it not run? , throw error? , return wrong value ? etc.
 
Also have you tried using "print()" to debug the issue and see whats happening.
 
e.g.  
print("CheckVals: " + viewScope.checkVals); 
print("Index: " + index); 
print("Current Value: " + getComponent.........); 
 
 
*This will all print to the server console* 
May 10, 2012, 2:29 PM
17 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
 Here's the code to handle Checkboxes..
 
<xp:repeat id="r1" rows="2" value="#{javascript:['1','2']}" var="entry" indexVar="index">
<xp:this.facets>
<xp:text disableTheme="true" xp:key="header" escape="false">
<xp:this.value><![CDATA[<table>]]></xp:this.value>
</xp:text>
<xp:text disableTheme="true" xp:key="footer" escape="false">
<xp:this.value><![CDATA[</table>]]></xp:this.value>
</xp:text>
</xp:this.facets>
<xp:tr>
<xp:td>
<xp:checkBoxGroup id="checkBoxGroup1">
<xp:selectItem itemLabel="a" itemValue="a"></xp:selectItem>
<xp:selectItem itemLabel="b" itemValue="b"></xp:selectItem>
<xp:eventHandler event="onchange" submit="true" refreshMode="complete"
rendered="#{javascript:!context.getUserAgent().isIE()}">
<xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("checkBoxGroup1").getValue();
viewScope.checkBoxVals =  viewScope.checkBoxVals || new java.util.HashMap();
if(thisVal == (null||'')){
if (viewScope.checkBoxVals.containsKey(index)) viewScope.checkBoxVals.remove(index);
}else {
viewScope.checkBoxVals.put(index, thisVal.join('~'));
}
}]]></xp:this.action>
</xp:eventHandler>
<xp:eventHandler event="onclick" submit="true" refreshMode="complete"
rendered="#{javascript:context.getUserAgent().isIE()}">
<xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("checkBoxGroup1").getValue();
viewScope.checkBoxVals =  viewScope.checkBoxVals || new java.util.HashMap();
if(thisVal == (null||'')){
if (viewScope.checkBoxVals.containsKey(index)) viewScope.checkBoxVals.remove(index);
}else {
viewScope.checkBoxVals.put(index, thisVal.join('~'));
}
}]]></xp:this.action>
</xp:eventHandler>
</xp:checkBoxGroup>
</xp:td>
</xp:tr>
</xp:repeat>
<xp:button value="save" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:getComponent('inputText1').setValue(viewScope.checkBoxVals.values().toArray().join(','))}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:inputText id="inputText1"></xp:inputText> 
May 10, 2012, 6:32 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
To Simon McLoughlin: I know that such a thing exist but I will tell you true. I have installed Domino Designer, Notes, Server in one pack and I simply don't know how to get console of local server.
 
 
I made for you whole of test to show you the problem look at screens:
 
Checkbox (solo):
 
 
As you can see to this moment all work fine.
 
Radio buttons (solo):
 
 
Checkbox + Radio button:
 
http://dl.dropbox.com/u/16887656/ibm/test/cr1.PNG (Don't get value of first radio button)
http://dl.dropbox.com/u/16887656/ibm/test/cr2.PNG (Error 500 1st Radio checked 2nd unchecked)
http://dl.dropbox.com/u/16887656/ibm/test/cr3.PNG (Surprise it's ok when 1st radio is unchecked and 2nd is checked)
http://dl.dropbox.com/u/16887656/ibm/test/cr4.PNG (2 radio buttons uchecked -> error500
 
Code Hidden behind this monster (Checkbox + Radio):
 
 <xp:repeat id="r1" var="pytanie" indexVar="index">
            <xp:this.facets>
                <xp:text disableTheme="true" xp:key="header"
                    escape="false">
                    <xp:this.value><![CDATA[<table>]]></xp:this.value>
                </xp:text>
                <xp:text disableTheme="true" xp:key="footer"
                    escape="false">
                    <xp:this.value><![CDATA[</table>]]></xp:this.value>
                </xp:text>
            </xp:this.facets>
            <xp:this.value><![CDATA[#{javascript:var pytaniaView = database.getView("vPytania");
pytaniaView.refresh();
return pytaniaView.getAllDocumentsByKey(AnkietaPodglad_Document.getNoteID(),true);}]]></xp:this.value>
            <xp:tr>
                <xp:td>
                    <xp:checkBoxGroup id="checkBoxGroup1">


                        <xp:this.rendered><![CDATA[#{javascript:if(pytanie.getItemValueString("Typ_Pytanie").equals("wielk_wyb")){
    return true;
}
else
{
    return false;
}}]]></xp:this.rendered>
                        <xp:eventHandler event="onchange" submit="true"
                            refreshMode="complete"
                            rendered="#{javascript:!context.getUserAgent().isIE()}">
                            <xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("checkBoxGroup1").getValue();
viewScope.checkBoxVals =  viewScope.checkBoxVals || new java.util.HashMap();
if(thisVal == (null||'')){
if (viewScope.checkBoxVals.containsKey(index)) viewScope.checkBoxVals.remove(index);
}else {
viewScope.checkBoxVals.put(index, thisVal.join('~'));
}
}]]></xp:this.action>
                        </xp:eventHandler>
                        <xp:eventHandler event="onclick" submit="true"
                            refreshMode="complete"
                            rendered="#{javascript:context.getUserAgent().isIE()}">
                            <xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("checkBoxGroup1").getValue();
viewScope.checkBoxVals =  viewScope.checkBoxVals || new java.util.HashMap();
if(thisVal == (null||'')){
    if (viewScope.checkBoxVals.containsKey(index))
    {
         viewScope.checkBoxVals.remove(index);
    }
}
else
{
    viewScope.checkBoxVals.put(index, thisVal.join('~'));
}
}]]></xp:this.action>
                        </xp:eventHandler>
                        <xp:selectItems>
                            <xp:this.value><![CDATA[#{javascript:var docArray = [];
var noteID = pytanie.getNoteID();
var vw:NotesView = database.getView("vOdpowiedzi");
var doc:NotesDocument = vw.getFirstDocument();
while (doc != null){
    var isMatch = doc.getItemValueString("PytanieID").endsWithIgnoreCase(noteID);
    if (isMatch)  docArray.push(doc.getItemValueString("Tresc_Odpowiedz"));
    var tmpDoc = vw.getNextDocument(doc);
    doc.recycle();
    doc = tmpDoc;
}
return docArray}]]></xp:this.value>
                        </xp:selectItems>
                    </xp:checkBoxGroup>
                </xp:td>
            </xp:tr>
            <xp:radioGroup id="radioGroup1" layout="lineDirection">
                    <xp:this.rendered><![CDATA[#{javascript:if(pytanie.getItemValueString("Typ_Pytanie").equals("tak_nie")){
    return true;
}
else
{
    return false;
}}]]></xp:this.rendered>
                    <xp:eventHandler event="onchange" submit="true" refreshMode="complete" rendered="#{javascript:!context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
//viewScope.radioVals.put(index, getComponent("radioGroup1").getSubmittedValue());
viewScope.radioVals.put(index, getComponent("radioGroup1").getValue());}]]></xp:this.action>
                    </xp:eventHandler>
                    <xp:selectItems>
                        <xp:this.value><![CDATA[#{javascript:var docArray = [];
var noteID = pytanie.getNoteID();
var vw:NotesView = database.getView("vOdpowiedzi");
var doc:NotesDocument = vw.getFirstDocument();
while (doc != null){
    var isMatch = doc.getItemValueString("PytanieID").endsWithIgnoreCase(noteID);
    if (isMatch)  docArray.push(doc.getItemValueString("Tresc_Odpowiedz"));
    var tmpDoc = vw.getNextDocument(doc);
    doc.recycle();
    doc = tmpDoc;
}
return docArray}]]></xp:this.value>
                    </xp:selectItems>
                </xp:radioGroup></xp:repeat>
        <xp:button value="save" id="button1">
            <xp:eventHandler event="onclick" submit="true"
                refreshMode="complete">
                <xp:this.action><![CDATA[#{javascript:getComponent('inputText1').setValue(viewScope.checkBoxVals.values().toArray().join(','))
getComponent('inputText2').setValue(viewScope.radioVals.values().toArray().join(','))
}]]></xp:this.action>
            </xp:eventHandler>
        </xp:button>
<xp:br></xp:br><xp:br></xp:br>Checkbox Values:&#160;<xp:inputText id="inputText1"></xp:inputText><xp:br></xp:br>Radiobutton Values:
    <xp:inputText id="inputText2"></xp:inputText>
 
 
 
May 10, 2012, 8:01 PM
17 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
 I don't think Error 500 was caused by the code i provided. You need some error logging ( i use OpenLog for Xpages) framework and a debug tool (to see values in Scope variables). Do you have any of them?. 
It's not possible to resolve the issue with out looking into the design of your database.  
May 11, 2012, 7:51 AM
126 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
When I installed my server it prompted me with an option to either launch as a service or run manually as a program.
 
If you are running as a service I would recommend you turn this off as its easier for a few reasons the other way. 
 
However if you want to keep it that way you should have 3 shortcuts on your desktop. Lotus Domino Server, Lotus Domino Console and Lotus Domino Admin. the console is exactly what it says a console window that lets you connect to a server. Domino Admin is a toll to manage server settings but it also has a console window to record a servers output, its not as good as the other ways but should work.
 
my recommendation would be to turn it off as a service and launch manually because this means there will always be a console window, you can easily restart it by closing the window and reopening etc. 
May 11, 2012, 1:16 PM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
Ok I found some kind of debug way (Xpages Debug Toolbar but still its not perfect):
 
1. Pressing Radio button (in repeat 0.0) - no reaction at all in datasable
 
 
 2. Pressed second radio button there is reaction and its good reaction.
 
3. Pressed second radio button other value there is reaction and its good reaction.
 
 
4. Pressed firstradio button other value there is no reaction (even not created viewScope)
 
 
5.That's why this debug way isn't so good the true value of this radioVals at index 2 is (2-1) as you can see there is no even value at index 0.
 
May 11, 2012, 8:29 PM
17 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
 Please create a Custom Control named _ScopeVariables using the below source code.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">
<xp:this.resources>
<xp:styleSheet href="/debug.css"></xp:styleSheet>
</xp:this.resources>
<xp:section id="sectionScopeVariables" header="Scope Variables" initClosed="true" headerStyle="font-weight:bold;"
styleClass="sectionScopeVariables">
<xp:tabbedPanel id="tabbedPanel1">
<xp:tabPanel label="_sessionVars" id="tabPanel1" style="margin-left:15px">
<xp:panel id="applicationVars" styleClass="debugPanel">
<xp:table styleClass="xspDumpTable" rendered="#{javascript:!applicationScope.isEmpty()}">
<xp:tr styleClass="xspDumpTR">
<th colspan="2" class="xspDumpTDTitle">applicationScope</th>
</xp:tr>
<xp:repeat id="repeatApplicationVars" rows="30" value="#{javascript:applicationScope.keySet();}"
var="scopeData">
<xp:tr styleClass="xspDumpTR">
<xp:td styleClass="xspDumpTDName">
<xp:text escape="true" id="computedField1" value="#{javascript:scopeData}" />
</xp:td>
<xp:td styleClass="xspDumpTDValue">
<xp:text escape="true" id="computedField2"
value="#{javascript:applicationScope.get(scopeData)}" />
</xp:td>
</xp:tr>
</xp:repeat>
</xp:table>
</xp:panel>
<xp:panel id="sessionVars" styleClass="debugPanel">
<xp:table styleClass="xspDumpTable" rendered="#{javascript:!sessionScope.isEmpty()}">
<xp:tr styleClass="xspDumpTR">
<th colspan="2" class="xspDumpTDTitle">sessionScope</th>
</xp:tr>
<xp:repeat id="repeatSessionVars" rows="30" value="#{javascript:sessionScope.keySet();}"
var="scopeData">
<xp:tr styleClass="xspDumpTR">
<xp:td styleClass="xspDumpTDName">
<xp:text escape="true" id="varName" value="#{javascript:scopeData}" />
</xp:td>
<xp:td styleClass="xspDumpTDValue">
<xp:text escape="true" id="varValue"
value="#{javascript:sessionScope.get(scopeData)}" />
</xp:td>
</xp:tr>
</xp:repeat>
</xp:table>
</xp:panel>
<xp:panel id="viewVars" styleClass="debugPanel">
<xp:table styleClass="xspDumpTable" rendered="#{javascript:!viewScope.isEmpty()}">
<xp:tr styleClass="xspDumpTR">
<th colspan="2" class="xspDumpTDTitle">viewScope</th>
</xp:tr>
<xp:repeat id="repeatViewVars" rows="30" value="#{javascript:viewScope.keySet();}"
var="scopeData">
<xp:tr styleClass="xspDumpTR">
<xp:td styleClass="xspDumpTDName">
<xp:text escape="true" id="computedField3" value="#{javascript:scopeData}" />
</xp:td>
<xp:td styleClass="xspDumpTDValue">
<xp:text escape="true" id="computedField4"
value="#{javascript:viewScope.get(scopeData)}" />
</xp:td>
</xp:tr>
</xp:repeat>
</xp:table>
</xp:panel>
<xp:panel id="requestVars" styleClass="debugPanel">
<xp:table styleClass="xspDumpTable" rendered="#{javascript:!requestScope.isEmpty()}">
<xp:tr styleClass="xspDumpTR">
<th colspan="2" class="xspDumpTDTitle">requestScope Key</th>
</xp:tr>
<xp:repeat id="repeatRequestVars" rows="30" value="#{javascript:requestScope.keySet();}"
var="scopeData">
<xp:tr styleClass="xspDumpTR">
<xp:td styleClass="xspDumpTDName">
<xp:text escape="true" id="computedField5" value="#{javascript:scopeData}" />
</xp:td>
<xp:td styleClass="xspDumpTDValue">
<xp:text escape="true" id="computedField6"
value="#{javascript:requestScope.get(scopeData)}" />
</xp:td>
</xp:tr>
</xp:repeat>
</xp:table>
</xp:panel>
</xp:tabPanel>
<xp:tabPanel label="Dump Object" id="tabPanel2" style="margin-left:15px">
<xp:repeat id="repeat1" rows="30" var="scopeName">
<xp:this.value><![CDATA[#{javascript:return ['applicationScope','sessionScope','viewScope','requestScope']}]]></xp:this.value>
<xe:dumpObject id="dumpObject1"
value="#{javascript:return eval((new String(scopeName)).toString())}" title="#{javascript:requestScope.scopeName}"
levels="1">
</xe:dumpObject>
</xp:repeat>
</xp:tabPanel>
</xp:tabbedPanel>
</xp:section>
</xp:view>
 
Here's the code for debug.css: 
<!-- Debug -->
.debugPanel {margin-top: 16px; margin-bottom: 16px; overflow-x: auto;}
table.debug {width: 100%;border-collapse: collapse;font-size: 11px;color: #B47429;margin-bottom:10px;}
table.debug th{font-weight:bold;font-size: 14px;}
table.debug td{border: solid lightgray 1px;}

.xspDumpTable{
border-width: 1px !important;
border-style: solid !important;
border-color: black !important;
border-spacing: 0px !important;
border-collapse: collapse !important;
background-color: white !important;
}
.xspDumpTR{
border-width: 1px !important;
padding: 3px !important;
}
.xspDumpTDTitle{
text-align: left;
border-width: 1px !important;
padding: 3px !important;
border-style: outset !important;
border-color: gray !important;
background-color: gray !important;
color: white !important;
font-weight:bold !important;
}
.xspDumpTDName{
width: 20em !important;
border-width: 1px !important;
padding: 2px !important;
border-style: outset !important;
border-color: gray !important;
background-color: white !important;
}
.xspDumpTDNoValue{
border-width: 1px !important;
padding: 2px !important;
border-style: outset !important;
border-color: gray !important;
background-color: white !important;
}
.xspDumpTDValue{
width: 50em !important;
border-width: 1px !important;
padding: 2px !important;
border-style: outset !important;
border-color: gray !important;
background-color: white !important;
}
.xspDumpTDCat1{
text-align: left;
border-width: 1px !important;
padding: 2px !important;
border-style: outset !important;
border-color: gray !important;
background-color: rgb(225, 225, 225) !important;
font-weight:bold !important;
}
.xspDumpTDCat2 {
text-align: left;
border-width: 1px !important;
padding: 2px !important;
border-style: outset !important;
border-color: gray !important;
background-color: white !important;
}
.xspDumpGridTable{
margin: 0px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: black !important;
border-spacing: 0px !important;
border-collapse: collapse !important;
background-color: white !important;
}
.xspDumpTDGridHeader {
border-width: 1px !important;
padding: 2px !important;
border-style: outset !important;
border-color: gray !important;
background-color: rgb(225, 225, 225) !important;
font-weight:bold !important;
}
.xspDumpTDGridValue{
border-width: 1px !important;
padding: 2px !important;
border-style: outset !important;
border-color: gray !important;
background-color: white !important;
}
 
Use that custom control in your XPage and let me know the values. 
May 12, 2012, 7:52 AM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
May 14, 2012, 9:58 AM
68 Posts
Re: Saving values of repeted radio button groups, checkbox groups etc.
Get it working. Don't know why but all radio, checkbox groups need table in them to work fine at the end it look like this:
 
<xp:repeat id="r1" var="pytanie" indexVar="index" first="0">
        <xp:this.facets>
            <xp:text disableTheme="true" xp:key="header"
                escape="false">
                <xp:this.value><![CDATA[<table>]]></xp:this.value>
            </xp:text>
            <xp:text disableTheme="true" xp:key="footer"
                escape="false">
                <xp:this.value><![CDATA[</table>]]></xp:this.value>
            </xp:text>
        </xp:this.facets>
        <xp:this.value><![CDATA[#{javascript:var pytaniaView = database.getView("vPytania");
pytaniaView.refresh();
return pytaniaView.getAllDocumentsByKey(AnkietaPodglad_Document.getNoteID(),true);}]]></xp:this.value>
       
        index =&#160;
        <xp:text escape="true" id="computedField1"
            value="#{javascript:index}">
        </xp:text>
       
         
        <xp:tr>
            <xp:td>
                <xp:table>
                    <xp:tr>
                        <xp:td><xp:checkBoxGroup id="checkBoxGroup1">


                    <xp:this.rendered><![CDATA[#{javascript:if(pytanie.getItemValueString("Typ_Pytanie").equals("wielk_wyb")){
    return true;
}
else
{
    return false;
}}]]></xp:this.rendered>
                    <xp:eventHandler event="onchange" submit="true" refreshMode="complete" rendered="#{javascript:!context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("checkBoxGroup1").getValue();
viewScope.checkBoxVals =  viewScope.checkBoxVals || new java.util.HashMap();
if(thisVal == (null||'')){
if (viewScope.checkBoxVals.containsKey(index)) viewScope.checkBoxVals.remove(index);
}else {
    viewScope.checkBoxVals.put(index, thisVal.join('~'));
    //viewScope.put("checkBoxVals", thisVal.join('~'));
    //viewScope["checkBoxVals"].put(thisVal.join('~'));
    //dBar.info("Adding: "+getComponent("checkBoxGroup1").getValue());
}}]]></xp:this.action>
                    </xp:eventHandler>
                    <xp:eventHandler event="onclick" submit="true" refreshMode="complete" rendered="#{javascript:context.getUserAgent().isIE()}">
                        <xp:this.action><![CDATA[#{javascript:var thisVal = getComponent("checkBoxGroup1").getValue();
viewScope.checkBoxVals =  viewScope.checkBoxVals || new java.util.HashMap();
if(thisVal == (null||'')){
    if (viewScope.checkBoxVals.containsKey(index))
    {
         viewScope.checkBoxVals.remove(index);
    }
}
else
{
    viewScope.checkBoxVals.put(index, thisVal.join('~'));
    //dBar.info("Adding: "+getComponent("checkBoxGroup1").getValue());
    //viewScope[index].put("checkBoxVals", thisVal.join('~'));
    //viewScope["checkBoxVals"].put(thisVal.join('~'));
}}]]></xp:this.action>
                    </xp:eventHandler>
                    <xp:selectItems>
                        <xp:this.value><![CDATA[#{javascript:var docArray = [];
var noteID = pytanie.getNoteID();
var vw:NotesView = database.getView("vOdpowiedzi");
var doc:NotesDocument = vw.getFirstDocument();
while (doc != null){
    var isMatch = doc.getItemValueString("PytanieID").endsWithIgnoreCase(noteID);
    if (isMatch)  docArray.push(doc.getItemValueString("Tresc_Odpowiedz"));
    var tmpDoc = vw.getNextDocument(doc);
    doc.recycle();
    doc = tmpDoc;
}
return docArray}]]></xp:this.value>
                    </xp:selectItems>
                </xp:checkBoxGroup>
                            </xp:td>
                    </xp:tr>
                </xp:table>
               
            </xp:td>
        </xp:tr>

       
        <xp:table>
            <xp:tr>
                <xp:td>
                    <xp:inputTextarea id="inputTextarea1"><xp:this.rendered><![CDATA[#{javascript:if(pytanie.getItemValueString("Typ_Pytanie").equals("otwarte")){
    return true;
}
else
{
    return false;
}}]]></xp:this.rendered></xp:inputTextarea></xp:td></xp:tr></xp:table><xp:table>
            <xp:tr>
                <xp:td><xp:radioGroup id="radioGroup1" layout="lineDirection">


            <xp:this.rendered><![CDATA[#{javascript:if(pytanie.getItemValueString("Typ_Pytanie").equals("tak_nie")){
    return true;
}
else
{
    return false;
}}]]></xp:this.rendered>
            <xp:selectItems>
                <xp:this.value><![CDATA[#{javascript:var docArray = [];
var noteID = pytanie.getNoteID();
var vw:NotesView = database.getView("vOdpowiedzi");
var doc:NotesDocument = vw.getFirstDocument();
while (doc != null){
    var isMatch = doc.getItemValueString("PytanieID").endsWithIgnoreCase(noteID);
    if (isMatch)  docArray.push(doc.getItemValueString("Tresc_Odpowiedz"));
    var tmpDoc = vw.getNextDocument(doc);
    doc.recycle();
    doc = tmpDoc;
}
return docArray}]]></xp:this.value>
            </xp:selectItems>
            <xp:eventHandler event="onchange" submit="true"
                refreshMode="complete">
                <xp:this.action><![CDATA[#{javascript:viewScope.radioVals =  viewScope.radioVals || new java.util.HashMap();
//viewScope.radioVals.put(index, getComponent("radioGroup1").getSubmittedValue());
viewScope.radioVals.put(index, getComponent("radioGroup1").getValue());
//dBar.info("Adding: "+getComponent("radioGroup1").getValue());

//getComponent('inputText2').setValue(getComponent("radioGroup1").getValue())}]]></xp:this.action>
            </xp:eventHandler>
</xp:radioGroup></xp:td>
            </xp:tr>
        </xp:table>
       
        </xp:repeat>
    <xp:button value="save" id="button1">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete">
            <xp:this.action><![CDATA[#{javascript:try {
    getComponent('inputText1').setValue(viewScope.checkBoxVals.values().toArray().join(','));
} catch(e) {
    getComponent('inputText1').setValue("dupa");
}

try {
    getComponent('inputText2').setValue(viewScope.radioVals.values().toArray().join(','))
} catch(e) {
    getComponent('inputText2').setValue("dupa");
}
}]]></xp:this.action>
        </xp:eventHandler>
    </xp:button>
    <xp:br></xp:br>
    <xp:br></xp:br>
    Checkbox Values:&#160;
    <xp:inputText id="inputText1"></xp:inputText>
    <xp:br></xp:br>
    Radiobutton Values:
    <xp:inputText id="inputText2"></xp:inputText>

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal