I'm using Wicket 1.2.4 and working with a simple page to show a ListView. 
Here is the constructor for the page.

public Results(List resultsList) {
        ListView procedures = new ListView("procedures", resultsList) {

            protected void populateItem(ListItem item) {

                List procedure = (List) item.getModelObject();
                item.add(new Label("equipment", (String) procedure.get(0)));
            }

        };
        add(procedures);

    }

I call this constructor from the submit button on another page.

searchForm.add(new Button("search"){

            protected void onSubmit() {

                try {
                    List results =
lotusService.getLockoutsUsingEquipmentSearch(getSearchCriteria());
                    if(results.size() >0){
                        setResponsePage(new Results(results));
                    }

                } catch (LotusServiceException e) {
                    e.printStackTrace();
                }
            }
        });

The results page is very simple.
<html>
<head>
    <title>List of Procedures</title>
</head>

<body>
      Hello
        <table>
            <tr wicket:id="procedures">
                <td><span wicket:id="equipment"/></td>
            </tr>
        </table>

</body>
</html>


What happens is that I get a null pointer exception thrown on ListView
procedures = new ListView("procedures", resultsList).  The null pointer
states Method threw 'java.lang.NullPointerException' exception.  Cannot
evaluate com.dmflavors.lockout.view.pages.Results$1.toString().  The program
is not stopped by the exception and the Results page is rendered but without
any ListView.  The resultsList list referred to in the ListView call is
populated with values, which are actually other lists...so it is a List of
Lists.  Any help would be appreciated.

-- 
View this message in context: 
http://www.nabble.com/Newbie-%3A-Null-Pointer-on-Page-tf3293675.html#a9161474
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to