Hi there,
I have created two interface which are MedicalRequestForm and EquipmentRequestForm, then I created third interface as RequestForm where I took a radio button and shown the value as RequesType (Medical and Equipment).
I want that MedicalRequestForm or EquipmentRequestForm must be shown on the basis of radio button selection which is working. But In my first both interfaces, I have one dropdown, so whenever I am selecting a value from the dropdown, then whole Interface (RequestForm) is getting reload/refresh.
Note: I took the rule input as ZMS_Requests in all the interfaces separately.
Please see the below screenshots:
1. MedicalRequestForm:
2. EquipmentRequestForm:
3. RequestForm (without selection):
4. RequestForm (with selection of Medical):
5. RequestForm is getting back as screenshot no.3 when I select a value from dropdown Animal Name as above screenshot.
Could anyone of you help me to resolve this issue?
Please let me know if you need code.
Thank you in advance!
Regards,
Shubham Kumar
Discussion posts and replies are publicly visible
Hi, can you check what are you saving in drop-down field? Are you making radio button selection null here? If you are saying ,after selecting from drop down you are going back to screenshot 3 then it means that selected radio button value is getting null.
Hi, thanks for your response.
I am saving the value for radio button, and for dropdown also.
can you share your code for Aniaml name dropdown?
local!List: rule!ZMS_GetAnimalList(), a!dropdownField( label: "Animal Name", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: index(local!List, "animalname"), choiceValues: index(local!List, "animalid"), value: ri!ZMS_Requests.aniamlid, saveInto: ri!ZMS_Requests.aniamlid, searchDisplay: "AUTO", required: true, requiredMessage: "please select an animal", validations: {} )
Dropdown code looks okay to me. is it possible to share code for the main request form? its difficult to debug the issue without seeing the code.
a!formLayout( label: "Requests", contents: { a!columnsLayout( columns: { a!columnLayout( contents: {} ), a!columnLayout( contents: { a!radioButtonField( label: "Request Type", labelPosition: "ABOVE", choiceLabels: cons!ZMS_REQUEST_TYPES, choiceValues: cons!ZMS_REQUEST_TYPES, value: ri!ZMS_Requests.requesttype, saveInto: ri!ZMS_Requests.requesttype, required: true, requiredMessage: "please select request type", choiceLayout: "COMPACT", choiceStyle: "STANDARD", validations: {} ) } ), a!columnLayout( contents: {} ) } ), a!boxLayout( label: "Medical Request", contents: rule!ZMS_MedicalRequestForm(ZMS_Requests: ""), showWhen: if( ri!ZMS_Requests.requesttype = cons!ZMS_REQUEST_TYPES[1], true, false ), style: "SUCCESS", shape: "ROUNDED", marginBelow: "STANDARD" ), a!boxLayout( label: "Equipment Request", contents: rule!ZMS_EquipmentRequestForm(ZMS_Requests: ""), showWhen: if( ri!ZMS_Requests.requesttype = cons!ZMS_REQUEST_TYPES[2], true, false ), style: "SUCCESS", shape: "ROUNDED", marginBelow: "STANDARD" ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", submit: true, style: "PRIMARY" ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, saveInto: ri!cancel, submit: true, style: "NORMAL", validate: false ) } ) )
I resolved it. I was passing the null value at line no. 33
Before:
contents: rule!ZMS_MedicalRequestForm(ZMS_Requests: "")
Now:
contents: rule!ZMS_MedicalRequestForm(ZMS_Requests: ri!ZMS_Requests),
good job.
Thank you
good job