언어 설정

Menu
Sites
Language
SDK 2.4 Native UI Builder : <view> event handler "uib,view,create" never gets triggered on view creation

I m building a Native app using SDK 2.4 Ui Builder.

I want to do some operations on creation of a view (like, check some condition once the view is created. Enable/disable few objects depends on the check).
I created an event handler for <view> on events "uib,view,create" using UI Builder.
But this handler is never getting triggered on <view> creation.

Any help would be appretiated..

Edited by: Anoop CK on 23 6월, 2016

Responses

6 댓글
dongjo hwang

I've tested the same scenario in my Windows 7 64bit machine using a tizen_2.4_Rev6 release. And it works without any errors.

Please check the generated codes.

1. Check the event handler binding code in {project}/src/managed/src/view/uib_view1_view.c file.

Please check the binding code in "uib_view_view1_create" function.
For example, evas_object_smart_callback_add(vc->root_container, "uib,view,create", (Evas_Smart_Cb)view1_onuib_view_create, vc);

2. Check the event handler code in {project}/src/event_handler/uib_view1_event_handler.c file.

void view1_onuib_view_create(uib_view1_view_context *vc, Evas_Object *obj, void *event_info) {
    // You can add your code here
    elm_object_text_set(vc->button1, "Hello....");
}

Please let us know the result and your developing environment information.

Thank you.

Anoop CK

I m working on Linux Environment:

Details:

Ububtu 12.04 LTS (32-bit)
Tizen IDE: Version- 2.4.0_Rev5
               : Build- 20151223-1453

- Even handler binding code is NOT generated in {project}/src/managed/src/view/uib_view1_view.c file
evas_object_smart_callback_add(vc->root_container, "uib,view,create", (Evas_Smart_Cb)view1_onuib_view_create, vc); is also not present in my code.

- Event handler code is avaialble @  {project}/src/event_handler/uib_view1_event_handler.c

Anoop CK

I  m getting "Unhandled event loop exception" when I add "uib,view,create" event from "Properties" window.
Hence its not creating the event handler binding code..
Error Message:
Unhandled event loop exception

java.lang.NullPointerException
    at org.tizen.efluibuilder.ui.editor.texteditor.TextEditorDocumentAnalyzer.replaceElement(Unknown Source)
    at org.tizen.efluibuilder.ui.editor.texteditor.TextEditorDocumentAnalyzer.procCommands(Unknown Source)
    at org.tizen.efluibuilder.ui.editor.texteditor.TextEditorDocumentAnalyzer.stackChanged(Unknown Source)
    at org.eclipse.gef.commands.CommandStack.notifyListeners(CommandStack.java:329)
    at org.eclipse.gef.commands.CommandStack.execute(CommandStack.java:213)
    at org.tizen.efluibuilder.ui.views.properties.event.ActionEflEventHandlerComposite.valueChanged(Unknown Source)
    at org.tizen.efluibuilder.ui.views.properties.event.ActionEflEventHandlerComposite$1.mouseUp(Unknown Source)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742) ..................

 

dongjo hwang

Thank  you for providing your information.

According to your reply, I guess code generation process doesn't work properly.(- Even handler binding code is NOT generated in {project}/src/managed/src/view/uib_view1_view.c file)

Please post log file ({your_workapce}\.metadata\.log) after saving the layout.xml.

Anoop CK

Below is the content of .log File
(Note:  I updated Tizen IDE to 2.4.0_Rev6)

 

!SESSION 2016-06-28 12:16:01.625 -----------------------------------------------
eclipse.buildId=2.4.0_Rev6                    
java.version=1.8.0_20
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en
Framework arguments:  -Dorg.eclipse.swt.browser.DefaultType=MOZILLA
Command-line arguments:  -os linux -ws gtk -arch x86 -data /home/user/tizen_workspace -Dorg.eclipse.swt.browser.DefaultType=MOZILLA

!ENTRY org.tizen.common.ui.Startup 1 0 2016-06-28 12:16:05.879
!MESSAGE SDK Information: Path [/home/user/tizen-sdk], Data Path [/home/user/tizen-sdk-data.1], Platform Path [/home/user/tizen-sdk/platforms/tizen-2.4/tv]

!ENTRY org.eclipse.cdt.core 1 0 2016-06-28 12:17:15.446
!MESSAGE Indexed 'UIBuilderNavigation_Explore' (15 sources, 644 headers) in 25.26 sec: 25,422 declarations; 27,894 references; 0 unresolved inclusions; 0 syntax errors; 0 unresolved names (0.00%)

!ENTRY org.tizen.efluibuilder 4 2 2016-06-28 12:17:27.556
!MESSAGE Problems occurred when invoking code from plug-in: "org.tizen.efluibuilder".
!STACK 0
org.w3c.dom.DOMException: Not Found
    at org.eclipse.wst.xml.core.internal.document.NodeContainer.removeChild(NodeContainer.java:375)
    at org.tizen.efluibuilder.ui.editor.texteditor.TextEditorModelListener$PartsListener.changeEvent(Unknown Source)
    at org.tizen.efluibuilder.ui.editor.texteditor.TextEditorModelListener$PartsListener.doSyncModel(Unknown Source)
    at org.tizen.efluibuilder.ui.editor.texteditor.TextEditorModelListener$PartsListener.eventChanged(Unknown Source)
    at org.tizen.efluibuilder.model.AbstractPart$1.run(Unknown Source)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.tizen.efluibuilder.model.AbstractPart.fireEvent(Unknown Source)
    at org.tizen.efluibuilder.model.Part.addPartAction(Unknown Source)
    at org.tizen.efluibuilder.ui.views.properties.event.commands.EditPartActionCommand.execute(Unknown Source)
    at org.eclipse.gef.commands.CommandStack.execute(CommandStack.java:199)
    at org.tizen.efluibuilder.ui.views.properties.event.ActionEflEventHandlerComposite.valueChanged(Unknown Source)
    at org.tizen.efluibuilder.ui.views.properties.event.ActionEflEventHandlerComposite$1.mouseUp(Unknown Source)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)

 

dongjo hwang

Hello Mr. Anoop CK,

We've found a bug which occurs when adding an event handler to the View that contains UI component that has an event handler already.

We'll patch this bug as soon as possible.

Sorry for your inconvenience.