Hi guys!

I am having some problems setting page properties. Here is how our code looks like

PageSource.java
@InjectPage( "TargetPage" )
public abstract BasePage getPageTarget();

public void myListener( IRequestCycle cycle )
{
       System.out.println( "before getPageTarget" );
       BasePage actionPage=getPageTarget();
IComponent compAction=actionPage.getComponent( "TargetComponent" ); PropertyUtils.write( compAction, "prop2", "someValue");

       System.out.println( "before activate page" );
       cycle.activate( actionPage );
}

TargetComponent.page
....
<property name="prop1" initial-value="ognl:initProp1()"/>
<property name="prop2"/>
....

TargetComponent.java
...
public void initProp1()
{
   System.out.println( "initProp1 with " + getProp2() );
   return getProp2();
}
..


Here is a what the logging looks like:
...
before getPageTarget
initProp1 with null
before activate page
initProp1 with someValue
...

Why is the init function called twice and why does the rendered page have prop1=null and prop2=someValue ? I think it's a little strange because i would expect either both properties to be null or none of them.

Thanks


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

Reply via email to