Class WDataRenderer

    • Constructor Detail

      • WDataRenderer

        public WDataRenderer()
    • Method Detail

      • updateData

        public void updateData​(Object data)
        Subclasses must override this method if they need to keep the data object bound to this wcomponent in sync with changes entered by the user. Extensions of this class that act as editors will need to override this method.

        In terms of the MVC pattern this method copies data from the View into the Model. Note that this method is the reverse of updateComponent.

        NOTE: This method will only be called if WBeanComponent.getData() does not return null.

           public void updateData(Object data)
           {
                SomeDataObject data = (SomeDataObject)data;
                data.setX(wcompX.getText());
                data.setY(wcompY.getText());
           }
         
        Parameters:
        data - the data to update.
      • updateComponent

        public void updateComponent​(Object data)
        Subclasses must override this method if they need to keep this wcomponent in sync with the data object. The data object may have been modified by other wcomponents, or control logic.

        In terms of the MVC pattern this method copies data from the Model into the View. Note that this method is the reverse of updateData.

        NOTE: This method will only be called if WBeanComponent.getData() does not return null.

           public void updateComponent(Object data)
           {
              SomeDataObject data = (SomeDataObject)data;
              wcompX.setText(data.getX());
              wcompY.setText(data.getY());
           }
         
        Parameters:
        data - the data to set on the component.
      • handleRequest

        public void handleRequest​(Request request)
        The handleRequest method has been overridden to keep the data object bound to this wcomponent in sync with any changes the user has entered.
        Specified by:
        handleRequest in interface WComponent
        Overrides:
        handleRequest in class AbstractWComponent
        Parameters:
        request - the Request being responded to.
      • preparePaintComponent

        protected void preparePaintComponent​(Request request)
        The preparePaintComponent method has been overridden to keep the data object bound to this wcomponent in sync with any changes that control logic (Action implementations) or other wcomponents have made to the data.
        Overrides:
        preparePaintComponent in class AbstractWComponent
        Parameters:
        request - the Request being responded to.