Hi, James.

There is no attachment (I think they are not allowed). Simply copy-and-paste.

Default is like a "reserved" prefix. If Isis finds any method starting with it, 
it will assume it to be a default value for a property or an action param [1].

If you have implemented a "newTransaction(...)" action and want to specify 
default values for parameters, do it as in [1] (remember to specify the param 
number correctly (remember the first parameter will be number 0 - a 0-based 
list -).

If you simply want to initialize the properties of the Transaction inside the 
"newTransaction(...)" you have different options:
- simply set them on the action's code.
- define on the "Transaction" class a defaultXXX () method, being XXX the name 
of the property.
- initialize it by assigning a value directly to the field (I wouldn't 
recommend this for default values on entity creation. Perhaps it could lead to 
"conflicts" with the persistence ORM when re-creating the entity from the 
database).

If that's not what you intented, please, copy the code.

Hope this helps,

Oscar



PS: Seems there's no link for defining a default for a property on [2] ?

[1] 
http://isis.apache.org/applib-guide/how-tos/how-to-03-050-How-to-specify-default-values-for-an-action-parameter.html

[2] http://isis.apache.org/applib-guide/how-tos/about.html



El 14/08/2013, a las 19:23, james agada <[email protected]> escribió:

> I have created an action in a service Transactions.java attached and added 
> the defaultNewTransaction method in ordr to populate default values. It 
> compiles alright but when I try to run, I get this error
> 
>      [exec] 1) Error in custom provider, 
> org.apache.isis.core.metamodel.specloader.validator.MetaModelInvalidException:
>  1: dom.todo.Transactions#defaultNewTransaction has prefix default, has 
> probably been orphaned.  If not an orphan, then rename and use @Named 
> annotation
> 
> May be I am doing it wrong but can some one help. Is it only inside entity 
> that you can use default?

Reply via email to