I don't quite understand why the following does not work and produces:

TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Exception in method uk.bl.dportal.pages.EditUser.onActivate(int) (at EditUser.java:40), parameter #1: Coercion of bl_red_hundred.gif to type java.lang.Integer (via String --> Long, Long --> Integer) failed: For input string: "bl_red_hundred.gif" org.apache.tapestry5.runtime.ComponentEventException: Exception in method uk.bl.dportal.pages.EditUser.onActivate(int) (at EditUser.java:40), parameter #1: Coercion of bl_red_hundred.gif to type java.lang.Integer (via String --> Long, Long --> Integer) failed: For input string: "bl_red_hundred.gif" at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1054)
...


I have a template which containes a reference to a gif used in the banner (BLTemplate.tml):

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
    <head>
        <title>Digital Portal: ${heading}</title>
    </head>
    <body>
<div class="nav-top" style="background: #CF0000; float:left; height:125px; width:5%;">
                        <img src="bl_red_hundred.gif" alt="bl" />
                </div>
        <div style="background: #CF0000; float:right; height:125px; width:95%">
                <h1>${title}</h1>
        </div>

        <div style="height:100%;">
        <t:body/>
        </div>
...


This template is used for all my pages (in this case EditUser.tml):

<html t:type="BLTemplate" t:heading="literal:Edit User Details"
                                                t:title="literal:Edit User 
Details"
                                                
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
    <body>
    <p><h3>Edit user details.</h3></p>
...


This page is called from a link produced by the Grid component (in ManageUsers.tml):

<t:grid t:source="allUsers" t:reorder="userName" t:exclude="id,password" t:row="listItem">
                        <t:parameter t:name="userNameCell">
                                <t:PageLink t:page="editUser" 
t:context="listItem.id">
                                        ${listItem.userName}
                                </t:PageLink>
                        </t:parameter>
        </t:grid>


and EditUser.java has an onActivate with a parameter:

        public void onActivate(int id)
        {
                Query query = session.createQuery("from User where id = 
'"+id+"'");
                List result = query.list();
                user = (User)result.get(0);
        }


Why is the GIF name being passed in initially? The page still works, so the id is being set to that given by the link from ManageUsers.tml. The exception is generated but it continues on to display the page.

However, I have a Cancel button on the EditUser page, and when I press that the whole lot fails with a coercion error, this time trying to take the name of the page from the Cancel button and pass it as a parameter:

(EditUser.tml):

<input type="button" id="cancelButton" value="Cancel" onclick="location.href='Administration';"/>


producing exception:

Exception in method uk.bl.dportal.pages.EditUser.onActivate(int) (at EditUser.java:36), parameter #1: Coercion of Administration to type java.lang.Integer (via String --> Long, Long --> Integer) failed: For input string: "Administration"


What is going on and why does this happen? It's only happening for this page which has an onActivate with a parameter. All my other pages work as expected.

thanks,
p.




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

Reply via email to