On Mar 31, 2005, at 4:50 PM, Ron Piterman wrote:

××××× Alex Kravets:
thanks Geoff,
So the example was wrong then? And as I understand when I define a binding with name listener it will always be put into map by Tapestry?


note that it is not "listeners:okListener" but "listeners.okListener".

That is true in 3.0...
However note that in 3.1 in addition to "ognl:listeners.okListener" that "listener:okListener" is also acceptable.


        Erik



Ognl calls getListeners(), gets a custom map implementation, which, when
get(key) is called, constructs a listener which will call your, in this case, okListener method. (or so I understand it) - this saves you much time in implementing real listener implementations.


You can define your own listener implementation though and supply it in the binding.


Geoff Longman wrote:
and the java to:

public class Home extends BasePage {


public void okListener(IrequestCycle cycle) { cycle.activate("Result"); }

}
 IActionListeners are create for you by Tapestry and hooked to the
methods with sigs as above. These synthetic listeners are stored in a
map called "listeners" hence the ognl expression
"listeners.okListener".

Geoff


On Thu, 31 Mar 2005 14:51:57 -0600, Geoff Longman <[EMAIL PROTECTED]> wrote:


change:

<binding name="listener" expression="okListener"/>

to:

<binding name="listener" expression="listeners.okListener"/>

Geoff


On Thu, 31 Mar 2005 15:21:05 -0500, Alex Kravets <[EMAIL PROTECTED] > wrote:

I am experimenting with currency converter from this tutorial:
http://www2.cpttm.org.mo/cyberlab/softdev/tapestry/ .
When I run application I get an exception:
org.apache.tapestry.BindingException
Unable to resolve expression 'okListener' for
[EMAIL PROTECTED]
binding:        ExpressionBinding[Home okListener]
location:       context:/WEB-INF/Home.page, line 10, column 56

ognl.NoSuchPropertyException
okListener

I have all the files as in tutorial, but have no idea what's going on.
Obviously it can't link Home.page with Home.java, but why?


Home.page
========
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification
PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd " >
<!-- generated by Spindle, http://spindle.sourceforge.net -->


<page-specification class="helloworld.Home">
<description><![CDATA[ add a description ]]></description>
<component id="currencyConverterForm" type="Form">
<binding name="listener" expression="okListener"/>
</component>
</page-specification>


Home.java
========
package helloworld;

import org.apache.tapestry.*;
import org.apache.tapestry.html.*;

public class Home extends BasePage {
       public IActionListener getOkListener() {
               return new IActionListener() {
                       public void actionTriggered( IComponent
component, IRequestCycle cycle) {
                               cycle.activate("Result");
                       }
               };
       }
}

thanks,
Alex





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






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


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



Reply via email to