sherpal/LaminarSAPUI5Bindings

Select component

Closed this issue · 2 comments

I'm having a little trouble with the select component.

The idea, was to make a dropdown, from a signal of some entities. An "IlsEvent" has a name and an ID.

  def selectFromEvents(events: Signal[List[IlsEvent]], valueSignal: Signal[Option[HistoricalEventSetId]], valueUpdater: Observer[Option[HistoricalEventSetId]]): HtmlElement = {
    SelectTwo(
      _.slots.default <-- events.map{ aList => 
        aList.map{
          item => SelectOption(_.value := item.name, _.additionalText := item.id.value.toString())
        }
      }
    )
  }

I couldn't figure out how to use the slots... so I duplicated "Select" into "SelectTwo" and added the default slots. However, I now can't figure out how to set the text in the select option. The additional text field works however...

I feel like they may be related problems with my understanding!

@sherpal I haven't managed to make a select option display it's primary value... I can only get secondary text to work... would you have a hint?

Hmmm... I managed to get it working by adding a default slots object to SelectOption, and then feeding that slot a div... but I don't think it's idiosyncratic!