-
1. Re: Errai UI : conditions in HTML
magick93 May 19, 2014 10:51 AM (in response to matic.petek)Sounds like you want to use a producer - Producers - Errai - Project Documentation Editor
-
2. Re: Errai UI : conditions in HTML
matic.petek May 19, 2014 11:02 AM (in response to magick93)Hi,
Thank you Anton. But I don't really think this is solution for my problem. I would like to have the some Java class for HTML template, but conditions inside HTML templates. For example :
+++++ MyTemplate.html
<form>
<legend>Log in to your account</legend>
<label for="username">Username</label>
<input id="username" type="text" placeholder="Username">
<#if show_input_password??>
<label for="password">Password</label>
<input id="password" type="password" placeholder="Password">
</#if>
<button>Log in</button>
<button>Cancel</button>
</form>
+++++ MyTemplate.java
@Templated
public class MyTemplate extends Composite {
Boolean show_input_password;
}
Regards,
Matic
-
3. Re: Errai UI : conditions in HTML
csa May 20, 2014 6:13 AM (in response to matic.petek)Hi Matic,
This isn't possible inside the template as we want our templates to be plain/standard conform HTML5 so they can be rendered in the browser directly (without having to pass them through a template engine when designing the UI).
So, you will need to do this in Java code, either by injecting a different composite (that is based on a different template) i.e. using a producer as Anton suggested or doing it programmatically.
Cheers,
Christian
-
4. Re: Errai UI : conditions in HTML
matic.petek May 20, 2014 6:17 AM (in response to csa)Hi Christian,
Thank you for reply. I have discussion about this with my coworker and find out the some thing - we will use different composite.
Regards,
Matic