Make sure that your "requestorsLoop" is outputting an actual html element on
render. If you can't view source of a rendered page and find an existing
html element then there is nothing to "update". I think using the For
component you have to specify element="div || span || whatever " to get it
to output the content.

On 9/21/06, Roberto Ramírez Vique <[EMAIL PROTECTED]> wrote:

Hi everybody,

I'm an starter in Tapestry 4.1, using tomcat 5.5 and jdk 1.5

I want to have a link (a plus image :P) that adds a new element to the for
loop. I tried this:

    @EventListener(elements="addLink", events="onclick",
submitForm="userForm", async=true)
    public void addNewRequester(IRequestCycle cycle){
        this.getLoanAdvice().getRequesters().add(new
PersonEconomicEvaluation());

        cycle.getResponseBuilder().updateComponent("requestersLoop");
    }

The html is this:

    <span jwcid="requestersLoop">
    <fieldset>
    <div>
        <a jwcid="[EMAIL PROTECTED]"><img
src="images/images-new/delsigner_01.jpg" ></a>
    </div>
    </fieldset>

Obviously, "requesterLoop" is a loop over the
getLoanAdvice().getRequesters() ... the method 'addNewRequester' is supose
to add a new item in the for loop. The serverside is called, but the
client
side doens't update correctly, eventhough I call the '
cycle.getResponseBuilder().updateComponent("requestersLoop");' method... I
tried updating directly the entire form, but doesn't work.

My first question is, is it possible ?

And the second one is, can any of you see what I'm missing?

Thanks in advance,
--
Robert Ramírez Vique
Computer Science Engineer




--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Reply via email to