Remi
Remi

Reputation: 115

Onkeyup Events with Tapestry 5.2.6

I am tring to use the mixins zoneUpdater from Tapestry to trigger an event when I write in a textfield. However I keep getting the following error :

Failure creating embedded component 'myComponent' of com.mycompany.myapp.web.pages.tapestryTest.testEdit: Unable to resolve 'zoneUpdater' to a mixin class name.

Here is the code in the tml page :

<div t:type="zone" t:id="myZone" id="myZone" update="show">
<table><tr>
    <td class="td-right-view"><t:label for="myComponent"/></td>
    <td class="td-left-view"><t:textfield t:id="myComponent"
    value="myValue" t:validate="maxlength=8" maxlength="8"
    style="width:70px;" t:mixins="zoneUpdater" t:clientEvent="keyup" 
    t:event="updateMyValue"  t:zone="myZone"/></td></tr>
</table
</div>

In the controller I defined the following method :

@OnEvent(component = "updateMyValue")
Object onupdateMyValue()
{
    if (this.value.length()==8){
        //does something
    }

    return myZone.getBody();
}

Any idea why I keep getting this problem? I am doing the same thing as on jumpstart but for some reason it doesn't recognise zoneUpdater. I am using Tapestry 5.2.3 so it should work without creating the classes from Jumpstart.

Thanks in advance, Remi

Upvotes: 1

Views: 321

Answers (1)

Bob Harner
Bob Harner

Reputation: 754

Tapestry itself does not have a mixin called ZoneUpdater. The one described on Jumpstart pages (e.g., http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/onevent) is a custom one. See that link for the source code. Just paste that code into your project.

Upvotes: 1

Related Questions