Page 1 of 1

Issue when using page template

Posted: Wed Jun 22, 2016 4:40 pm
by Terry Gilliver

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!


Issue when using page template

Posted: Thu Jun 23, 2016 6:19 am
by Serhii Kulibaba

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


Issue when using page template

Posted: Thu Jun 23, 2016 7:17 am
by Terry Gilliver

Thanks Sergiy, works fine now.


Issue when using page template

Posted: Thu Jun 23, 2016 2:05 pm
by Galyna Abramovych

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