cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sending parameters from controller to ZUL file

Former Member
0 Likes
621

Hi All,

We have requirement to display Product Name through ZUL file in Backoffice. Though we are able to get product name in widget controller and not getting way to sent to corresponding ZUL file and to display it.

Is there any way to send parameters from widget controller to ZUL file and use it.

Regards, Raghavendra.

Accepted Solutions (1)

Accepted Solutions (1)

raghavendra_desu
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Raghavendra,

You can access the values in backoffice widget in a simple way by storing the values as key values pairs in widget model. Like in controller you will write code like below.

 public class InfoController extends DefaultWidgetController
 {
     @Override
     public void preInitialize(Component comp) {
         super.preInitialize(comp);
         // it is important to fill widget model in preInitialize method, not in initialize, if we want to access it in zul file
         getModel().put("MODEL_KEY", "MODEL_VALUE");
     }

In zul file you will access same value like below.

  <!-- accessing widget model -->
         <label value="${widgetModel.MODEL_KEY}"/>

For more details please refer to the below link,

https://help.hybris.com/6.6.0/hcd/8c18483786691014a1e8bebb3f622780.html

Regards,

Raghavendra.

Former Member
0 Likes

Thanks for your reply. If there any possibility to set the value dynamically instead of calling preInitialize method? Thanks in Advance

Answers (0)