Interface IRequestableComponent

    • Method Detail

      • getPageRelativePath

        String getPageRelativePath()
        Gets this component's path.
        Returns:
        Colon separated path to this component in the component hierarchy
      • getId

        String getId()
        Gets the id of this component.
        Returns:
        The id of this component
      • get

        IRequestableComponent get​(String path)
        Gets the component at the given path.
        Parameters:
        path - Path to component
        Returns:
        The component at the path
      • getBehaviorId

        int getBehaviorId​(Behavior behavior)
        Gets a stable id for the specified non-temporary behavior. The id remains stable from the point this method is first called for the behavior until the behavior has been removed from the component. This includes from one request to the next, when the component itself is retained for the next request (i.e. is stateful). Note that the bookkeeping required for these stable ids increases the memory footprint of the component.
        Parameters:
        behavior -
        Returns:
        a stable id for the specified behavior
        Throws:
        IllegalArgumentException - when the behavior is temporary
      • detach

        void detach()
        Detaches the component.

        NOTE: this method is not inherited from IDetachable on purpose. in Wicket the assumption for a long time has been that Components do not implement IDetachable; doing so may lead to some very nasty side-effects. Consider AbstractPropertyModel#detach() which looks like this:

         public void detach()
         {
                // Detach nested object if it's a detachable
                if (target instanceof IDetachable)
                {
                        ((IDetachable) target).detach();
                }
         }
         
        If the model was constructed thusly, which is quite common: new PropertyModel(this, "person") and Component implemented IDetachable then calling @{code model.detach()} will cause an infinite loop with the model trying to detach the component and the component trying to detach the model.