My 'create new User' app can only create one new user. If I want to create an additional user I have to restart the app. What I want to do is, create some button which does this task without restarting the app.
To be more specific, after the initial call of the app I create a new user (include save). The user is stored in the back-end and still visible on the front-end (so I can further edit the user). In case I want to create an additional user, I want to push some button and the view will be restarted/reloaded (and also the Model). Eventually I want the inital state of my app. Then I want to be able to create the next new user (include save) and maybe another one.
What I already tried:
- 'CrossApplicationNavigation' to my 'create new user' app without any parameters. It works only the first time, because when I push the button the second time nothing happens. The URL stays the same (no parameters are changing).
- Deleting data of the Model and subsequently calling the oninit() function. But I get problem with refilling the model.
Is there some function or something else I can try?
As descripted in comment (component.js):
init: function () {
//set model
this.setModel(models.createTableModel(this), "table");
if (this.getComponentData().startupParameters.ID) {
var sID = this.getComponentData().startupParameters.ID[0];
if (sID !== "") {
this.getModel("table").setProperty("/ID", sID);
} else {
this.getModel("table").setProperty("/ID", "");
}
}
}
onInit
yourself. Instead put your init code in a different method. Call this method from theonInit
and also later when your button is pressed to reset your view. – Marc