Android Question CustomListView data edit B4xdialog

Mitesh_Shah

Member
Licensed User
Longtime User
Hi have some data in CustomListView. now want edit with b4xdialog when click on CustomListView items

B4X:
Private Sub xclv_ItemClick (Index As Int, Value As Object)
    '// here Will access all data, now want get all data in b4xdialog   '<<------------------------------------
    
    'Dim item As CLVItem = xclv.GetRawListItem(Index)
    'Dim p As Panel = item.Panel.GetView(0)
    'Dim lbl As Label = p.GetView(1)
    'lbl.Text = "NEW TxT"
    'lbl.TextColor = Colors.Red
    
    Dim senderButton As button
    'Log(senderButton)
    ShowDialog(senderButton, CreateMap(), 0)
End Sub

Private Sub ShowDialog(senderButton As Button,item As Map, RowId As Int)   
    Dim v As B4XView = xui.CreatePanel("")
    v.SetLayoutAnimated(0,0,0,90%x,600dip)        '//'set the dialog-content size
    v.LoadLayout("dialog")
    dialog.Title="SET Mode"
    dialog.BorderWidth = 0
    dialog.BorderCornersRadius=10
            
    dialog.TitleBarColor = xui.Color_ARGB(255, 140, 140, 140)
    dialog.ButtonsColor = xui.Color_ARGB(255, 140, 140, 140)
    dialog.ButtonsTextColor = xui.Color_ARGB(255, 255, 255, 255)
    dialog.BackgroundColor = xui.Color_ARGB(255, 255, 255, 230)
    
   '// dialog.ShowCustom(v,"Ok","","Cansel")
    Dim obj As Object = dialog.ShowCustom(v,"Ok","","Cansel")
    
    wait For(obj) complete (result As Int)
    
    If result = xui.DialogResponse_Positive Then
        Log("Closed Dialog")       
    End If
End Sub
 

Mitesh_Shah

Member
Licensed User
Longtime User
OK
i want to edit customlistvew data

its possible to read data from selected customlistvew panel and edit and update a panel ?
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
OK
i want to edit customlistvew data

its possible to read data from selected customlistvew panel and edit and update a panel ?
Yes.
The easiest way is to reload the whole list of CustomListView after you updated the data.
Another way is find the views using Sender and get the item index then update the views.
 
Upvote 0

Mitesh_Shah

Member
Licensed User
Longtime User
How to get sender ?

B4X:
Private Sub xclv_ItemClick (Index As Int, Value As Object)
    
    'Log(Index)
    Dim senderButton As B4XView = Sender
    Log(senderButton)
    '// ShowDialog(senderButton, CreateMap(), 0)
End Sub

try to test in log
but not clear
 

Attachments

  • log.png
    log.png
    231.2 KB · Views: 85
Upvote 0

Mitesh_Shah

Member
Licensed User
Longtime User
OH ! Yes will got it
i have some button in each custonlistvew panle, want check button color and change it

will change button color with dialogbox successfully

try to read button color, says waning its only writable

how can check button color, ?
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
OH ! Yes will got it
i have some button in each custonlistvew panle, want check button color and change it

will change button color with dialogbox successfully

try to read button color, says waning its only writable

how can check button color, ?
It's better you create and upload a sample project that show the design.
 
Upvote 0

Mitesh_Shah

Member
Licensed User
Longtime User
Ok

Views do not have an internal color property.

so now we check button text color & Use It

Thanks for Ur Support
 
Last edited:
Upvote 0
Top