Perspective - SendMessage - Flexrepeater

I’m on 8.1.11

I have some embedded view with some flexrepeater into the same page, I want to pass a message from one embeded view with flexrepeater after the repeater intances is builded to an other embeded.

The thing is that it looks liike my message is sended and the views in the flexrepreater are not availble when message pass.

Is there a way to valid that all instances are loaded before sending the message ?

1 Like

I’m going to go ahead and say no, since components are loaded in no particular order and don’t know about the states of other components. Interested in others’ thoughts though like @cmallonee

As @nminchin said, components load in an asynchronous manner. This means that there is no guarantee one component will load before another. On top of that, the number of instances could very well be variable depending on how everything is set up. Even if the number of instances in the flex repeater were some static value, the flex repeater itself only has insight into how many instances it should be rendering - not whether or not they have actually completed loading/rendering.

I’m curious about what sort of message is being sent; why do you need to wait for all instances to be loaded?

I try to find a way to secure my bindings.

I can’t figure out why my binding is fired more than one times, I have multiple embedded views with repeater that I have to pass some data and I want to get the better performance as possible.

In this example I have a view with a repeater binded to a view.params (my data) and the binding is fired 2 times instead of 1, can you explain me why ??

image

	instances = []
	
	if value is None or str(value) =="":
		return instances
	
	value = system.dataset.toPyDataSet(value)
	
	#Get and sort unique order number
	colname = "SerialNumber"
	colindex = value.getColumnIndex(colname)
	unique_order = {}
	for row in value:
		unique_order[row[colindex]] = row[colindex]
	unique_order = list(unique_order)
	unique_order.sort() 

	i=0	
	system.perspective.print("len(unique_order): " + str(len(unique_order)))
	for order in unique_order:
		data_filtered = [x for x in value if x[colname] == order]
		my_dict={}
		my_dict["item_id"] = i
		my_dict["data"] = system.dataset.toPyDataSet(system.dataset.toDataSet(system.dataset.getColumnHeaders(value), data_filtered))
		system.perspective.print("Order: " + str(order) + " => data: " + str(my_dict["data"]))
		my_dict["by_view"] = self.view.params.by_view
		my_dict["nb_cells"] = self.view.params.nb_cells
		my_dict["defects_only"] = self.view.params.defects_only
		i += 1
		instances.append(my_dict)
	return instances

What version are you using?

8.1.11

My apllication works like this:

First view get data from SQL serveur

The data is used to build the PROGRAM flexRepeater filtered by Program (each instance is a filtered dataset)

The data received by the view of the PROGRAM flexRepeater is filtered by ORDER to build an other flexRepeater

The data received by the view of the ORDER flexRepeater is filtered by View to build an other flesRepeater.

Each flexRepeater pass the filtered data to the view.params.data

image

The BUILD PROGRAM run once because it is launched by a message, ORDER and RESULT are builded by a binding on the instances of flexrepeater…