You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Pedro Santos (JIRA)" <ji...@apache.org> on 2011/04/01 14:06:06 UTC

[jira] [Commented] (WICKET-3583) java.lang.ArrayStoreException with AttributeModifier

    [ https://issues.apache.org/jira/browse/WICKET-3583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014528#comment-13014528 ] 

Pedro Santos commented on WICKET-3583:
--------------------------------------

The problem is at CompanySelectionPage line 68, the program is trying to assigin an AttributeModifier to an array of other type. How do code look like in there?
As it is not Wicket code, this error description fits better in user mailing list.

> java.lang.ArrayStoreException with AttributeModifier
> ----------------------------------------------------
>
>                 Key: WICKET-3583
>                 URL: https://issues.apache.org/jira/browse/WICKET-3583
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC2
>         Environment: Windows 7, x86-64, Java 6u24
>            Reporter: Alex Rambau
>              Labels: wicket
>
> Receiving the following error:
> java.lang.ArrayStoreException: org.apache.wicket.AttributeModifier
>      at com.wagnerequipment.it.web.applications.portalmanagement.CompanySelectionPage$2.populateItem(CompanySelectionPage.java:68)
>      at org.apache.wicket.markup.repeater.RefreshingView$1.newItem(RefreshingView.java:113)...
> when executing code (adding the AttributeModifier to the item) that worked previously under 1.4:
>         DataView<AccountCompany> dataView = new DataView<AccountCompany>("pageable", new AccountCompanyListDataProvider(filterCharacterInput)) {
>             @Override
>             protected void populateItem(final Item<AccountCompany> item) {
>                 AccountCompany company = item.getModelObject();
>                 item.add(new ActionPanel("actions", item.getModel()));
>                 item.add(new Label("companyId", String.valueOf(company.getCompanyId())));
>                 item.add(new Label("companyName", company.getCompanyName()));
>                 
>                 item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel<String>() {
>                     @Override
>                     public String getObject() {
>                         return (item.getIndex() % 2 == 1) ? "even" : "odd";
>                     }
>                 }));
>             }
>         };
> Removing the addition of AttributeModifier to the item causes the issue to go away.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira