Check out the second comment by HLS:

"Or, here's a better idea; an id should only be generated if getClientId() is invoked, at which point the id attribute of the element may be set. Dynamic updates to the DOM are a great thing. "

That's the behavior that ended up getting implemented.
You still want to use t:id.

But you need to make sure that "getClientId" is called.

A simple way to do this would be to attach a mixin:

package com.example.mixins;

public class EnsureId {
    @InjectContainer
    private ClientElement element;
    void beginRender() {
        element.getClientId();
    }
}

<t:pagelink t:id="new" mixins="ensureid" page="newid">Some Link</ t:pagelink>


Robert


On Aug 19, 2008, at 8/1910:42 AM , Mark Horn wrote:

hhmm... that is a problem as my links are in a loop. so they used to
be remove, remove_0, etc.  if I set id="remove" then all links have
the id of 'remove' which does not work for my tests ether.

Any other ideas?

On Tue, Aug 19, 2008 at 11:32 AM, Mark Horn <[EMAIL PROTECTED]> wrote:
right.. how did I miss that. thanks!

On Tue, Aug 19, 2008 at 11:27 AM, Filip S. Adamsen <[EMAIL PROTECTED]> wrote:
Hi,

As far as I can tell from the issue you linked to, you need to bind the id
(not t:id) parameter of the link.

-Filip

On 2008-08-19 17:11, Mark Horn wrote:

I just updated to Tapestry 5.0.14 from 5.0.11 and have run into an
issue with using PageTester to test ActionLinks as shown here
http://tapestry.apache.org/tapestry5/guide/unit-testing-pages.html

It looks like this change in 5.0.12,

https://issues.apache.org/jira/browse/TAPESTRY-2294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
is causing the trouble I'm running into.

My ActionLinks no longer have an "id" therefore the call

Element link = doc.getElementById("link1");

is now returning an null, causing the line

doc = tester.clickLink(link);

to throw a NullPointException.

Any suggestions on how to get around this?

example of from tml file where id was set using t:id

                      <table t:type="grid" source="list" row="type"
                              reorder="name,description" >
                              <t:parameter name="nameCell">
                                      <t:pagelink t:id="new"
page="prop:createPage">
                                              ${type.name}
                                      </t:pagelink>
                              </t:parameter>
                      </table>

Thanks,
Mark

---------------------------------------------------------------------
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]


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

Reply via email to