CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Validations not rendered when using IWTemplateProcessor

by gamut » 09 May 2016 11:23

I have a project which uses IWTemplateProcessor to generate the layout of a page. Unfortunately this seems to affect the rendering of JQEdit controls on the page. Only the first of them has the validation code rendered even though both have validation defined.

First JQEdit is correctly rendered
<div style="position: relative;z-index: 100;width: 121px;height: 21px;padding: 0;border-style: none;border-width: 0px;" id="EDFIRSTNAME"><div class="element-size-fix">
<input aria-required="true" name="EDFIRSTNAMEINNER" maxlength="2147483647" style="text-align: left;padding:0;width:100%;height:100%;" class="cgdevtools-input ui-widget ui-widget-content ui-corner-all jquery-validation-error ui-state-error" id="EDFIRSTNAMEINNER" type="text"><label for="EDFIRSTNAMEINNER" style="position: absolute; top: 0px; left: 126px; display: inline;" class="jquery-validation-error ui-state-error" id="EDFIRSTNAMEINNER-error">This field is required.</label></div></div>

Second JQEdit is incorrectly rendered
<div style="position: relative;z-index: 100;width: 121px;height: 21px;padding: 0;border-style: none;border-width: 0px;" id="EDSURNAME"><div class="element-size-fix">
<input name="EDSURNAMEINNER" maxlength="2147483647" style="text-align: left;padding:0;width:100%;height:100%;" class="cgdevtools-input ui-widget ui-widget-content ui-corner-all" id="EDSURNAMEINNER" type="text"></div></div>


The code which defined the validations on both edits is in the form render event
with edFirstName.JQValidateOptions do
begin
Enable:= True;
{REQUIRED}
LRule:= Rules.Add;
LRule.Rule:= jqvorvRequired;
{MINLENGTH}
LRule:= Rules.Add;
LRule.Rule:= jqvorvMaxLength;
LRule.Value:= '20';
end;
with edSurname.JQValidateOptions do
begin
Enable:= True;
{REQUIRED}
LRule:= Rules.Add;
LRule.Rule:= jqvorvRequired;
{MINLENGTH}
LRule:= Rules.Add;
LRule.Rule:= jqvorvMaxLength;
LRule.Value:= '20';
end;


For testing I have reduced the template to almost no content:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" type="image/x-icon" href="sites/site/images/favicon.ico">
<meta name="keywords" />
<meta name="description" />

</head>
<body>
{%edFirstName%}<br>
{%edSurname%}
</body>
</html>


If I run this without specifying the template processor as the form layoutMgr the controls are rendered and function correctly

Is this known behaviour?
gamut
 
Posts: 27
Joined: 27 Apr 2013 01:54

by Jorge Sousa » 10 May 2016 14:19

Hello

Yes, this a known and expected behaviour.

Intraweb cuts all the internal inline style.

You can check other way, using a TIWEdit, TIWButton, etc...

Ie, if you've templates you must take care of the css.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by gamut » 12 May 2016 14:08

Thank you jorge. I will look into this.

Do you think it would work to invoke the CG JQuery methods by referencing the components directly in the template (currently they are on a region which is referenced in the template) and wrapping them in the inline styles that you would otherwise generate ?
gamut
 
Posts: 27
Joined: 27 Apr 2013 01:54

by Alexander Bulei » 16 May 2016 09:37

Hi gamut,

Also, please check the browser console for js errors.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQEdit

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.