Skip to Content
Former Member
Sep 24, 2018 at 11:28 PM

Unable to Passing Data Between Widgets


Hi All

I'm trying to follow the example "Passing Data Between Widgets" from this link:

I have created my controller, the definition.xml and the zul file. I'm able to add the widget to my custom backoffice and when I click on the "Send" button I'm able to debug the controller and see that the value is been send to "outgoingMsg".

However never get the value in @SocketEvent(socketId = "incomingMsg") and for this reason the label on the page is never been updated.

This is the code I have in my local..

---------------------------------------------CONTROLLER -----------------------------------------------------------------------------

public class MyChatController extends DefaultWidgetController

{ private Label lastMsgLabel; private Textbox msgInput;

 @ViewEvent(componentID = "sendBtn", eventName = Events.ON_CLICK)
 public void sendMsg()
     sendOutput("outgoingMsg", msgInput.getText());


 @SocketEvent(socketId = "incomingMsg")
 public void updateTranscript(final String msg)



 <name>My Chat</name>
 <description>My chat widget.</description>
 <defaultTitle>My chat</defaultTitle>
 <controller class="org.sigmabackoffice.widgets.mychat.MyChatController"/>
     <input type="java.lang.String" id="incomingMsg"/>
     <output type="java.lang.String" id="outgoingMsg"/>


     <textbox id="msgInput"/>
     <button id="sendBtn" label="Send"/>
     <label id="lastMsgLabel" value="No message."></label>

I'm attaching the structure of my local project and how the widget looks like, any help is appreciated.

alt text