Moved form events inside conditional that is used when using discrete applet UI forms rather than docked forms.