Skip to Content
0
Former Member
Apr 16, 2009 at 10:54 AM

ArrayIndexoOutOfBoundsException

27 Views

Hi,

I have a Webdynpro application which uses MDM4J APIs. I need to extract the field values based on some other field value from the same table.

Ex: I need to populate a Drop Down box with 2 field values namely Name and ID separeted by comma.

Although all the records have value for name, ID is not compulsory.

I am using the following code, but getting an exception.

A2iValueArray dropDownValues;

A2iValueArray dropDownValuesID;

try

{

dropDownValues =

catalog.GetDistinctValues(

tableName,

fieldName,

0,

Integer.MAX_VALUE);

for (int i = 0; i < dropDownValues.GetSize(); i++)

{

if(wdContext.currentContextElement ().getVa_Action_Selected().equals(

"Allocate An Associate"))

{

dropDownValuesID =

catalog.GetDistinctValues(

tableName,

"Project_ID",

i,

1);

modifiableValuSet.put(

dropDownValues.GetValueAt(i).GetStringValue() + "," +

dropDownValuesID.GetValueAt(0).GetStringValue(),

dropDownValues.GetValueAt(i).GetStringValue() + "," +

dropDownValuesID.GetValueAt(0).GetStringValue());

}

else

{

modifiableValuSet.put(

dropDownValues.GetValueAt(i).GetStringValue(),

dropDownValues.GetValueAt(i).GetStringValue());

}

}

}

I am getting the following exception:

java.lang.java.lang.ArrayIndexoOutOfBoundsException: 0>=0

Please suggest where i am making teh mistake in the code.

Regards,