I am studying this tutorial and I cannot find the source codes.
I am having problems with this the chapter 9 of this tutorial.
It do not work! I have tried to debug the code and seems the createTypeResultSet() method dont run.
In the variation on this tutorial the objective is to set a default type.
It seems that the code of the tutorial dont't work.
protected void initTypeListControl()
{
super.initTypeListControl();
if ( isDirectory() == false)
//set your default type
DataDropDownList typeList = getTypeListControl(true);
String strDefaultType = getConfigDefaultType();
String teste = typeList.getValue();
System.out.println("getValue: " + teste);
typeList.setValue(strDefaultType);
teste = typeList.getValue();
System.out.print("Default type: " + strDefaultType);
}
The execution of this method send to the output:
getValue: null
getValue: dm_xml_style_sheet
Default type: dm_xml_style_sheet
But the type that appears first selected is Document.
Can anyone help me?
I solve this problem put the code that sets the default type in onInit method. I think this tutorial is wrong because after we set the default type in initTypeListControl the default type is override to Document by other method.
public void onInit(ArgumentList arg)
System.out.println("onInit");
super.onInit(arg);
The output for the code above is:
******onInit
initTypeListControl
createTypesResultSet
Default type reset to: dm_xml_style_sheet
getValue: dm_document