1

I'm developing an iOS User Control for Genexus X Ev3, is based on Maps an inherits from GXControlGridBase, the main function is to select a point in the map and return the geolocation updating Genexus attribute and launching an event showing a message with the coordinates stored in the attribute.

Searching I found this:

1- in control definition, .control file defines an event

<Events>
    <Event>EventName</Event>
</Events>

2- in Genexus code

Event Control.EventName
    ...
EndEvent

3- To trigger from Objective-C

[self fireControlEvent:@"EventName" userInterfaceContext:nil withEntityData:nil];

Steps 1&2 are ready (and they work, there is a UC version for Android). In case of Objective-C ¿where I can put that line? ¿how update the genexus attribute value?

Thanks in advance.

4

1 回答 1

1

要在地图中选择一个点,您可以使用SD GeolocationGeneXus 中内置的用户控件。

但是,如果您想要创建自己的用户控件,您可能希望将其设为 or 的子GXControlEditableWithLabelBaseGXControlEditableWithLabelSingleEditorViewBase。也就是说,假设您希望它具有关联的属性。您说您正在使用GXControlGridBase子类,即用于值列表,而不仅仅是属性。

至于您问题的最后一部分,如果您需要更新属性的值,则无需触发事件。您可以从控件的实现中调用此方法:

[self updateEntityDataResolvedFieldWithValue:fieldValue];

该方法-updateEntityDataResolvedFieldWithValue:GXControlEditableWithLabelBase基类中定义。

于 2016-01-07T15:15:07.990 回答