Class GridTabRowRenderer

java.lang.Object
org.adempiere.webui.adwindow.GridTabRowRenderer
All Implemented Interfaces:
org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, org.zkoss.zul.RendererCtrl, org.zkoss.zul.RowRenderer<Object[]>, org.zkoss.zul.RowRendererExt

public class GridTabRowRenderer extends Object implements org.zkoss.zul.RowRenderer<Object[]>, org.zkoss.zul.RowRendererExt, org.zkoss.zul.RendererCtrl, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
Row renderer for GridTab grid.
Author:
hengsin, Teo Sarca, teo.sarca@gmail.com
  • BF [ 2996608 ] GridPanel is not displaying time https://sourceforge.net/p/adempiere/zk-web-client/420/
    • Field Details

      • COLUMN_NAME_ATTR

        protected static final String COLUMN_NAME_ATTR
        Cell div component attribute to hold field column name value
        See Also:
      • GRID_ROW_INDEX_ATTR

        public static final String GRID_ROW_INDEX_ATTR
        Editor component attribute to store row index (absolute)
        See Also:
    • Constructor Details

      • GridTabRowRenderer

        public GridTabRowRenderer(GridTab gridTab, int windowNo)
        Parameters:
        gridTab -
        windowNo -
    • Method Details

      • getColumnIndex

        public int getColumnIndex(GridField field)
        Get column index for field
        Parameters:
        field -
        Returns:
        column index for field, -1 if not found
      • getDisplayTextWithEditorCheck

        protected String getDisplayTextWithEditorCheck(Object value, GridField gridField, int rowIndex)
        Check existence of readonly editor and return display text
        Parameters:
        value -
        gridField -
        rowIndex -
        Returns:
        display text
      • getDisplayText

        public String getDisplayText(Object value, GridField gridField, int rowIndex)
        Call getDisplayText(Object, GridField, int, boolean) with isForceGetValue = false
        Parameters:
        value -
        gridField -
        rowIndex -
        Returns:
        display text
      • setComponentStyle

        protected void setComponentStyle(org.zkoss.zk.ui.HtmlBasedComponent component, String style)
        Set component's style, sclass or zclass property
        Parameters:
        component -
        style - "@sclass=" for sclass for "@zclass=" for zclass. default to style if there's no prefix.
      • getEditors

        public List<WEditor> getEditors()
        Get editor list
        Returns:
        field editor list
      • setPaging

        public void setPaging(org.zkoss.zul.Paging paging)
        Set paging component
        Parameters:
        paging -
      • stopEditing

        public void stopEditing(boolean updateCellLabel)
        Detach all editor and optionally set the current value of the editor as cell label.
        Parameters:
        updateCellLabel -
      • render

        public void render(org.zkoss.zul.Row row, Object[] data, int index) throws Exception
        Render data for row.
        Specified by:
        render in interface org.zkoss.zul.RowRenderer<Object[]>
        Parameters:
        row -
        data - Object[] values for row
        index - row index within current page (i.e if page size is 25, index is one of 0 to 24).
        Throws:
        Exception
      • setCurrentRow

        public void setCurrentRow(org.zkoss.zul.Row row)
        Set current row
        Parameters:
        row -
      • getCurrentRow

        public org.zkoss.zul.Row getCurrentRow()
        Get current row
        Returns:
        current Row
      • getCurrentRowIndex

        public int getCurrentRowIndex()
        Returns:
        current row index ( absolute )
      • editCurrentRow

        public void editCurrentRow()
        Enter edit mode for current focus row.
      • getControls

        public int getControls()
        Specified by:
        getControls in interface org.zkoss.zul.RowRendererExt
        See Also:
        • RowRendererExt.getControls()
      • newCell

        public org.zkoss.zk.ui.Component newCell(org.zkoss.zul.Row row)
        Specified by:
        newCell in interface org.zkoss.zul.RowRendererExt
        See Also:
        • RowRendererExt.newCell(Row)
      • newRow

        public org.zkoss.zul.Row newRow(org.zkoss.zul.Grid grid)
        Specified by:
        newRow in interface org.zkoss.zul.RowRendererExt
        See Also:
        • RowRendererExt.newRow(Grid)
      • doCatch

        public void doCatch(Throwable ex) throws Throwable
        Specified by:
        doCatch in interface org.zkoss.zul.RendererCtrl
        Throws:
        Throwable
        See Also:
        • RendererCtrl.doCatch(Throwable)
      • doFinally

        public void doFinally()
        Specified by:
        doFinally in interface org.zkoss.zul.RendererCtrl
        See Also:
        • RendererCtrl.doFinally()
      • doTry

        public void doTry()
        Specified by:
        doTry in interface org.zkoss.zul.RendererCtrl
        See Also:
        • RendererCtrl.doTry()
      • focusToFirstEditor

        public void focusToFirstEditor()
        Set focus to first writable field editor (or default focus field editor if it is writable).
        If no field editor is writable, set focus to first visible field editor.
      • focusToEditor

        protected void focusToEditor(WEditor toFocus)
        Set focus to editor
        Parameters:
        toFocus -
      • focusToNextEditor

        public void focusToNextEditor(WEditor ref)
        Set focus to next writable editor from ref
        Parameters:
        ref -
      • setGridPanel

        public void setGridPanel(GridView gridPanel)
        Set GridView that own this renderer.
        Parameters:
        gridPanel -
      • isEditing

        public boolean isEditing()
        Is current row in edit mode
        Returns:
        true if current row is in edit mode, false otherwise
      • setADWindowPanel

        public void setADWindowPanel(AbstractADWindowContent windowPanel)
        Set AD window content part that own this renderer.
        buttonListener need this to call AbstractADWindowContent.actionPerformed(ActionEvent).
        Parameters:
        windowPanel -
      • onEvent

        public void onEvent(org.zkoss.zk.ui.event.Event event) throws Exception
        Specified by:
        onEvent in interface org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
        Throws:
        Exception