Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Removing close option on a dialogue box attached to UI Action

labandar
Tera Contributor

Hello everyone I'm currently working on Request Approval UI action where I need a popup onClick, I need to make it mandatory so I have to remove the close(x) button from the dialogue box and make it mandatory to Calculate risk can someone help me with this.

 

labandar_1-1733907710721.png


Here's the code I'm using to show the pop up:

var riskAssessmentUIPage = 'stla_change_request_risk_calculation';
    var riskAssessmentPopup =  new GlideModal(riskAssessmentUIPage);
        riskAssessmentPopup.setPreference("onRiskCalculate","yes");
        riskAssessmentPopup.render();
        window.g_parentDialog = riskAssessmentPopup;

-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
UI Page:
HTML: 
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
   
    <div role="alertdialog">
    <p id="change_request_risk_assessment"></p>
    <div class="modal-footer" style="display: flex; align-items: center; justify-content: space-between;">
        <!-- The text "Risk Evaluation" aligned to the left -->
        <span><h4><b>Risk Evaluation</b></h4></span>
        <!-- The button aligned to the right -->
        <button id="change_request_risk_confirmation_save" class="btn btn-default" onRiskCalculate="save('yes')">
            ${gs.getMessage("Calculate Risk")}
        </button>
    </div>
</div>

</j:jelly>
-------------------------------------------------------------------------------------------------------------
UI Page Client Script: 
function save(shouldAssess){
    var gdw = GlideDialogWindow.get();
    if(shouldAssess == 'yes'){
        var complete = gdw.getPreference('onRiskCalculate');
        if(complete == 'yes'){
            invokeRiskAssessment();
            g_form.setValue("state", "-4");
                        gsftSubmit(null, g_form.getFormElement(), 'state_model_request_assess_approval');
        }
    }

        gdw.destroy();  
}


 

1 ACCEPTED SOLUTION

Bhavya11
Kilo Patron
Kilo Patron

Hi @labandar ,

 

 

You need set a second parameter in your GlideModal declaration:

var dialog = new GlideModal("your page name", true);<-- adding true removes the close icon

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks,

BK

View solution in original post

2 REPLIES 2

Bhavya11
Kilo Patron
Kilo Patron

Hi @labandar ,

 

 

You need set a second parameter in your GlideModal declaration:

var dialog = new GlideModal("your page name", true);<-- adding true removes the close icon

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks,

BK

@Bhavya11 Thank you! much appreciated.