Page 1 of 1

Mobile UI ShowMobile with list

Posted: Tue Jan 06, 2026 8:45 am
by Ken
When you use ShowMobile with list in page it will not work. I think it should?
You can test the code below. Uncomment the two lines to test with most simple list.
SP 3.10

Code: Select all

 Enumeration
    #Dialog
    #Open
    #Close
  EndEnumeration

  ; Create the dialog
  If ContainerMobile(#Dialog, #PB_Mobile_Dialog, "padding:8px")
    If ContainerMobile(#PB_Any, #PB_Mobile_Row, "padding:8px")
      TextMobile(#PB_Any, "Seems to work!", #PB_Mobile_Center)
      CloseMobileContainer()
    EndIf
    
    If ContainerMobile(#PB_Any, #PB_Mobile_Row, "padding:8px")
      ButtonMobile(#Close, "Close", #PB_Mobile_Center)
      CloseMobileContainer()
    EndIf
    
    CloseMobileContainer()
  EndIf ;Dialog ends
  
  
  ; Create the ouput page
  If ContainerMobile(#PB_Any, #PB_Mobile_Page, "margin:8px")
     ButtonMobile(#Open, "Open the dialog")
    
     ; Uncomment these two lines below
     ;ListMobile(0)
     ;AddListMobileItem(0, "What is happening here?")
    
    
    CloseMobileContainer()
  EndIf ;Page ends
  

  ; Handle events
  Procedure MobileEvents()
    Select EventMobile()
      Case #Open
        ShowMobile(#Dialog, #True) 
        
      Case #Close
        ShowMobile(#Dialog, #False)   
    EndSelect
  EndProcedure

  BindEvent(#PB_Event_Mobile, @MobileEvents())

Re: Mobile UI ShowMobile with list

Posted: Thu Jan 08, 2026 9:10 am
by Fred
You use the '0' for your list, a which is already used by the dialog.

Code: Select all

 Enumeration
    #Dialog
    #Open
    #Close
    #List
  EndEnumeration

  ; Create the dialog
  If ContainerMobile(#Dialog, #PB_Mobile_Dialog, "padding:8px")
    If ContainerMobile(#PB_Any, #PB_Mobile_Row, "padding:8px")
      TextMobile(#PB_Any, "Seems to work!", #PB_Mobile_Center)
      CloseMobileContainer()
    EndIf
    
    If ContainerMobile(#PB_Any, #PB_Mobile_Row, "padding:8px")
      ButtonMobile(#Close, "Close", #PB_Mobile_Center)
      CloseMobileContainer()
    EndIf
    
    CloseMobileContainer()
  EndIf ;Dialog ends
  
  
  ; Create the ouput page
  If ContainerMobile(#PB_Any, #PB_Mobile_Page, "margin:8px")
     ButtonMobile(#Open, "Open the dialog")
    
     ; Uncomment these two lines below
     ListMobile(#List)
     AddListMobileItem(#List, "What is happening here?")
    
    
    CloseMobileContainer()
  EndIf ;Page ends
  

  ; Handle events
  Procedure MobileEvents()
    Select EventMobile()
      Case #Open
        ShowMobile(#Dialog, #True) 
        
      Case #Close
        ShowMobile(#Dialog, #False)   
    EndSelect
  EndProcedure

  BindEvent(#PB_Event_Mobile, @MobileEvents())