0
votes

This is now in addition to this question I asked earlier(2nd day on play here)

tag not receiving the model bean (it's null) but containing page does?

but now I get the value on the page in the input text box, but on post it is not delivered to my controller while the company object is delivered to my controller.

I basically have a page like this

    #{form @Login.registerFinish(), id:'register'}

        #{registerUserImpl user:user/}  
//then there are more input fields for the company

then, there is my tag file which has fields like so

<div id="register:firstDecorate">
    <div class="entry">
        <div class="spacer"></div>
        #{field '_user.firstName'}
        <span class="label ${field.errorClass}">User's First Name:</span>
        <span class="input ${field.errorClass}">
            <input type="text" class="boxtpl" name="${field.name}" value="${_user?.firstName}">
            <a id="newinfo" class="help" title="&{'help.usersFirstName'}">Help</a>
            <span class="error">${field.error}</span>
        </span>
        #{/field}
    </div>
</div>

Soooo, then my first controller to get to this page passes a UserDbo and CompanyDbo and I see the email from the UserDbo fill in the input type=text element just fine and when I then submit the form, I see CompanyDbo passed to my controller but UserDbo is null???

My method signature for the controller in the java code is

public static void registerFinish(UserDbo user, CompanyDbo company) {
        //here we show the invite user page first normally...
        log.info("user="+user+" company="+company+" c="+company.getAlias());

I have no idea why my user data is not being passed to me. We have two pages re-using this page(well, this is a port from seam to try out the playframework).

thanks, Dean

1

1 Answers

1
votes

try change name="${field.name}" in the input tag to name="user.firstName". I'm guessing that when your above template is rendered the ${field.name} is rendered to _user.firstName which then doesn't bind to the signature of the controller "UserDbo user".

You can test this by either making the change and trying it or looking at the actual rendered page source from your current code. Also, if this doesn't work can you add your page source for the form section to the question so we can have a look at it.