1

I have a Tab which contains list of records and actions. they i will have three actions like Approve,Reject and Need more Info. on click of Reject i will show an Modal popup which will have a Comments Field. User will enter his comments in that text box and he will click on submit(Values will store temporary, those values will not update in database). then i am storing that text field value in Json Array in controller. now i want to show that text box value after clicking on Reject button. Below i am sharing my code.

// for reject
openrejModel: function(component, event, helper) {
    var idx = event.getSource().get("v.value");// getting record id on click of reject button
    component.set("v.rejIDFValue",idx);     
    component.set("v.isRejectOpen", true); 
},   
closerejModel: function(component, event, helper) {

    component.set("v.isRejectOpen", false);
}, 

rejcomment : function(component, event, helper) 
{        
    var flow = component.find("flowIDFbulk");        
    var inputVariables = {
        "Reject":[]          

};
        var obj = {};
        obj["name"] = 'IC_Review_Action_RB';
        obj["value"] = 'Reject';
        obj["RecordId"] = component.get("v.rejIDFValue");
        obj["Comments"] = component.find("RejectComments").get("v.value");
        inputVariables.Reject.push(obj);
        alert(inputVariables);
         alert(inputVariables.Reject[0].RecordId);
         for(var i = 0; i < inputVariables.Reject.length; i++)
         {
               if(inputVariables.Reject[i].RecordId == component.get("v.rejIDFValue"))
               {
                   alert(inputVariables.Reject[0].Comments);
                   var comnt = inputVariables.Reject[i].Comments;
                   alert(comnt);
               }
         }
    component.set("v.isRejectOpen", false);
},

MY Component:

 <!-- Model Popup for Reject -->
<aura:if isTrue="{!v.isRejectOpen}">
  <div role="dialog" tabindex="-1" aria-labelledby="header99" class="slds-modal slds-fade-in-open ">
    <div class="slds-modal__container">
      <div class="slds-modal__header">
        <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{!c.closerejModel}">
        <span class="slds-assistive-text">Close</span>
        </button>
        <h2 id="header99" class="slds-text-heading--medium">Reject</h2>
      </div>
     <div class="slds-modal__content slds-p-around--medium">
        <form>
            <ui:inputTextArea aura:id="RejectComments" label="Comments" rows="5"/>                
        </form>
     </div>
       <div class="slds-modal__footer">
        <button class="slds-button slds-button--neutral" onclick="{!c.closerejModel}" >Cancel</button>
        <button class="slds-button slds-button--brand" onclick="{!c.rejcomment}">Submit</button>
      </div>
    </div>
  </div>
  <div class="slds-backdrop slds-backdrop--open"></div>
  </aura:if>
<td scope="row">
             <lightning:buttonIcon iconName="utility:close" variant="bare" onclick="{!c.openrejModel}" value="{!idf.Base_Invention_Disclosure__c}" alternativeText="Recject Inention Disclosure" />&nbsp;

           </td>
2

0

You must log in to answer this question.

Browse other questions tagged .