B4J Question Where to add @RaiseSynchronousEvent?

B4JExplorer

Active Member
Licensed User
Longtime User
Hi,

It's mentioned in other posts, to add this annotation. But I'm not clear on where to put it, without generating a syntax error.

If I put the annotation in the Project Attributes, it says that this attribute isn't supported. Sorry, I'm not yet familiar with B4J annotations.

Also, in conjunction with this in another post, it's also mentioned to add an event sub sw_checkedchange(), but I'm not sure about the parameters to this.


Specifically, what I'm trying to do, is shift focus to a combo box, after a key is pressed. The keypress is working fine, but when after this line is hit (in Debug mode, of course):

B4X:
cb_History.RequestFocus


that error we're familiar with,

Unexpected event (missing RaiseSynchronousEvents): txt_test_focuschanged

is returned. txt_test_focuschanged is defined but empty, thus:

B4X:
Sub txt_test_FocusChanged (HasFocus As Boolean)
	
End Sub

Is there a way to avoid this error, in debug mode? Or do we still just ignore it? And where do you put annotations in general? They belong in the Project Attributes, correct?
 

B4JExplorer

Active Member
Licensed User
Longtime User
It should be added in Java libraries.

You can ignore this warning. It means that in debug time the event will only be raised after the current code completes while in release mode it will be raised immediately.
So that's still true? Ok, thanks Erel.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…