Question about editing vertice/edge/face properties



Can someone explain how to access data of vertices/edges/faces and display them as working property like in the image shown? I want to reuse those in another area for my addon.

I think my issue right now is that this dives into bmesh + layers where I am not familiar enough to add one and one together by reading related stuff. Came back to this issue for a few months now.

Anyway, this is my current version about the vertex group list:

# find active vertex

ob = bpy.context.active_object
import bmesh
bm = bmesh.from_edit_mesh(

for elem in reversed(bm.select_history):
    if isinstance(elem, bmesh.types.BMVert):
        ACTIVE = elem

# display vertex group weights

    VERTEX =[ACTIVE .index]    
    for group in VERTEX.groups:        
        row = layout.row()
        Name = ob.vertex_groups[].name
        row.prop(group, "weight", text=Name, slider=True)

Problem: provides the property for vertex group weights but going this way has no effect in actually changing the value, it also resets after switching modes.

Can anyone help?