B4J Question [ABMaterial] Why my ABMInput always have text

jinyistudio

Well-Known Member
Licensed User
My ABM Version is 4.3
My inp1,inp2 is in the connectpage. Every time i reload this page,the inp1,inp2 always have a same text value inside. Why ?? :(

B4X:
Dim inp1 As ABMInput
    inp1.Initialize(page, "inp1", ABM.INPUT_TEXT, "帳 號 *", False, "")
    inp1.Text=""
    inp1.PlaceHolderText = "必填! 最短4個字"
    page.Cell(1,1).AddComponent(inp1)
   
    Dim inp2 As ABMInput
    inp2.Initialize(page, "inp2", ABM.INPUT_PASSWORD, "密 碼 *", False, "")
    inp2.Text=""
    inp2.PlaceHolderText = "必填! 最短8個字"
    page.Cell(1,2).AddComponent(inp2)
B4X:
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
    ws = WebSocket1
    ABMPageId = ABM.GetPageID(page, Name,ws)
    
    Dim session As HttpSession = ABM.GetSession(ws, ABMShared.SessionMaxInactiveIntervalSeconds)
    '----------------------START MODIFICATION 4.00-------------------------------
    If session.IsNew Then
        session.Invalidate
        ABMShared.NavigateToPage(ws, "", "./")
        Return
    End If
    '----------------------END MODIFICATION 4.00-------------------------------
    'If ABMShared.NeedsAuthorization Then
    loginuser = CreateMap("account":"","password":"","token":"","company":"","address":"")
    
    ABM.UpdateFromCache(Me, ABMShared.CachedPages, ABMPageId, ws)
    If page.ComesFromPageCache Then
        ' when we have a page that is cached it doesn't matter if it comes or not from a new connection we serve the cached version.
        Log("Comes from cache")
        page.Refresh
        page.FinishedLoading
    Else
        If page.WebsocketReconnected Then
            Log("Websocket reconnected")
            ' when we have a client that doesn't have the page in cache and it's websocket reconnected and also it's session is new - basically when the client had internet problems and it's session (and also cache) expired before he reconnected so the user has content in the browser but we don't have any on the server. So we need to reload the page.
            ' when a client that doesn't have the page in cache and it's websocket reconnected but it's session is not new - when the client had internet problems and when he reconnected it's session was valid but he had no cache for this page we need to reload the page as the user browser has content, reconnected but we have no content in cache
            ABMShared.NavigateToPage (ws, ABMPageId, "./" & page.PageHTMLName)
        Else
            ' when the client did not reconnected it doesn't matter if the session was new or not because this is the websockets first connection so no dynamic content in the browser ... we are going to serve the dynamic content...
            Log("Websocket first connection")
            page.Prepare
            ConnectPage
        End If
    End If
    Log(ABMPageId)
End Sub
 
Top