renechoi commented on PR #4973:
URL: https://github.com/apache/zeppelin/pull/4973#issuecomment-3170607443

   Hi @Reamer , thanks again for the review and the helpful suggestion.
   
   - Context of usage: In notebooks, calls go through z.select(...) → 
ZeppelinContext.select(...) → GUI.select(...). GUI maintains the form config in 
forms and the current selection in params. On the first call, defaultValue is 
applied; subsequent calls with the same id keep the prior selection unless 
explicitly changed.
    
   - Follow-up tests added:
      - testSelectWithCollectionDefaultMultiElement: verifies that when 
defaultValue is a Collection with multiple elements (["2","3"]), the first 
element ("2") is used as the default.
      - testSelectWithEmptyCollectionDefault: verifies that an empty Collection 
maps to null, which falls back to the first option's value ("1").
   
   These tests are now in GUITest.java.
   
   Note on arrays: This PR intentionally scopes the behavior change to 
Collection inputs. Java arrays are not Collections, so array inputs still 
follow the previous behavior. If you think supporting arrays as well would be 
useful, I’m happy to follow up in a small, separate PR to also treat Object[] 
defaults by taking the first element (and empty array → fallback).
   
   Please let me know if you’d prefer arrays handled in this PR or as a 
follow-up.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to