Hello all,
I am trying to empty the form whenever I press add button it empty the form and take the data to an editable grid like this.
Discussion posts and replies are publicly visible
OK. Seems like a reasonable idea. Do you have any specific problem? Can you share some code?
I tried appending to another local variable and then using a!save to save null values to the local variable whenever I press add it shows the data in an editable grid but it keeps giving me an error do you have a solution for it
Hey, could you kindly provide the code snippet?
a!columnLayout( contents: { a!radioButtonField( label: "Document Form", labelPosition: "ABOVE", choiceLabels: index(rule!ONH_fetch_lookUp(lookUp: "Document Form"),"itemEn",{}), choiceValues: index(rule!ONH_fetch_lookUp(lookUp: "Document Form"),"itemId",{}), value: if(a!isNullOrEmpty(local!requestDocument.documentForm),null(),local!requestDocument.documentForm), saveInto: local!requestDocument.documentForm, required: true, choiceLayout: "COMPACT", validations: {} ) } ),
a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Add", iconPosition: "END", value: append(ri!requestDocument,local!requestDocument), saveInto: { ri!requestDocument, a!save(local!addNewDocument,null()), a!save(local!requestDocument,null()) }, style: "NORMAL", validate: if(a!isNullOrEmpty(local!requestDocument),"it is not validate",{}) ) }, align: "START" )
This is an example whenever I try to null the date or the dropdown does not work.
I think that the issue here is that you put the append into the value for your button. This will not be evaluated at button click. Just use a a!save() as the first line of your saveInto.
Regarding that error message you mentioned, it would help a lot to post it.
And next time,
Hello abd123 ,
Append will not help you perform your desired action in the Value parameter. Try using in saveInto parameter using a!save().
{ a!save( ri!requestDocument, append(ri!requestDocument,local!requestDocument) ), a!save( local!requestDocument, null() ), a!save( local!addNewDocument, null() ) }