I am trying to retrieve select option values of Static select Widget using below code:
Code:
AttributeDefinitionData add=ctdObj.getData().getAttributeDefinition( "MYSELECT" );
Map widgetData = add.getWidgetDataMap();
String widgetXML=add.getWidgetData();
WCMStaticSelectWidget s1= new WCMStaticSelectWidget(widgetXML);
out.println( "SIZE " +s1.getSelectOptionCount()+s1.getVisible());
Iterator itr=s1.getSelectOptions();
out.println( "SELECT VALUES = " );
while (itr.hasNext()) {
Object element = itr.next();
out.print(element.toString()); }
Output:
SIZE 5 true
SELECT VALUES = null null null null null
I have checked in the vgnAsAttrDef table, the widgetdata column has all the select values in it. When I print the WidgetDataMap and WidgetXML none of the Select values are being displayed. Where as Size of the Static Select widget is being returned correct but the option values are null.
Am I missing something in the code?