Flex Repeater events

Hi
I am using flex repeater.
When I get a click event on the flex repeater, is there any way I can identify which of the instances generated the click?
Reason is, when I add the instances to the flex repeater I add some additional attributes to the instance and I would like to access these attributes from the click

Thanks

See this post for how to allow the instanced View to self-report a click event and how to inform the Flex Repeater: How to get the View Canvas selected instance index number - #2 by cmallonee

Thank you

  1. Does this apply to Flex Repeater?
  2. You say in How to get the View Canvas selected instance index number that " The Flex Repeater does have an onInstanceClick Event" but I cannot find that event

All need to do is identify which instance on Flex Repeater initiated the click. Maybe messaging is the way to go?

Thanks

See also my suggestion in Perspective Text Field Numeric Keypad - #41 by Transistor.

The suggestion I linked was actually not the "answer" I thought it was - I've answered this question or a similar way of asking it to many times to count here on the forums.

I don't see an onInstanceClicked Event for the Flex Repeater, and I should amend that post.

For the Flex Repeater, you're most likely going to need to have the instanced View "broadcast" that is has been clicked by placing an onClick Event on the root node of the View. That onClick Event should invoke system.perspective.sendMessage with a scope of "page". The Flex Repeater should have a configured Message Handler tied to the same message type as the sendMessage function you will be invoking in the instanced View.

# onClick Event in View
system.perspective.sendMessage("VIEW_CLICKED", payload={"index": self.view.params.index, "someOtherValue": self.view.params.someOtherValue}, scope="page")
# message handler on Flex Repeater
system.perspective.print(payload["someOtherValue"])
1 Like