Preloading values not reflected in front end webapp checkbox

Avatar

Avatar

DAVID-GARCIA

Avatar

DAVID-GARCIA

DAVID-GARCIA

13-01-2021

Has anyone had a similar problem when preloading a record on a webapp, the context shows the correct value, but this is not reflected in the html object? I am using the new page activity: DAVID-GARCIA_2-1610550485724.png

 

 
_debug shows ctx context preloaded with flag correctly
 
DAVID-GARCIA_0-1610550398665.png

 

 
On the webapp frontend the checkbox is not checked.....
 
DAVID-GARCIA_1-1610550398666.png

 

Input form syntax:
 
<input id="uni_news" type="checkbox" checked="checked" data-nl-bindto="xpath" data-nl-xpath="@universityNews" />
preload webapp

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar

_Manoj_Kumar

MVP

Avatar

_Manoj_Kumar

MVP

_Manoj_Kumar
MVP

13-01-2021

Hello @DAVID-GARCIA ,

 

Yes, I was facing a similar issue.

 

I solved it by updating the checkbox value with javascript

 

Here is a sample code

<% if(ctx.vars.value=="1"){ %>
<Script>
document.getElementById("checkbox").checked = true;
</script>
<% }% >

 

Thanks,

Manoj

 

Avatar

Avatar

DAVID-GARCIA

Avatar

DAVID-GARCIA

DAVID-GARCIA

13-01-2021

Hi Manoj, I can't seem to reply to you, I am also inclined to use that approach as I had spent the last 24 hours troubleshooting the issue to no avail, does that mean this is an actual bug?