cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript error while invoking applet method

shaji_chandran
Participant
0 Kudos

Hi All,

I am using some javascript to handle the applet in an irpt file. When I invoke the method getRowCount() on an applet(document.appletname.getRowCount()) I am getting the below error. But this error comes only when my network bandwidth is low. When my network bandwidht is high I am not getting this error. Does anyone know how to handle this error .

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Timestamp: Wed, 6 Jul 2011 03:31:28 UTC

Message: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

Line: 192

Char: 2

Code: 0

Thanks in advance

Shaji

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Have you tried following code:

document.AppletName.getGridObject().getRowCount()

also test on IE.

hope this helps!!

Regards,

Manoj Bilthare

shaji_chandran
Participant
0 Kudos

Hi Manoj,

Thanks for your quick response. I have tried your suggession but I got an error as Object doesn't support this property or method.

Thanks

Shaji

Former Member
0 Kudos

Hi,

Which version of MII you are using?

I have tested below code it works for me on MII 12.0.9

document.AppletName.getGridObject().getRowCount()

I got object doesnt support this property error when i used below code

document.AppletName.getRowCount()

As per my understanding getRowCount() is a method of iGrid so you have to use getGridObject().

Hope this helps!!

Regards,

Manoj Bilthare

shaji_chandran
Participant
0 Kudos

Hi Manoj,

Thanks again for your response. I am using MII version 12.1.6 Build(91). The issue is on faster network it works fine. But it gives IndexOutofBoundsException on slower network connection. getRowCount() method is working fine on applet object.

Shaji

shaji_chandran
Participant
0 Kudos

Hi Manoj,

I would like to add one more thing. The getRowCount() method I am using to find out the number of records return by the query which is attached to the applet.

Regards

Shaji

shaji_chandran
Participant
0 Kudos

Hi,

Below is my code where I am using an ICommand Applet to execute a query in the database and fetch the records. When I try to find the total number of records returns by the query in the IRPT page using document.SearchData.getRowCount() I am getting the below error. When I run thru citrix everything is working fine. But when I run thru Lan I am getting this error

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Timestamp: Wed, 6 Jul 2011 03:31:28 UTC

Message: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

Line: 192

Char: 2

Code: 0

Applet code in IRPT file

-


<APPLET NAME="SearchData" CODEBASE="/XMII/Classes" CODE="iCommand" ARCHIVE="illum8.zip" WIDTH="1" HEIGHT="1" MAYSCRIPT>

<PARAM NAME = "QueryTemplate" VALUE="XXXXX_ProcessMessages/XX_Integration/XXXXX/Receiver/GUI_IN/GUIQuery_IN">

<PARAM NAME = "DisplayTemplate" VALUE="XXXX_ProcessMessages/XX_Integration/XXXXX/Receiver/GUI_IN/GUI_IN_iCommand">

<PARAM NAME="InitialUpdate" VALUE="false">

<PARAM NAME="UpdateEvent" VALUE="displayResults">

</APPLET>

Regards

Shaji

Edited by: Shajikc on Jul 6, 2011 4:35 PM

agentry_src
Active Contributor
0 Kudos

Hi Shaji,

getRowCount() should return the setting from the query RowCount (allowed number of rows returned). I don't think it will get you what you want.

However if you use a simple xPath expression, you should get the number of rows returned.



SQLQuery_0.Results{count(/Rowsets/Rowset/Row)}

Former Member
0 Kudos

Hi Shaji,

Have you tried document.SearchData.getQueryObject().getRowCount() ?

Hope this helps.

Regards,

Musarrat

Former Member
0 Kudos

Hi Shaji,

Change the CODE="iCommand" to CODE="iGrid" in the applet script and use document.SearchData.getGridObject().getRowCount()

This will return the number of records fetched by the query used with the applet.

Johnson

jcgood25
Active Contributor
0 Kudos

It would appear that in 12.1 the indexoutofbounds error is caused when you call the document.iCommand.getRowCount() method before the query has executed and returned a dataset (which is the default behavior - no query execution until you call the .executeCommand() method).

I would classify this as a bug - it should probably return 0 and not throw a javascript error, please log this as a customer support ticket for correction.

Former Member
0 Kudos

Hi All,

Just a little side note - the iCommand supports only the CreationEvent.

Regards,

Diana Hoppe

jcgood25
Active Contributor
0 Kudos

Update summary from development in the customer ticket:

"This would work; use getColumnCount() rather than getRowCount()"

"The error from getRowCount() will be fixed as part of 12.1 SP10 and 12.2 SP3"

Regards,

Jeremy