Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

Issue when using page template

I had a working page which I moved contents to a new page based on a template.

It contains a collapsible component and I have the following js in the response mapping for the component heading such that I get first and last name labels.

codevar firstname = value;

var lastname_element = element.closest("[name=edit_client]").find("[name=lastname_label]");
console.log("lastname_element = ",lastname_element);

var lastname = lastname_element.text();
console.log("lastname = ",lastname);

return firstname + " " + lastname;/code

The lastname is not being returned.

The console shows that the lastname_element is as follows and clearly shows the lastname: 'Black'

Image

The lastname value is as it was at design time:

Image

I just cannot see why it is not returning the correct value in my js.

I must have the correct js, or it would not return the design time text!

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Issue when using page template

Hello Terry,

Please use a mapping from $ to that component, instead of reading label components. In that case please use JS below:
prereturn value.firstname + " " + value.lastname;/pre
here "firstname" and "lastname" - names of response parameters

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

Issue when using page template

Thanks Sergiy, works fine now.

Galyna Abramovych
Site Admin
Posts: 84
Joined: Tue Mar 22, 2016 6:03 pm

Issue when using page template

Thank you for update, Terry.
We are glad it works.

Return to “Issues”