to make it cleaner you can keep all the code in the popup

for example you create a property and function inside the popup

Code:
Property piReturnValue 0     // 0 .. cancel, 1 .. activate view 1, 2 activate view 2

Function ShowPopup Returns Integer
    Set piReturnValue to 0

    Send Popup

    case begin
        case (piReturnValue(Self)=1)
            // .. activate view 1 here

            case break

        case (piReturnValue(Self)=2)
            // .. activate view 2 here

            case break

        case else
            // cancel 
            case break
    case end
End_Function
then in the popup you can use the following code to cause view 2 to be activated

Code:
    Set piReturnValue to 2
    Send Close_Panel
this way the activation code is contained inside the modal popup and does not need to be duplicated in case you need to call the popup from multiple places