Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to send data from ui page to ui action

MarinaL
Tera Contributor

Hi everyone!
I'm open popup from Ui action in CSM workspace this way:

 

Workspace client script:

 

 

g_modal.showFrame({
        url: url,
        title: 'Choose resolve method',
        size: 'sm',
        callback: function(response) {
            if(response){
                 alert(response.data); 
            }else{
                 alert('error');
            }
        }
    });

 

 


I want to receive data back from UI page i called using functionality:

 

 

 function validateSelect() {
        var select = document.getElementById('method');
        var message = document.getElementById('validationMessage');
        if (select.value === "") {
            message.style.display = 'block';
            message.innerHTML = "Please select an option.";
        } else {
            message.style.display = 'none';
            message.innerHTML = "";
            sendResponse({action: 'ok', data: select.value});
        }
    }

    function sendResponse(response) {
        window.parent.postMessage(response, "*");
    }
    </script>

 

 


I don't get anything. I want to fetch data from a UI page but am getting an error warning. Maybe someone knows what's wrong?

Thanks in advance!

0 REPLIES 0