Hi Thiago, it works now, thanks a lot. So the t:id attribute is bound to
the component and the value attribute is bound to the property.
I think thats all a little bit confusing for new tapestry users like me.
First of all the "value" attribute. In standard HTML the value attribute
of an input field defines its predefined value. This is pretty obvious,
the component gets its value from the "value"-attribute and you can
access it with getVal() in js. But using this attribute to bind it to a
tapestry property makes no sense to me, because thats a different
thing. Why not name it t:property? This would make it a lot clearer.
Second, why do I need to define a component and a property binding? Why
cannot the component itself has a getValue() method? Well maybe thats a
design decision and I don't see the advantage. But for me its extra code
which confuses me.
Anyway, thanks Thiago for your support :).
On 11/08/13 02:25, Thiago H de Paula Figueiredo wrote:
On Thu, 07 Nov 2013 18:17:10 -0200, thegreatmewel
<thegreatme...@gmail.com> wrote:
I'm not sure what do you mean with a getter for passwordRequest? I
have a passwordRepeat field and a getter getPasswordRepeat(). I
thought that is enough.
<t:passwordfield t:id="passwordRepeat" class="form-control" />
As you haven't set the 'value' parameter explicitly, you bound it to
the PasswordField instance yourself. You should add a @Property
private String password; field to the Java class, add value="password"
to the line and it'll work.
<t:passwordfield t:id="passwordRepeat" value="password"
class="form-control" />
On 11/07/13 20:35, Thiago H de Paula Figueiredo wrote:
Aren't you missing a getter for passwordRequest?
On Thu, 07 Nov 2013 17:27:52 -0200, thegreatmewel
<thegreatme...@gmail.com> wrote:
Yep, im using 5.4-alpha-24 and with bootstrap it looks a lot nicer.
Now I have a strange problem with my password repeat field. I
always get the error:
org.apache.tapestry5.ioc.internal.OperationException
Render queue error in BeginRender[user/Register:passwordrepeat]:
Parameter 'translate' of component user/Register:passwordrepeat is
bound to null. This parameter is not allowed to be null.
[controller snippet]
@InjectComponent
private PasswordField passwordRepeat;
@Component
private Form registerAccount;
public PasswordField getPasswordRepeat() {
return passwordRepeat;
}
void onValidateFromRegisterAccount() {
if (!user.password.equals(passwordRepeat)) {
registerAccount.recordError(passwordRepeat, "Please
enter the same password in both password fields.");
}
}
[/controller snippet]
and my tml:
<t:form class="form-horizontal" t:id="registerAccount">
<t:errors />
<t:beaneditor object="user"
reorder="firstName,lastName,email,phoneNumber,password">
<p:password>
<div class="form-group">
<t:label for="password" class="col-sm-2 control-label" />
<div class="col-sm-6">
<t:passwordfield t:id="password" value="user.password"
class="form-control" />
</div>
</div>
</p:password>
</t:beaneditor>
<div class="form-group">
<t:label for="passwordRepeat" class="col-sm-2 control-label" />
<div class="col-sm-6">
<t:passwordfield t:id="passwordRepeat" class="form-control" />
</div>
</div>
<div class="btn-toolbar">
<div class="btn-group">
<input class="btn btn-primary" type="submit" value="Create
Account" />
</div>
</div>
</t:form>
Well, it looks like that a 'translate' property of the password
repeater field is missing. But I have no idea why.
Thanks in advance
Matthias
ps.
It's a bit confusing when using @Component or @InjectComponent,
also its confusing when to add a "value" attribute to the t:*
object an when not. Maybe i will figure this out in future :)
On 11/06/13 23:00, Thiago H de Paula Figueiredo wrote:
On Wed, 06 Nov 2013 18:21:04 -0200, thegreatmewel
<thegreatme...@gmail.com> wrote:
Hi Thiago, im overwhelmed, it works like a charm :). I just had
to add 'class="form-horizontal"' to my form. Thanks a lot!
Are you using 5.4-alpha-24? Nice to know someone is using one of
my rare (so far!) commits and it's working as it should. :)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org