Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CheckboxGroup: How can I read the "key" and "isChecked" values

Hello experts,

on my test JSP-site, I have following groupedCheckbox:

<hbj:checkboxGroup
								               id="cgIndexes"
								               columnCount="2"
								               > 
								
								              <hbj:checkbox
								                        id="CheckCPUStat"
								                        text="CPU status"
								                        key="chk_Stat"
								                        tooltip="Check CPU status"
								                        disabled="false"
								                        checked="true"
								              />
								
								              <hbj:checkbox
								                        id="CheckCPUUsuage"
								                        text="CPU usuage"
								                        key="chk_Use"
								                        tooltip="Actual CPU usuage"
								                        disabled="false"
								                        checked="false"
								              />
								
								              <hbj:checkbox
								                        id="CheckProc"
								                        text="Processes"
								                        key="chk_Process"
								                        tooltip="Show active processes"
								                        disabled="false"
								                        checked="false"
								              />
								
								              <hbj:checkbox
								                        id="CheckProc"
								                        text="Resources"
								                        key="chk_Res"
								                        tooltip="Available resources"
								                        disabled="false"
								                        checked="true"
								              />
								
								            </hbj:checkboxGroup>

Now I want to access the GroupedCheckbox using the "getComponentByName"-function

CheckboxGroup cgIndexes = (CheckboxGroup) this.getComponentByName("cgIndexes");

cgIndexes is not null when I use "cgIndexes" as parameter but will turn into null, when I use any other parameter (foobar). So I guess, that the function is returing the "right" data..

Now I was trying to access cgIndex, but without success:

Iterator cbgIndexIterator = cgIndexes.iterator();

Iterator has no elements.....

Checkbox cbIndexes =(Checkbox) cgIndexes.getComponentForKey("chk_Stat");
cbIndexes.isChecked();

Exception in PortalRequestManager.dispatchRequest without timeout

[EXCEPTION]

java.lang.NullPointerException

Any hints for me ?

Thank you in advance

Edited by: Khaled el Taki on Sep 25, 2008 3:14 PM

Edited by: Khaled el Taki on Sep 25, 2008 3:15 PM

Edited by: Khaled el Taki on Sep 25, 2008 4:10 PM

Not what you were looking for? View more on this topic or Ask a question