You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kent Tong <ke...@cpttm.org.mo> on 2005/04/01 07:06:16 UTC

Re: Re: Remove caching from inherited-bindings...

Filip Balas <fbalas <at> IMVProjects.com> writes:

> 
> Yes, both my my EditPreference and my 
> MainMenu components have their directions
> set to 'auto'.  Thanks for the reply, I was
> starting to think my post didn't make any
> sense.

I don't know why you say it's not working. I've made
an test app showing that it works.

Menu.html:
this is a menu.
<span jwcid="editor"/>

Menu.jwc:
<component-specification class="org.apache.tapestry.BaseComponent"
allow-body="yes" allow-informal-parameters="yes">
    <parameter name="pref" type="java.lang.String" direction="auto" required="yes"/>
    <component id="editor" type="PrefEditor">
        <inherited-binding name="pref" parameter-name="pref"/>
	</component>
</component-specification>

PrefEditor.html:
Editing preference: <span jwcid="@Insert" value="ognl:pref"/>

PrefEditor.jwc:
<component-specification class="org.apache.tapestry.BaseComponent"
allow-body="yes" allow-informal-parameters="yes">
    <parameter name="pref" type="java.lang.String" direction="auto" required="yes"/>
</component-specification>

I have two pages using the Menu component: Home and Result.

Home.html:
<span jwcid="@Menu" pref="ognl:pref"/>

Home.page:
<page-specification class="helloworld.Home">
	<property-specification name="pref" type="java.lang.String"/>
</page-specification>

Home.java:
public abstract class Home extends BasePage implements PageRenderListener {
	public abstract void setPref(String pref);
	
	public void pageBeginRender(PageEvent event) {
		setPref("abc");
	}
}

Result page is almost exactly the same as Home except that
the pref is set to "def":

Result.html:
<span jwcid="@Menu" pref="ognl:pref"/>

Result.page:
<page-specification class="helloworld.Result">
	<property-specification name="pref" type="java.lang.String"/>
</page-specification>

Result.java:
public abstract class Result extends BasePage implements PageRenderListener {
	public abstract void setPref(String pref);
	
	public void pageBeginRender(PageEvent event) {
		setPref("def");
	}
}



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