我有一个社区页面,其设计类似于向导的界面

我有一个社区页面,其设计类似于向导的分步界面。当用户在页面之间导航时,我必须保持用户选择的单选按钮值处于选中状态。但在我的代码中,该值保存在属性中,但无法设置选定的收音机。任何帮助表示赞赏。

                     

                                                                                                                                    
                                                        
                         
{!row.FirstName}
{!row.LastName}
{!row.Email}
{!row.Phone}

图片[1]-我有一个社区页面,其设计类似于向导的界面-唐朝资源网

onRadio: function(component, event) {
         var selected = event.getSource().get("v.value");
         var seltext = event.getSource().get("v.text");     
          console.log("selectedval" + selected);

图片[2]-我有一个社区页面,其设计类似于向导的界面-唐朝资源网

console.log("seltext" + seltext); var contact = component.get("v.publicAttributes").contactRecord; var contactList = publicAttributes.contactRecords; var found = contactList.find(e => e.Id === seltext); console.log(found); component.set("v.publicAttributes.contactRecord.FirstName",found["FirstName"]); component.set("v.publicAttributes.contactRecord.LastName",found["LastName"]); component.set("v.publicAttributes.contactRecord.Email",found["Email"]);

图片[3]-我有一个社区页面,其设计类似于向导的界面-唐朝资源网

component.set("v.publicAttributes.contactRecord.Phone",found["Phone"]); var elem = event.getSource(); var selected = elem.get("v.text"); component.set("v.publicAttributes.selectedRadioSurveyContact", selected); console.log("Radiocheck" + component.get("v.publicAttributes.selectedRadioSurveyContact")); },

init: function (component, event, helper) { 
 var publicAttributes = component.get("v.publicAttributes");  
var contactRecord = component.get("v.publicAttributes").contactRecord;   
var contactList = publicAttributes.contactRecords;
var selectedContact = component.get("v.publicAttributes").selectedRadioContact;
if(selectedContact != "")
{
//When user come backs to this page

//Here i have to set the radio button selected what the user selected before
//selectedContact have the contact.Id value
document.querySelector('input[type=radio][name="options"][value="${selectedContact }"]').checked = true;
 //the above code didn't work //?????? any help # 
}
}

document.querySelector(‘input[type=radio][name=”options”][value=”${selectedContact }”]’).checked = true;

这没用

© 版权声明
THE END
喜欢就支持一下吧
点赞247 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片