udg Expert Licensed User Longtime User Mar 15, 2019 #1 Hi all, today I'm experimenting with the XUI Views lib (1.87) and received the following error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Sub xcbcateg_selectedindexchanged was not found. I don't need to track each index change event so I don't add what the error clearly indicates. Is it a "bug" (no check in the lib whether the method exist before calling it), is it a requisite (having that sub in my code) or whatever?
Hi all, today I'm experimenting with the XUI Views lib (1.87) and received the following error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Sub xcbcateg_selectedindexchanged was not found. I don't need to track each index change event so I don't add what the error clearly indicates. Is it a "bug" (no check in the lib whether the method exist before calling it), is it a requisite (having that sub in my code) or whatever?
DonManfred Expert Licensed User Longtime User Mar 15, 2019 #2 Just add the event. You can leave the sub "empty" if you do not need it. But having the event sub in the code prevents the error. Upvote 0
Just add the event. You can leave the sub "empty" if you do not need it. But having the event sub in the code prevents the error.
G GuyBooth Active Member Licensed User Longtime User Mar 15, 2019 #3 DonManfred said: But having the event sub in the code prevents the error. Click to expand... This is not normal behaviour, if we had to do this for every unused event our code would be crawling with unfilled subs. Sounds like a bug to me, and definitely undesirable. Upvote 0
DonManfred said: But having the event sub in the code prevents the error. Click to expand... This is not normal behaviour, if we had to do this for every unused event our code would be crawling with unfilled subs. Sounds like a bug to me, and definitely undesirable.
LucaMs Expert Licensed User Longtime User Mar 16, 2019 #4 udg said: Is it a "bug" (no check in the lib whether the method exist before calling it) Click to expand... Simply add the check to the class module. [For newbies - replace the RaiseEvent routine with: Code: Copy Private Sub RaiseEvent If SubExists(mCallBack, mEventName & "_SelectedIndexChanged") Then CallSub2(mCallBack, mEventName & "_SelectedIndexChanged", getSelectedIndex) End If End Sub ] Last edited: Mar 16, 2019 Upvote 0
udg said: Is it a "bug" (no check in the lib whether the method exist before calling it) Click to expand... Simply add the check to the class module. [For newbies - replace the RaiseEvent routine with: Code: Copy Private Sub RaiseEvent If SubExists(mCallBack, mEventName & "_SelectedIndexChanged") Then CallSub2(mCallBack, mEventName & "_SelectedIndexChanged", getSelectedIndex) End If End Sub ]