Trait

ltbs.uniform.common.web

InferListingPages

Related Doc: package web

Permalink

trait InferListingPages[Html] extends AnyRef

Produces pages for List[A] where a user can enter multiple items of a given datatype via a central page that enumerates the items already, allows them to add new items and edit or delete existing ones.

There are two ways you can produce a listing - the first works by infering the page for A automatically. To use this approach simply use an ask[List[A]] in your journey and it will pick up and use the add/edit part from inference, falling back to InferFormField if necessary.

The second approach works by explicitly supplying a subjourney and interpreting this into a WebMonadConstructor, by using the listingPageWM method.

Self Type
InferListingPages[Html] with GenericWebInterpreter[Html]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. InferListingPages
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def blankTell: Html

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. implicit def listingPage[A](implicit wmca: Lazy[(InferListingPages.this)#WMC[A]], codec: Codec[List[A]], listingTell: ListingTell[Html, A], wmcbranchffg: FormField[ListActionGeneral, Html], wmcbranchffa: FormField[ListAction, Html]): (InferListingPages.this)#WMC[List[A]]

    Permalink
  13. def listingPageWM[A](addEditJourney: (List[A], Option[Int], UniformMessages[Html], Rule[A]) ⇒ (InferListingPages.this)#WM[A], deleteJourney: (List[A], Int) ⇒ (InferListingPages.this)#WM[Boolean] = ..., customOrdering: Option[Order[A]] = None, useSubjourneys: Boolean = true)(implicit wmcbranchffg: FormField[ListActionGeneral, Html], wmcbranchffa: FormField[ListAction, Html], codec: Codec[List[A]], listingRowHtml: ListingTell[Html, A]): (InferListingPages.this)#WMC[List[A]] { ... /* 2 definitions in type refinement */ }

    Permalink

    Allows creation of a listing page that uses an interpreted subjourney in place of the implicit single-page form used for adding and editing.

    Allows creation of a listing page that uses an interpreted subjourney in place of the implicit single-page form used for adding and editing.

    case class MyClass(a: Boolean, b: String)
    
    type SubjourneyTell = NilTypes
    type SubjourneyAsk = Boolean :: String :: NilTypes
    
    def myclassSubjourney[F[_]: cats.Monad](
      existing: List[MyClass],
      editIndex: Option[Int],
      messages: UniformMessages[Html]
    )(
      int: Language[F, SubjourneyTell, SubjourneyAsk]
    ): F[MyClass] = ???
    
    implicit def myClassListing(
      implicit request: Request[AnyContent]
    ) = {
      interpreter.listingPageWM[MyClass](
        subjourney[interpreter.WM](_,_,_)(
          create[SubjourneyTell, SubjourneyAsk](interpreter.messages(request))
        )
      )
    }
    addEditJourney

    the interpreted journey used for adding and editing. Accepts the existing list of entries, an index for editing (None if adding), and messages.

    deleteJourney

    an optional journey to be invoked when deleting, must return a boolean

    customOrdering

    allows the entries to be ordered differently in the listing. By default they will be in the order added.

  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped