cant use filepath property in operator panel?

I’m implementing an operator with a properties panel. Now one of the properties I want to use is a filepath property. It shows the property, but opening a file does not work. If I click the “open file” button, nothing happens.

am I missing something?


import bpy

from bpy.props import StringProperty

def main(context):
    for ob in context.scene.objects:
        print(ob)


class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"
    
    file_path = StringProperty(name="File Path", default="//", subtype="FILE_PATH")

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    
    def execute(self, context):
        main(context)
        return {'FINISHED'}
    
    def invoke(self, context, event):
        return context.window_manager.invoke_props_dialog(self) 
        
    def draw(self, context):        
        layout = self.layout
        col = layout.column()
        col.prop(self, 'file_path')

def register():
    bpy.utils.register_class(SimpleOperator)


def unregister():
    bpy.utils.unregister_class(SimpleOperator)


if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.simple_operator()