• How to get a handle on the ViewGrid in java?

    By Kim Acket 5 years ago

    What do I need to import to get the handle on the ViewGrid in java?

    I'm trying to do the following :

    import org.openntf.xsp.viewgrid

    public String[] getViewGridSelectedIds(String IdOfViewPanel) {

    try {

    org.openntf.xsp.viewgrid MyViewGrid = null;

    // set the ID for later reference if needed

    this.ViewPanelId = IdOfViewPanel;

    if (!Utils.isStringEmpty(IdOfViewPanel)) {

    // try to get from the current page?

    MyViewGrid = (org.openntf.xsp.viewgrid) Utils.findComponent(IdOfViewPanel);

    }

    if (MyViewGrid != null) {

    return MyViewGrid.getSelection(true);

    } else {

    return null;

    }

    } catch (Exception ex) {

    Utils.WriteToConsole("Unable to get the selected Note Ids from the DynamicViewPanel (com.jacobs.JPI.PageObject.PageControls.getViewPanelSelectedIds)", ex);

    return null;

    }

    }

    • By F. Kranenburg 5 years ago

      That won't work. The main class “org.openntf.xsp.viewgrid.Grid” is only used by the “serviceBean” property of the xe:restService. Getting the document selection serverside is not possible because when you check documents, none of this information is send to the server.

      Getting the selection of the document should be done in javascript, like:
      var selection = dijit.byId(“#{id:ViewGrid}_widget”).getSelection(true);

      • By Kim Acket 5 years ago

        ok thanks for the clarification :-)