Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 82388

Returning a list from a java action

$
0
0

I am using a java action to replace some objects in a list. As parameters I have a list of accounts and some account objects that I use for input, as return type I have Type: List and Entity CoinRegister.Account. After replacing the Account objects in the list AccountList I return the list using : return AccountList;. Eclipse gives the error message: Type mismatch: cannot convert from List<Account> to List<IMendixObject>. I have been trying to convert the List to an IMendixObject, but no luck so far. Anyone help me out?

 

This is part of the code in the java action:

    public UpdateBalance(IContext context, java.util.List<IMendixObject> AccountList, IMendixObject Debtor, IMendixObject Lender, IMendixObject Temp_Account, java.math.BigDecimal Amount)
    {
        super(context);
        this.__AccountList = AccountList;
        this.__Debtor = Debtor;
        this.__Lender = Lender;
        this.__Temp_Account = Temp_Account;
        this.Amount = Amount;
    }

    @Override

    public java.util.List<IMendixObject> executeAction() throws Exception
    {
        this.AccountList = new java.util.ArrayList<coinregister.proxies.Account>();
        if (__AccountList != null)
            for (IMendixObject __AccountListElement : __AccountList)
                this.AccountList.add(coinregister.proxies.Account.initialize(getContext(), __AccountListElement));

        this.Debtor = __Debtor == null ? null : coinregister.proxies.Account.initialize(getContext(), __Debtor);

        this.Lender = __Lender == null ? null : coinregister.proxies.Account.initialize(getContext(), __Lender);

        this.Temp_Account = __Temp_Account == null ? null : coinregister.proxies.Account.initialize(getContext(), __Temp_Account);

 //rest of my code where I replace the objects.
        
        return AccountList;

 

 


Viewing all articles
Browse latest Browse all 82388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>