I’m not sure what you are trying to test or get an understanding of, exactly… How a widget in a repeater gets and loses focus? When the Got Focus and Lost Focus events get triggered? I can’t see how your file tests any of that specifically, though… Could you explain in general what you are trying to do with this?
From the Axure documentation for Widgets, and Layer Order,
-
Focus: Gives a widget browser focus, moving the text cursor onto text-input widgets and highlighting clickable widgets.
-
Layer order, or “z-index,” also determines the tab order for widgets that can be navigated with the TAB key in the web browser, such as form widgets like text fields and droplists. The TAB key focuses the backmost widget first and moves progressively forward.
When you have multiple focusable widgets on a page, only one widget may be focused at a time. You can create an interactive style effect for the Focused state of a widget, so that when it receives focus it can look a certain way.
When the Tab key is pressed, the next focusable widget will receive focus and Shift+Tab focuses the previously focused widget. The “tab order” or list of focusable widgets starts from the bottommost focusable widget on your page. For example, if you had 3 text fields in a form, First Name, Last Name, Email, and want the user to be able to tab to them in order, you’d want to organize your widgets so Email is above Last Name, above First Name in your Outline pane. It is worth noting that most browsers will focus their own interactive features–part of their app chrome–such as the URL field, buttons, etc. AND the Axure prototype player will typically be part of this, depending on which panes are visible. If you want to keep the tab order focused (pun intended) on your prototype and not include the player and browser chrome, you’ll need to include a Lost Focus event on the last focusable widget (or at least the last widget you want to be focused in a Tab key press) that puts the focus on the first focusable widget, so in the example above, it would look like,
Email Text Field
Lost Focus
Focus
First Name Text Field
However, when focusable widgets are in a repeater, the tab order progresses from the first visible row to the last visible row. …Unless you have code that specifically overrides the focused widget, which you do. In your repeater, when a row’s text field gets focus–or loses focus–it edits its own row data. This causes the repeater to load all of its items (rows), which is why you see it executing a bunch of Got Focus and Lost Focus events. Any time a repeater is touched–editing row data, sorting, filtering, adding/removing rows, etc. it causes it to be completely rebuilt, which will fire the Item Loaded event for each row in the repeater.
I don’t see any value in trying to change or even track the focused widget and row via the repeater’s dataset. As soon as the Edit Row Data action is fired, the focused widget will lose focus. If you want to track which row currently has a focused widget, you could mark that row when its widget gets focus–actually, first unmark all rows, then mark “this” row. …or maybe try unmarking “this” row in the Lost Focus event. Marking and unmarking rows don’t trigger a repeater rebuild.
Additionally, I don’t think all your Wait 10ms actions are really doing anything, and you don’t need the second “Case 1” conditional case to set the text of your widget to “unfocused” --just set that text value by default.