Class CardAccordion


public class CardAccordion extends Component<CardAccordion>
The component is a special layout component and you can only place card components on it. The first card placed on the layout component is displayed as expanded, whereas the others are displayed as collapsed. Only the header is visible on collapsed cards, the card contents remain invisible. If the user clicks on a collapsed card’s header, it expands, and if it was expanded, it collapses.
Since:
4.0
Author:
JBStrap
  • Constructor Details

    • CardAccordion

      public CardAccordion()
      Creates an empty CardAccordion.
    • CardAccordion

      public CardAccordion(String id)
      Creates an empty CardAccordion using the specified unique ID.
      Parameters:
      id - Unique component ID
    • CardAccordion

      public CardAccordion(Card... cards)
      Creates a new CardAccordion component and places the specified cards on the component.
      Parameters:
      cards - Card instances to be placed on the component If null is specified, an empty component is created. You can add cards to this empty component later.
    • CardAccordion

      public CardAccordion(String id, Card... cards)
      Creates a new CardAccordion component with the specified unique ID and places the specified cards on the component.
      Parameters:
      id - Unique component ID
      cards - Card instances to be placed on the component If null is specified, an empty component is created. You can add cards to this empty component later.
  • Method Details

    • addComponent

      public CardAccordion addComponent(Component<?> component)
      Places a new card on the component.
      Overrides:
      addComponent in class Component<CardAccordion>
      Parameters:
      component - The component to be added
      Returns:
      The component
      Throws:
      IllegalArgumentException - Thrown if the specified component does not extend the Card class
    • afterDraw

      public void afterDraw()
      Description copied from class: Component
      The operations to be executed after the drawing of the component

      By default, this is an empty method. It has to be overwritten on a component or page if additional operations have to be executed after the drawing process. One such operation is data retrieval, which shouldn't run in constructors so that the user could see results of an operation or navigation process.

      Overrides:
      afterDraw in class Component<CardAccordion>
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<CardAccordion>
      Returns:
      If the componentwas drawn, true, otherwise false