I’ve run into an issue after I successfully concatenated two different items into one text element. I’m trying to currently hide several elements if the field that populates the concatenated text is ‘null’ or 0.
I have set the elements to “Hide on Load”, disabled “Hide on Load”, removed the “else” conditional, tried setting text.length === 0; , tried setting text.length === ’ ';.
I’m stumped!
Here is my code:
$w.onReady(() => {
const dataset = $w(“#dynamicDataset”);
dataset.onReady(() => {
const { nameThen, title, firstNameNow, lastNameNow } = dataset.getCurrentItem();
$w(“#fullNameThen”).text = ${nameThen} ${title};
$w(“#fullNameNow”).text = ${firstNameNow} ${lastNameNow};
if ((“#fullNameNow”).text.length === 0) {
//fullNameNow is showing up as “Undefined”
$w(“#fullNameNow”).hide();
//text69 is showing up as “Undefined”
$w(“#text69”).hide();
//box4 is showing up as “Undefined”
$w(“#box4”).hide();
}
else {
$w(“#fullNameNow”).show();
$w(“#text69”).show();
$w(“#box4”).show();
}
Thanks for your help Adas, but unfortunately while the lack of that declaration was an oversight (thank you for pointing that out), it did not resolve the issue.
I’ve spent 8 hour yesterday attempting to resolve this by scouring the Wix Forum and Google to no avail.
Loading the code for the site. To debug this code, open masterPage.js in Developer Tools.
Loading the code for the ClassmateProfiles (ID) page. To debug this code, open pzvzt.js in Developer Tools.
Wix code SDK error: The “src” property cannot be set to “”. It must be a valid URL starting with “http://”, “https://”, or “image://”.
19
You all have a serious bug. I was editing and closing down for the night and I previewed my site one more time. A dynamic page (classmateprofiles(ID)) and there was HUGE white space that popped up. Reviewed all my code and switched browsers to test. Come to find out that the hidden box element that pops up with gallery photos had resized to 3100px and each gallery was 2500px each (stacked on top of one another in two rows; 6 total). Since it was hidden, I couldn’t see it, but I finally got the editor to duplicate it as it was not showing up in the editor (was appearing normal). Tried to resize dimensions manually and it keeps reverting. Cleared cache/cookies on both firefox and chrome. Nothing budges. I’m on a deadline to get this project done. HELP!
…and NOW I’m getting an error code 15 because it’s failing to try and update/publish >:\
First, you have too many onReady functions in your ClassmateProfiles(ID) page.
Note that when defining the onReady event multiple times only the last definition will register, since it overrides the previous ones.
Try fixing this and see if it sorts out the undefined issue.
Second, regarding the errors and layout issues - do you still experience this issue?
Was the issue solved on its on or did you performed any action ?