Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Portal setPortlets with custom components issue

    Hello Team,

    Could you give me a glue, I'm creating a portal trying to persist the state of the portal but is not working, I have been trying several workarounds without success

    Dashboard is the portal
    Code:
    // extended from portallayout
    public Dashboard() {
    setAttribute("portlets", getPortletsFromMemory(this.getID()), false);
    }
    
    public native BaseWidget[] getPortletsFromMemory(String id) /*-{
    return [
    [
    $wnd.isc.Portlet.create({ title: 'ssssss' }); //working, but I have my own portlet extended from portlet
    ],
    [
    @xxxxxxxxxxxxx.Dashboard::getPortlet(Lcom/google/gwt/core/client/JavaScriptObject;)({ "a": "b"});
    ]
    ]
    }-*/
    
    private static Portlet getPortlet(JavaScriptObject object) { // when this work, based on object I will return the respective portlet
    Portlet portlet = new Portlet();
    portlet.setTitle("asdas");
    ///portlet.setContents("dcdcdcd");
    portlet.setAutoDraw(true);
    return portlet ;
    }
    Last edited by jamesjara; 4 Jun 2017, 10:54.

    #2
    It looks like you're trying to do some low-level hacking here - this isn't necessary, just follow this sample.

    Comment


      #3
      Yes, Sir, it is kind of hacking, because I want to use the `portlets` attribute (setPortlets) otherwise I will need to create a function to parse the multidimensional array and extract each column/row/portlet , you link it is exactly what I'm looking for but I have tried before and requires 'darshboard and tools' which is currently paid so I can't count with that, thank you

      how could I make this line work, it seems like the returning object is no being created on the fly just defined
      Code:
      @xxxxxxxxxxxxx.Dashboard::getPortlet(Lcom/google/gwt/core/client/JavaScriptObject;)({ "a": "b"});

      Comment


        #4
        Fixed, custom dashboard with persistent portlets. thanks.


        Code:
          return  temp.getOrCreateJsObj() ;

        Comment

        Working...
        X