Problems with PageLink in reference doc

"Oscar Trigueiros" <[email protected]> Mon, 10 Mar 2003 10:13:41 -0000
Newsgroups gmane.comp.java.tapestry.devel
Message-ID <[email protected]>
Hello, im new to Tapestry but have used Cocoon and Struts previously, =
for the last 2 moths i have been trying to find the time to
read some o Tapestry to understant the framework.
I made a small app to test page link based on the page on PageLink in =
the reference doc, i get one error when trying the=20
binding (Using Tapestry 2.4-A-3):

        <binding name=3D"source" =
expression=3D"engine@NAVIGATION_PAGES"/>   =20
        <!--
        <binding name=3D"source" =
expression=3D"mail.MailEngine.NAVIGATION_PAGES"/>       =20
        <field-binding name=3D"source" =
field-name=3D"mail.MailEngine.NAVIGATION_PAGES"/>   =20
        <binding name=3D"source" =
expression=3D'engine.NAVIGATION_PAGES'/>
        -->
And noe of the the obter comment binding=B4s work=B4s.
Where is the code.

 Start =
MailEngine.application---------------------------------------------------=
-------------------------------------------------------=20

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!DOCTYPE application
      PUBLIC "-//Howard Lewis Ship//Tapestry Specification 1.3//EN"
      "http://tapestry.sf.net/dtd/Tapestry_1_3.dtd">
<!-- generated by Spindle, http://spindle.sourceforge.net -->


<application name=3D"MailEngine" =
engine-class=3D"net.sf.tapestry.engine.SimpleEngine" >


    <page name=3D"Compose" =
specification-path=3D"/mail/pages/Compose.page"/>
    <page name=3D"Contacts" =
specification-path=3D"/mail/pages/Contacts.page"/>
    <page name=3D"Help" specification-path=3D"/mail/pages/Help.page"/>
    <page name=3D"Home" specification-path=3D"/mail/pages/Home.page"/>
    <page name=3D"Inbox" specification-path=3D"/mail/pages/Inbox.page"/>
    <page name=3D"Logout" =
specification-path=3D"/mail/pages/Logout.page"/>
    <page name=3D"Options" =
specification-path=3D"/mail/pages/Options.page"/>
    <page name=3D"Sent" specification-path=3D"/mail/pages/Sent.page"/>

</application>
-------------------------------------------------------------------------=
-------------------------------End MailEngine.application

Ok i was sleepy when i tried this yesterday i seen now that i the =
engine-class attr it should be mail.MailEngine

Start =
MailEngine.java----------------------------------------------------------=
------------------------------------------------=20

package mail;

import java.io.Serializable;

import net.sf.tapestry.ApplicationServlet;

public class MailEngine extends ApplicationServlet implements =
Serializable {
  public static final String[] NAVIGATION_PAGES =3D
  {"Home","Inbox","Sent","Compose","Contacts","Options","Help","Logout" =
};

  protected String getApplicationSpecificationPath() {
		return "/mail/MailEngine.application";
  }
}
-------------------------------------------------------------------------=
-------------------------------End MailEngine.java

Start =
Home.page----------------------------------------------------------------=
------------------------------------------=20
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!DOCTYPE page-specification
      PUBLIC "-//Howard Lewis Ship//Tapestry Specification 1.3//EN"
      "http://tapestry.sf.net/dtd/Tapestry_1_3.dtd">
<!-- generated by Spindle, http://spindle.sourceforge.net -->


<page-specification class=3D"mail.pages.Home">


    <component id=3D"foreachNavigationPage" type=3D"Foreach">
        <binding name=3D"source" =
expression=3D"engine@NAVIGATION_PAGES"/>   =20
        <!--
        <binding name=3D"source" =
expression=3D"mail.MailEngine.NAVIGATION_PAGES"/>       =20
        <field-binding name=3D"source" =
field-name=3D"mail.MailEngine.NAVIGATION_PAGES"/>   =20
        <binding name=3D"source" =
expression=3D'engine.NAVIGATION_PAGES'/>
        -->
        <binding name=3D"value" expression=3D'navigationPage'/>
    </component>

    <component id=3D"navigationPageLink" type=3D"PageLink">
        <binding name=3D"disabled" expression=3D'! =
visit.authenticated'/>
        <binding name=3D"page" expression=3D'navigationPage'/>
    </component>

</page-specification>
-------------------------------------------------------------------------=
-------------------------------End Home.page

Start =
Home.java----------------------------------------------------------------=
------------------------------------------=20

package mail.pages;

import mail.*;

/**
 * @author oscar
 *
 */
public class Home extends MailPage {
}
-------------------------------------------------------------------------=
-------------------------------End Home.java

Start MailPage =
.java--------------------------------------------------------------------=
--------------------------------------=20
package mail;

import net.sf.tapestry.html.BasePage;

public class MailPage extends BasePage {
	private String navigationPage;

	public String getNavigationPage() {
		return navigationPage;
	}

	public void setNavigationPage(String value) {
		navigationPage =3D value;
	}

	public void detach() {
		navigationPage =3D null;
		super.detach();
	}
}
-------------------------------------------------------------------------=
-------------------------------End MailPage .java

Maybe i should change i the  Home.page the attr  class to mail.MailPage

I=B4m very excited about Tapestry because it realy was a compoment model =
arquitecture and the other framework=B4s i have
tryied don=B4t have this. I would like to work with a framework were i =
can create compoments and from project to project reuse tham
and improvo tham, im a continous line the better time to mark. And =
Tapestry seems to have this

King regards, Oscar



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf