Userview Menu plugin getting system error - Joget Cloud Edition

Confluence User - 29 May, 2020


We have created one simple Userview Menu plugin . Below is our code snippet for the same.

package org.joget.DemoUserviewMenu;

import org.joget.apps.app.service.AppUtil;
import org.joget.apps.userview.model.UserviewBuilderPalette;
import org.joget.apps.userview.model.UserviewMenu;

/**
 *
 * @author DELL
 */
public class DemoUserviewMenu extends UserviewMenu  {

    @Override
    public String getCategory() {
        return UserviewBuilderPalette.CATEGORY_GENERAL; //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public String getIcon() {
          return "<i class=\"fas fa-apple\"></i>";//To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public String getRenderPage() {
          String html = "<div>From demo plug in</div>";            
        return html; //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public boolean isHomePageSupported() {
       return true; //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public String getDecoratedMenu() {
        return null; //To change body of generated methods, choose Tools | Templates.
    }

   
    public String getName() {
        return "Demo Usermenu"; //To change body of generated methods, choose Tools | Templates.
    }

    
    public String getVersion() {
        return "7.0.0"; //To change body of generated methods, choose Tools | Templates.
    }

   
    public String getDescription() {
       return "Demo Usermenu Description";//To change body of generated methods, choose Tools | Templates.
    }

  
    public String getLabel() {
        return "Demo Usermenu Label"; //To change body of generated methods, choose Tools | Templates.
    }

    
    public String getClassName() {
        return getClass().getName(); //To change body of generated methods, choose Tools | Templates.
    }

  
    public String getPropertyOptions() {
       return AppUtil.readPluginResource(getClass().getName(), "/properties/userviewDemo/htmlPage.json", null, true, "message/userviewDemo/demofile");//To change body of generated methods, choose Tools | Templates.
    }
    
}


In this plugin we have display one message in div element .

We have successfully upload plugin on joget server.


 Also, it display in userview control and it look like below.


But when we try to Preview it can not  shows  our div HTML element. It shows system error.

And in the system log we got some errors 

Error underlined with blue line.

Please help us where we do mistakes.

Note:- we are using cloud version of joget.


Regards.

plugins;server

1


30 May, 2020
confluenceUser
confluenceUser

Hi, according to the error message it says "menu.properties.id is undefined" which probably means your plugin is not returning an ID correctly. Perhaps you can refer to the source code of existing plugins in GitHub, or one of the samples for example How to develop a Gantt Chart Userview Menu.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print