Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Expression in PossibleValues.invalidValueMessage()
Expression in PossibleValues.invalidValueMessage() [message #1241129] Fri, 07 February 2014 14:21 Go to next message
Andreas Weise is currently offline Andreas WeiseFriend
Messages: 37
Registered: January 2014
Member
Is there a reason why an expression can not be used for 'invalidValueMessage' on the @PossibleValues annotation. The @Validation.message() resolves any expression used in the text.

Currently the text is passed directly to the MessageFormat object:

Caused by: java.lang.IllegalArgumentException: can't parse argument number  Parent.Id == null ? "" : concat("' for", Parent.Id, "'") 
	at java.text.MessageFormat.makeFormat(MessageFormat.java:1339)
	at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
	at java.text.MessageFormat.<init>(MessageFormat.java:350)
	at java.text.MessageFormat.format(MessageFormat.java:811)
	at org.eclipse.sapphire.services.internal.ModelBasedPossibleValuesService.getInvalidValueMessage(ModelBasedPossibleValuesService.java:125)
	at org.eclipse.sapphire.services.internal.PossibleValuesValidationService.compute(PossibleValuesValidationService.java:72)
	at org.eclipse.sapphire.services.internal.PossibleValuesValidationService.compute(PossibleValuesValidationService.java:1)
	at org.eclipse.sapphire.services.DataService.refresh(DataService.java:103)
	... 153 more


When using Possible Values within tables, it is essential to supply an identifier where the error occurs.
Re: Expression in PossibleValues.invalidValueMessage() [message #1241296 is a reply to message #1241129] Fri, 07 February 2014 19:27 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
@PossibleValues support predates Sapphire EL. I does make sense to change it to use EL instead of relying on MessageFormat. Please open an enhancement request.
Previous Topic:Keyword final on StandardXmlValueBindingImpl
Next Topic:Radio Button Group with Possible Value Service
Goto Forum:
  


Current Time: Thu Apr 25 04:45:48 GMT 2024

Powered by FUDForum. Page generated in 0.02415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top