Good guess, but unfortunately I have put the form tags in - here's an
html snippet that might give everyone more info...
<body>
<form>
<table>
<tr>
<td id="menu" valign="top">
...
</td>
<td id="body">
...
<table
jsfid="userSearchTable">
<thead class="header">
<tr>
<td>Screen name</td>
<td>First name</td>
<td>Last name</td>
<td>Email</td>
</tr>
</thead>
<tr>
<td>ipriest</td>
<td>Ian</td>
<td>Priest</td>
<td>[EMAIL PROTECTED]</td>
</tr>
</table>
...
</td>
</tr>
</table>
</form>
</body>
-----Original Message-----
From: Alberto Molpeceres [mailto:[EMAIL PROTECTED]
Sent: 04 May 2006 09:31
To: Struts Users Mailing List
Subject: Re: [shale][clay] commandLink in dataTable not working
I don't know if this applies since I've never used Clay, but when you
have this lind of problem in JSF, 95% of the times if because you forgot
to declare the form. CommandLinks doesn't work if not inside of a form.
al.
On 5/4/06, Ian.Priest <[EMAIL PROTECTED]> wrote:
>
> This is driving me mad - can anyone see why my command link isn't
> working?
> I have a table that lists customers and has an action link in each row
> to view customer details. I build all my viws using clay. The clay
> components are:
>
> <component jsfid="userSearchTable" extends="dataTable"
> allowBody="false">
> <attributes>
> <set name="value"
> value="[EMAIL PROTECTED]" />
> <set name="var" value="customer" />
> </attributes>
>
> <element renderId="0" jsfid="userNameColumn" />
> <element renderId="1" jsfid="firstNameColumn" />
> <element renderId="2" jsfid="lastNameColumn" />
> <element renderId="3" jsfid="emailColumn" /> </component>
>
> <component jsfid="userNameColumn" extends="column" id="screenName">
>
> <element renderId="0" jsfid="outputText" facetName="header">
> <attributes>
> <set name="value"
> value="#{messages['@managed-bean-name.usernamecol.header']}" />
> </attributes>
> </element>
>
> <element renderId="1" jsfid="commandLink" id="link">
> <attributes>
> <set name="action" value="showUser" />
> <set name="actionListener"
> value="[EMAIL PROTECTED]" />
> </attributes>
>
> <element renderId="10" jsfid="outputText">
> <attributes>
> <set name="value"
> value="#{customer.user.username}" />
> </attributes>
> </element>
>
> <element renderId="11" jsfid="param" id="customerId">
> <attributes>
> <set name="name" value="id" />
> <set name="value"
value="#{customer.id}"
> />
> </attributes>
> </element>
> </element>
> </component>
>
> I've set up faces config like this...
>
> <navigation-rule>
> <from-view-id>/admin/*</from-view-id>
> <navigation-case>
> <from-outcome>showUser</from-outcome>
> <to-view-id>/admin/showuser.html</to-view-id>
> <redirect/>
> </navigation-case>
> </navigation-rule>
>
> And my action listener method is just this for now...
>
> public void showUser(ActionEvent event) {
> logger.debug("Entered showUser");
>
> UIParameter component = (UIParameter)
> event.getComponent().findComponent("customerId");
> long id =
> Long.parseLong(component.getValue().toString());
>
> logger.debug("id = " + id);
> }
>
>
> The table appears to render ok, but when I click on the link the
> actionListener method isn't called and my navigation rule is ignored.
> (Actually the page with the table goes back to itself, which suggests
> the app is seeing null as the outcome of the click).
> There are no errors logged. I've even deliberately mis-typed the name
> of the actionListener method in the clay-config file and it still
> didn't throw an exception, so I'm pretty sure it's not trying to call
it!
>
> I'm a bit stuck as to what else to look for to fix it, so all hints
> and tips are welcome!
>
> Cheers,
> Ian.
>
>
---------------------------------------------------------------------
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]