Robert <rvlwork <at> xs4all.nl> writes:

> It seems my questions are not answered on both the mailing list and 
> forum which makes me worry about continuing to use tapestry.
> I am curious why not. Is it because
> 1) The question is too difficult
> 2) This has been asked many times before and people are bored to answer 
> it again
> 3) My question is not formulated correctly and therefore incomprehensible
> 4) Something else

What you're describing is weird and cannot be explained normally. 
So something else must be wrong. I've written a simple program
that does what you're trying to do and it works fine. So, you
may compare it to yours to see what's wrong.

Home.html:
<form jwcid="@Form" listener="ognl:listeners.onSubmit">
<span jwcid="@Comp" param="ognl:foo"/>
<input type="submit"/>
</form>

Home.page:
<page-specification class="helloworld.Home">
    <property-specification name="foo" type="helloworld.Foo" persistent="yes"
initial-value="new helloworld.Foo()"/>
</page-specification>

Home.java:
public class Home extends BasePage {
        public void onSubmit(IRequestCycle cycle) {
                Tapestry.fireObservedChange(this, "foo", getProperty("foo"));
        }
}

Comp.html:
Value of the foo parameter is: 
<span jwcid="@Insert" value="ognl:param.value"/>

Comp.jwc:
<component-specification class="helloworld.Comp" allow-body="yes"
allow-informal-parameters="yes">
        <parameter name="param" type="helloworld.Foo" direction="custom"/>    
</component-specification>

Comp.java:
public class Comp extends BaseComponent {
        public Foo getParam() {
                return (Foo) getBinding("param").getObject();
        }

        protected void renderComponent(IMarkupWriter writer, IRequestCycle 
cycle) {
                if (cycle.isRewinding()) {
                        getParam().setValue(getParam().getValue() + 1);
                }
                super.renderComponent(writer, cycle);
        }
}

Foo.java:
public class Foo implements Serializable {
        int value;
        
        public Foo() {
                value = 0;
        }
        
        public int getValue() {
                return value;
        }
        public void setValue(int value) {
                this.value = value;
        }
}

--
Author of an e-Book for learning Tapestry (http://www.agileskills2.org/EWDT)


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

Reply via email to