<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class="">I’d like to use user attributes to store information like “Subscribe to newsletter” which is obviously checkbox.</div><div class=""><br class=""></div><div class="">How should I implement it in my account.ftl?</div><div class=""><br class=""></div><div class="">I have in account.flt:</div><div class=""><div class="form-group"><br class=""> <div class="checkbox"><br class=""> <label for="user.attributes.newsletter" class="control-label"><br class=""> <input type="checkbox" class="form-control" id="user.attributes.newsletter" name="user.attributes.newsletter" <#if account.attributes.newsletter??>checked</#if>/><br class=""> ${msg("newsletter")}<br class=""> </label><br class=""> </div><br class=""></div><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">When I tick it and submit form everything is OK but when untick it and submit then checkbox is still checked.</div><div class="">I guess it’s because checkbox state is included in HTTP Form Data only when it’s checked.</div><div class=""><br class=""></div><div class="">How to handle this in KC UI ?</div><div class=""><br class=""></div><div class="">I remember that other frameworks used some hidden fields to post the information either if checkbox was ticked or not. But I’m not sure how KC GUI framework handle this use case.<br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Thanks,</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Libor Krzyžanek</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://jboss.org" class="">jboss.org</a> Development Team</div>
</div>
<br class=""></div></body></html>