issue with application

Hi,

at a certain point in our application we get a “java.lang.IllegalArgumentException: setSelectedIndex: 0 out of bounds” error.

If i look in the log i see the follwowing error :

Any ideas what the problem is ??

java.lang.IllegalStateException: Cannot bundle 'added' event with 'removed' events 
     at com.servoy.j2db.util.Zte.fireIntervalAdded(Zte.java:73) 
     at javax.swing.DefaultListModel.addElement(Unknown Source) 
     at com.servoy.j2db.dataprocessing.Zue.Za(Zue.java:2) 
     at com.servoy.j2db.dataprocessing.Zue.fill(Zue.java:167) 
     at com.servoy.j2db.dataprocessing.Zue.Zf(Zue.java:57) 
     at com.servoy.j2db.dataprocessing.Zue.foundSetChanged(Zue.java:170) 
     at com.servoy.j2db.dataprocessing.FoundSet.Za(FoundSet.java:364) 
     at com.servoy.j2db.dataprocessing.Zpb.Za(Zpb.java:24) 
     at com.servoy.j2db.dataprocessing.FoundSet.Zb(FoundSet.java:1730) 
     at com.servoy.j2db.dataprocessing.RelatedFoundSet.Zb(RelatedFoundSet.java:145) 
     at com.servoy.j2db.dataprocessing.RelatedFoundSet.getSize(RelatedFoundSet.java:198) 
     at com.servoy.j2db.dataprocessing.Zpb.getSize(Zpb.java:79) 
     at com.servoy.j2db.dataprocessing.FoundSet.getRecords(FoundSet.java:394) 
     at com.servoy.j2db.dataprocessing.Zue.getRelatedRecords(Zue.java:158) 
     at com.servoy.j2db.dataprocessing.Zue.Za(Zue.java:41) 
     at com.servoy.j2db.dataprocessing.Zue.fill(Zue.java:167) 
     at com.servoy.j2db.util.Zoe.Za(Zoe.java:73) 
     at com.servoy.j2db.dataui.Zke.setRecord(Zke.java:28) 
     at com.servoy.j2db.dataprocessing.Zgb.Za(Zgb.java:146) 
     at com.servoy.j2db.dataui.Zcf.Za(Zcf.java:34) 
     at com.servoy.j2db.Zzf.Zb(Zzf.java:52) 
     at com.servoy.j2db.Zzf.valueChanged(Zzf.java:33) 
     at com.servoy.j2db.Zzf.Za(Zzf.java:11) 
     at com.servoy.j2db.Zzf.setModel(Zzf.java:103) 
     at com.servoy.j2db.Zub.Za(Zub.java:452) 
     at com.servoy.j2db.dataui.Zdf.notifyVisible(Zdf.java:39) 
     at com.servoy.j2db.dataui.Zff.notifyVisible(Zff.java:368) 
     at com.servoy.j2db.dataprocessing.Zgb.Za(Zgb.java:208) 
     at com.servoy.j2db.dataui.Zcf.notifyVisible(Zcf.java:153) 
     at com.servoy.j2db.Zub.Za(Zub.java:1285) 
     at com.servoy.j2db.dataui.Zdf.notifyVisible(Zdf.java:39) 
     at com.servoy.j2db.dataui.Zff.stateChanged(Zff.java:218) 
     at com.servoy.j2db.dataui.Zgf.setSelectedIndex(Zgf.java:81) 
     at com.servoy.j2db.dataui.Zgf.addTab(Zgf.java:62) 
     at com.servoy.j2db.dataui.Zff.addTab(Zff.java:322) 
     at com.servoy.j2db.dataui.Zff.js_addTab(Zff.java:301) 
     at sun.reflect.GeneratedMethodAccessor492.invoke(Unknown Source) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
     at java.lang.reflect.Method.invoke(Unknown Source) 
     at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179) 
     at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353) 
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666) 
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680) 
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166) 
     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387) 
     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127) 
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165) 
     at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:120) 
     at com.servoy.j2db.scripting.Zub.executeFunction(Zub.java:1) 
     at com.servoy.j2db.Zub.Za(Zub.java:638) 
     at com.servoy.j2db.Zub.Za(Zub.java:943) 
     at com.servoy.j2db.Zac.Za(Zac.java:3) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:16) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:60) 
     at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:6) 
     at com.servoy.j2db.dataui.Zh.mouseReleased(Zh.java:3) 
     at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) 
     at java.awt.Component.processMouseEvent(Unknown Source) 
     at javax.swing.JComponent.processMouseEvent(Unknown Source) 
     at java.awt.Component.processEvent(Unknown Source) 
     at java.awt.Container.processEvent(Unknown Source) 
     at java.awt.Component.dispatchEventImpl(Unknown Source) 
     at java.awt.Container.dispatchEventImpl(Unknown Source) 
     at java.awt.Component.dispatchEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 
     at java.awt.Container.dispatchEventImpl(Unknown Source) 
     at java.awt.Window.dispatchEventImpl(Unknown Source) 
     at java.awt.Component.dispatchEvent(Unknown Source) 
     at java.awt.EventQueue.dispatchEvent(Unknown Source) 
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
     at java.awt.EventDispatchThread.run(Unknown Source)

Maybe your are using setSelectedIndex in a zero based loop?

Thanks Nicola,

but that is not the issue.

I discovered that it is caused by the following line in an onShow event method of a form :

result=databaseManager.refreshRecordFromDatabase(bcom_update_val_betapersoonsrollen, -1);

if I comment this line the error is gone.

The code updates a small view ( 40 records )
We do this because updates on underlying tables of a view are not seen by Servoy.

Regards,

Hans

This is the same issue as discussed in this thread: viewtopic.php?t=13849

Rob

Rob,

Thanks !!

Any date for 5.1.1 ???

Regards,