Skip to content

Conversation

DhiaEddineSaidi
Copy link
Member

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

I Added the Annotation @Radiobox which have 2 parameters ::
-First :: As all existing annotations the 'title'
-Second :: the titleMap which is a class that should extends 'TitleMapsAdapter' and overrides the method 'getPossibleValues()' in which the user will decide what possible values can he return in a HashMap<String ,Object>.
This Map will be used by the 'RadioBoxGenerator' to add an ArrayNode named 'titleMap' to our field Form Definition ObjectNode. ['titleMap' defines the names and values of our RadioBoxes in the resulted Form].

Alternate Designs

---note :: This mechanism could be reused in the ComboBox.
The choice of making the HashMap supports Object types, brings more flexibility to the Adapter and leaving the choice to the user deciding the Type to put in the Radio's value.
---note :: This idea comes to me after noticing that the method 'ObjectNode.put()' can support many types as values.

Why Should This Be In Core?

This is an elementary functionality.

Benefits

The major benefit is the growing number of the supported layouts.

Possible Drawbacks

'TitleMapsAdapter' may cause some problems.

Applicable Issues

can't find yet

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1553aeb on DhiaEddineSaidi:master into ** on JsonSchema-JavaUI:master**.

@SaifJerbi SaifJerbi merged commit b42d825 into JsonSchema-JavaUI:master Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants