@volkaertskristof Also, no, his code is fine.
@ahmadnasriya
I know thats why i said he should disconnect it from the dataset ![]()
But it seems like he uses a dynamic dataset and i never really worked with it
@volkaertskristof It doesn’t matter, both types of datasets have a save() method.
@ahmadnasriya
Oow didn’t see he putted a string in REPEATER & DATASET,
Tought he putted the element in it
And indeed the repeater is inItemReady
Exactly Ahmad. This is why i had this code-line in my CODE…
let DATASET="#???????????????????????????????????????????"
With the same question ![]()
@Kristof —> Sorry for confusion.
The code was just not completely ready, because i was confused. There was no clear answer, if it was a DYNAMIC one or NOT
, i tried to figure it out.
@russian-dima The question we’ll never get an answer for ![]()
@ahmadnasriya Just read this post, again, oh hell, of course this was my fault.
I did not see that i have forgotten the onItemReady (must be a copy-paste error from my side).
And one more thing. You said it seems to be overcpmlicated Ahmad, yes you are right but only if we have a DYNAMIC dataset which is used, right? Else we would need the REPEATER.
If i am wrong, let me know. Everytime open for NEW food for my brain ![]()
![]()
@russian-dima No, by overcomplicating the issue I meant the given solutions.
Could this be solved at the end?
@ahmadnasriya @russian-dima @volkaertskristof Thank you for your help.
But I’m still confuse…
Just need this code?
export function button268_click ( event ) {
$w ( ‘#dynamicDataset’ ). save ();
}
I tried but save only 1 repeater.
Of course, I disconnect the button from the dataset.
Ok, then one more time, please show your setup by showing some good screenshots of all your used/involved ELEMENTS…and all their IDs + the related DATABASE and their DB-FIELDS.
I assume that you are using a → dynamic-dataset insted of a non-dynamic.
You said → you are using just 1x REPEATER, right?
The problem is, that anybody knows exactly your setup.
If it is a dynamic dataset, than you are working on a dynamic-page.
If it is a dynamic page → then you will see it in the left properties-panel, because your page will be on the very bottom, located under the dynamic-pages section.
And you also can show always just ONE item on a dynamic page.
How do work a DYNAMIC-PAGE? How do work a DATASET ? How do work a REPEATER? How is everything connected to to eachother?
Take a look onto this pic…
@russian-dima
My repeater connect to database named contents.
Not connect the button
This page is not dynamic page.
Because in the dynamic page place, the contents collection not here.
the page name [page1]
The contents collection in the Site Menu .
the dataset name [dynamicDataset] is just a name.
@nanami Wait, what do you mean it only saves one repeater? Do you have multiple repeaters? Why did you expect it to save multiple repeaters (datasets)?
If for some reason you have multiple datasets and repeaters on your page, and each repeater is connected to a dataset, you can save all datasets by one command.
$w('#saveBtn').onClick(() => {
$w('#dataset1, #dataset2, #dataset3').save();
})
The above code will save 3 datasets with one single click.
Yeah very complicated issue-description
.
-DYNAMIC or NON-DYNAMIC ?
- 1xREPEATER or MULTIPLE ?
Ok, let’s say you have your REPEATER placed on a NON-DYNAMIC-PAGE (although i do still not understand, why your dataset is dynamic, or why it is called “dynamic-dataset”)—> you said…
the dataset name is dynamicDataset.
default name.
Default name for a NON-DYNAMIC-DATASET would be → “dataset1” and not “dynamicDataset”. Please check the connection of your dataset, or just delete it and reconnect a NEW dataset.
Normaly your dataset now should have the following ID —> " dataset1 " and should be connected to your DATABASE called → " contents ".
Since you want to save all data, without doing any changes on it, you can follow Ahmads suggestion and use the following…
$w ( ‘#saveBtn’ ). onClick (() => { $w ( ‘#dataset1, #dataset2, #dataset3’ ). save ();})
Also Ahmad already gave you the ability to save multiple DATASETS at once (if you have multiple dataset-connections).
Your CODE than would be something like this one…
let DATASET = "#dataset1" //+additional if needed ---> ,#dataset2, #dataset3;
$w.onReady(()=> {console.log("Page is ---> READY...")
$w(DATASET).onReady(()=> {console.log("Dataset is READY!")
$w('#button268').onClick(()=>{console.log("EXTERN-Button-Clicked!!!")
$w(DATASET).save(); console.log("Save-process running...")
});
$w(DATASET).onAfterSave(()=> {console.log("Data-save-process acompllished!");});
});
});
Do not connect the safe-function trough properties panel, because all will work just by code. Connect just DATASET + DATABASE.
Only 1 dataset.
and
Only 1 repeater.
@russian-dima
I delete the dataset and delete the page.
I create same page again.
but still not work.
still save only 1 data.
@nanami
I think you will need this one…
$w("#myDataset").add()
2 .then( ( ) => {
3 console.log("New item added");
4 } )
5 .catch( (err) => {
6 let errMsg = err;
7 } );
First ADDING a new blank item into your DATABASE, then save.
Try it out
This one works well on my test-setup…
let DATASET = "#dataset1" //+additional if needed ---> ,#dataset2, #dataset3;
$w.onReady(()=> {console.log("Page is ---> READY...")
$w(DATASET).onReady(()=> {console.log("Dataset is READY!")
$w('#button1').onClick(()=>{console.log("EXTERN-Button-Clicked!!!")
// $w(DATASET).save(); console.log("Save-process running...")
$w(DATASET).add().then(()=> {console.log("New item added");})
});
$w(DATASET).onAfterSave(()=> {console.log("Data-save-process acompllished!");});
});
});
https://russian-dima.wixsite.com/login-system/test-seite
JUST an simple EXAMPLE! → Not worked out completely !
@russian-dima Thank you for your thoughtfulness.
I’m sorry to keep repeating myself.
Your code can add the blank item.
And the blank item can save.
But still not save default item.
I don’t want new blank item.
I just want to overwrite it…
@nanami
Wait! You want just to overwrite the existing item?
Than you will always have just one database-line, right?
You save → the current already existing line with data, will be overwritten with new data → no new dataline will be generated → is this what you want?
If i am honest —> now i am totaly confused xDDDDDD
All of us (Me / Ahmad & Kristof are stupid) ![]()
Perhaps it would be better, if you would show us the wished result.
And why you need the repeater?








