You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gregg D Bolinger <gt...@gmail.com> on 2005/03/02 00:10:16 UTC

Problem with ListEdit

I am trying to display a list of issues and provide a button for each
issue that can be clicked if the user wants to view that issue.  I get
the list with the buttons to show up just fine but when I click on any
of the buttons I get an ApplicationRuntimeException and it is throwing
this on the .page file where I specify the class of the
page-specification.  So it is a little vague.

I used Chapter 4 (Looping within a form using ListEdit) to guide me. 
It would seem that I have done everything the same way, but I am still
getting this exception.

I've got my component defined like:

<component id="listEdit" type="ListEdit">
        <binding name="source" expression="listEditMap.keys"/>
        <binding name="value" expression="listEditMap.key"/>
        <binding name="listener" expression="listeners.synchronizeItem"/>
    </component>

Then in my html page I am doing:

<tr jwcid="listEdit" element="tr">
   <td class="issue-data-td"><input type="submit" jwcid="view@Submit"
selected="ognl:viewIssue" tag="ognl:issue" label="View"/>
   <td class="issue-data-td"><span jwcid="@Insert"
value="ognl:issue.issueNumber">Issue Number</span></td>
</tr>

And here are the mehtods used by the component.  Right now, when a
button is clicked, I am just trying to print the issue number to the
console to make sure I am getting the code right.

public void synchronizeItem(IRequestCycle cycle){
        ListEditMap map = getListEditMap();
        Issue issue = (Issue)map.getValue();
        if (issue == null){
            System.out.println("Issue is null");
        }
        System.out.println("Set the issue");
        setIssue(issue);
    }

    public void formSubmit(IRequestCycle cycle){
        List list = getIssueList();
        int count = list.size();
        Issue viewIssue = getViewIssue();
        for (int i = 0; i < count; i++){
            Issue issue = (Issue)list.get(i);
            if (issue == viewIssue){
                System.out.println(issue.getIssueNumber());
            }
        }
    }

Any help is much appreciated.

Gregg Bolinger

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org