Menu

#6 Add standard component for 'selected' like 'checked'

WontFix
wont-fix
nobody
None
2025-06-13
2024-05-13
No

option elements have a selected attribute which is boolean like 'checked'. However, setting it currently requires a workaround like using std:if with two versions of the option.

This ticket will add a new standard 'selected' component.

Discussion

  • Andrew Oliver

    Andrew Oliver - 2025-06-09
    • Milestone: 0.3.1 --> 0.3.2
     
  • Andrew Oliver

    Andrew Oliver - 2025-06-13

    The cleaner way to handle this is to use the existing html:bidir-value on the parent select element. Then there is no need to manipulate the selected attribute on options. For example:

      <select html:bidir-value='myProperty'>
    

    binds the JavaBeans property 'myProperty' to the select. The value is fetched via getMyProperty() for rendering, and when the selected value changes, setMyProperty is called.

     
  • Andrew Oliver

    Andrew Oliver - 2025-06-13
    • status: accepted --> wont-fix
     
  • Andrew Oliver

    Andrew Oliver - 2025-06-13
    • Milestone: 0.3.2 --> WontFix
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.