I am trying to create a component that will have a link in it.  When the link 
is clicked, I want it to send me to a page that is defined by the page that 
is using the component.

However, debugging the operation, the page parameter that I have set is null, 
and I don't quite understand why.  Can someone see my error.

The first page (Home.html) has the following in it

<span jwcid="@PersonList"
        forename=""
        surname=""
        gender=""
        linkPage="ognl:editPage" ></span>


Where edit page is defined in Home.java thus

        @InjectPage("Edit") 
        public abstract Edit getEditPage();  

the PersonList component defines linkPage in its PersonList.java file as

        public abstract void setLinkPage(ISetPerson callback); 
        public abstract ISetPerson getLinkPage(); 

where ISetPerson is an interface that I have defined that extends IPage - thus

public interface ISetPerson extends IPage{
        void setPersonId(int id);

}

Component PersonList generates a link via a DirectLink component which calls a 
listener in the PersonList component called doLink so (Its actually a row in 
the contrib:Table component)

<a jwcid="@DirectLink"
                listener="listener:doLink"
                parameters="ognl:components.table.tableRow.id"
                class="name"
                ><span jwcid="@Insert"
                        value="ognl:components.table.tableRow.fullName"
                        >Chandler, Alan</span></a>

and the doLink java is as follows

        public IPage doLink (int personId) { 
            ISetPerson link = getLinkPage(); 
            link.setPersonId(personId); 
            return link; 
        } 

When I put the debugger in the line "ISetPerson link = getLinkPage();" the 
getLinkPage() method is returning a null value.

Why?  Why isn't it set when the PersonList component is instanciated inside 
Home.html.


 




-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to