tonyhhkx

Check Portal signIn status

Discussion created by tonyhhkx on Oct 28, 2016
Latest reply on Nov 2, 2016 by tonyhhkx

Dear All,

 

is possible to check the signIn status in the portal?

A lot of example uses the default Dialog Box for the login.

 

I created a custom qml for the login.

 

How is it possible to check if the login are going successfully or not?

 

 

import QtQuick 2.3
import QtQuick.Controls 2.0
import Esri.ArcGISRuntime 100.0
ApplicationWindow {
    id: appWindow
    width: 800
    height: 600
    title: "TestMapQtNEW"
    Frame {
        id: frmLogin
        x: 203
        y: 200
        width: 394
        height: 200
        anchors.verticalCenter: parent.verticalCenter
        anchors.horizontalCenterOffset: 0
        anchors.horizontalCenter: parent.horizontalCenter
        opacity: 1
        clip: false
        Label {
            id: lblPassword
            x: 53
            y: 80
            text: qsTr("Password:")
        }
        Label {
            id: lblUsername
            x: 53
            y: 49
            text: qsTr("Username:")
        }
        TextField {
            id: txtPassword
            x: 132
            y: 74
            placeholderText: qsTr("Text Field")
        }
        TextField {
            id: txtUsername
            x: 132
            y: 43
            placeholderText: qsTr("Text Field")
        }
        
        Portal {
            id: myPortal
            url: "http://www.arcgis.com"
        }
        Button {
            id: btnLogin
            x: 232
            y: 125
            text: qsTr("Login")
            onClicked: {
                
                var credential = ArcGISRuntimeEnvironment.createObject("Credential", {username:txtUsername.text, password:txtPassword.text});
                myPortal.credential = credential;
                myPortal.signIn();
                //AND NOW? HOW I CAN CHECK THE STATUS AND/OR THE ERROR?
            }
        }
    }
    // add a mapView component
}

Outcomes