Monday, June 18, 2018

Re: Using UIField HTML to create a dynamic table

Thank you for your help!
I changed my configuration in my MyAction class and now I get this error:

My code on server side in the class ActionServiceImpl looks like that:

public class ActionServiceImpl extends RemoteServiceServlet implements MyActionService {        private static final String[] actionName = new String[] { "Trikots für A-Jugend", "Rollstuhl für Maria" };      private static final double[] targetAmount = new double[] { 1000, 2500 };      private static final double[] donationMinimum = new double[] { 10, 10 };      private static final double[] amountDonationSoFar = new double[] { 258, 742 };      private static final String[] accountName = new String[] { "Max Mustermann", "Maria Musterfrau" };      private static final String[] iban = new String[] { "DE447818032764520919100", "DE4478180328485419100" };          private static final String[] NameOfBank = new String[] { "ABC Bank", "XYZ Bank" };          private final HashMap<String, Campaign> actions = new HashMap<String, Campaign>();      private final HashMap<String, Account> accounts = new HashMap<String, Account>();        public ActionServiceImpl() {          initActions();      }        private void initActions() {            for (int i = 0; i < actionName.length; ++i) {              Account account = new Account(accountName[i], NameOfBank[i], iban[i]);              Campaign action = new Campaign(String.valueOf(i), actionName[i], targetAmount[i], donationMinimum[i],                      amountDonationSoFar[i], account);              accounts.put(account.getName(), account);              actions.put(action.getId(), action);          }      }      @Override      public ArrayList<ShowActions> getShowActions() {          ArrayList<ShowActions> showActions = new ArrayList<ShowActions>();            Iterator<String> it = actions.keySet().iterator();          while (it.hasNext()) {              Campaign action = actions.get(it.next());              showActions.add(action.getActions());          }          return showActions;      }

The MyActionService Interface looks like this:

@RemoteServiceRelativePath("myActionService")  public interface MyActionService extends RemoteService {      ShowActions addAction(Campaign action);      Campaign getCampaign(String id);      ArrayList<ShowActions> getShowActions();        Campaign updateAction(Campaign action);  }


Am Sonntag, 17. Juni 2018 23:09:31 UTC+2 schrieb Jens:
The errors says you have a ClassCastException in line 14 in MyAction.java. So you should start looking at MyAction.

-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment