[
https://issues.apache.org/jira/browse/TAPESTRY-2278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580566#action_12580566
]
Howard M. Lewis Ship commented on TAPESTRY-2278:
------------------------------------------------
Let me see if I understand.
You want a blank option present, because you want to force the user to actively
make a selection, rather than just whatever ends up visible in the project
<select>.
However, if the user submits the form, the problem is that the blank value is
not valid to be converted into an id (int or long).
My question: why is the <select> not a required field? That would force the
user to make a selection on the client side which would prevent the scenario
where an unexpected blank value is submitted in the form.
But I think you are correct, a blank or null update from the user does need to
be recognized and handled correctly. But was is correctly? Ignored outright,
or treated as a null? And, if null, that may cause its own exceptions if
assigned to a primitive field (int) rather than a wrapper field (Integer).
> BlankOption value in Select component should be configurable
> ------------------------------------------------------------
>
> Key: TAPESTRY-2278
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2278
> Project: Tapestry
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.0.11
> Reporter: Sven Homburg
> Fix For: 5.0.12
>
>
> i often use the option value of a select component holding id's for database
> entities.
> the id's type are most numeric values, so my problem is:
> i attached an ajax request that sends each change from the select component.
> the following method catch the event
> @OnEvent(component = "inputProject", value = "change")
> JSONValue projectIdChanged(long projectId)
> {
> .....
> return mapper.toJSON(resultList);
> }
> if the user select the blank option
> the component throws a NumberFormatException
> so it were cool, if i declare the empty option value by my self.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]