Mobile UI ShowMobile with list

Just starting out? Need help? Post your questions and find answers here.
Ken
Posts: 14
Joined: Sat Dec 19, 2015 6:28 pm

Mobile UI ShowMobile with list

Post 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())
Fred
Site Admin
Posts: 1853
Joined: Mon Feb 24, 2014 10:51 am

Re: Mobile UI ShowMobile with list

Post 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())
Post Reply