diff --git a/templates/bidirectional-widget-plugin/{{ cookiecutter.project_name }}/src/js/src/{{ cookiecutter.__js_plugin_view_obj }}.tsx b/templates/bidirectional-widget-plugin/{{ cookiecutter.project_name }}/src/js/src/{{ cookiecutter.__js_plugin_view_obj }}.tsx index 5dcc47812..ef8187e28 100644 --- a/templates/bidirectional-widget-plugin/{{ cookiecutter.project_name }}/src/js/src/{{ cookiecutter.__js_plugin_view_obj }}.tsx +++ b/templates/bidirectional-widget-plugin/{{ cookiecutter.project_name }}/src/js/src/{{ cookiecutter.__js_plugin_view_obj }}.tsx @@ -35,6 +35,7 @@ export function {{ cookiecutter.__js_plugin_view_obj }}(props: WidgetComponentPr const text = detail.getDataAsString(); if (text) { setText(text); + widget.sendMessage("message acknowledged", []); } } ); diff --git a/templates/bidirectional-widget-plugin/{{ cookiecutter.project_name }}/src/{{ cookiecutter.__src_folder_name }}/{{ cookiecutter.__type_file_name }}.py b/templates/bidirectional-widget-plugin/{{ cookiecutter.project_name }}/src/{{ cookiecutter.__src_folder_name }}/{{ cookiecutter.__type_file_name }}.py index 2f9650dd6..5d2003740 100644 --- a/templates/bidirectional-widget-plugin/{{ cookiecutter.project_name }}/src/{{ cookiecutter.__src_folder_name }}/{{ cookiecutter.__type_file_name }}.py +++ b/templates/bidirectional-widget-plugin/{{ cookiecutter.project_name }}/src/{{ cookiecutter.__src_folder_name }}/{{ cookiecutter.__type_file_name }}.py @@ -1,5 +1,6 @@ from __future__ import annotations +import io from typing import Any from deephaven.plugin.object_type import MessageStream, BidirectionalObjectType @@ -44,7 +45,11 @@ def on_data(self, payload: bytes, references: list[Any]) -> None: Returns: The payload to send to the client and the references to send to the client """ - pass + # This is where you would process the payload. + # This is just an acknowledgement that the payload was received, + # so print. + payload = io.BytesIO(payload).read().decode() + print(f"Received payload: {payload}") def on_close(self) -> None: """