Hi Edy,

In Tapestry, pages are just a special case of "components" and are at the top of the component tree. Pages cannot be inserted into other pages, unlike in JSP (where the concept of a component is missing). Instead, components can be inserted within pages, as well as within other components -- that's their purpose.

In other words, the component tree looks something like this:

page 
  |-- component 1
  |     |-- component 1.1
  |     |-- component 1.2
  |-- component 2
|     |-- component 2.1

... etc

In your case it appears that you need to make a component StudentMenu and include it into the Student page like this:

<page-specification class="java class">
    <component id="id to be used in the template" type="component name as defined in the .application">
        the parameters of the component (if any) are passed here via the bindings
    </component>
</page-specification>

Note that you do not need to use Block and InsertBlock. Those are only necessary when you a page/component needs to include other components via polymorphism, e.g. on a portal site. This does not occur very often and it does not appear to be necessary in your case -- the approach you need is using components. In any case, if you need those at some point, have a look at the Portal demo in the tutorial examples.

Finally, the reason you were getting an error when doing expression='page.StudentMenu' is that this translates to getPage().getStudentMenu(), and does not have a method getStudentMenu. Please see the OGNL syntax at www.ognl.org if you need more details. If you need something like that (although you don't seem to need it in this case), you can do:

expression="page.requestCycle.getPage(&quot;PageName&quot;).getNestedComponent(&quot;BlockComponent&quot;)"

I hope this helps.

-mb

 

 [EMAIL PROTECTED] wrote:

Hi,
this is maybe obsolete question, but really i'm depressed after trying some
examples that are in tapestry packages and searching in mailinglist archive.

I need simple example that show how a Page can includes 2 or more other pages
in same time.

I tried this :
in Student.Page (the page that includes other pages)





StudentMenu.page is the page that will be included in Student.Page
It showed error :
Unable to resolve expression 'StudentMenu' for
com.pointbridge.academic.client.student.Student@5dd32a[Student].

I know my way was wrong, maybe someone could help me with some example to make
it works?

any helps would be appreciated.

Regards

Edy Toha






-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer



Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

Reply via email to