Example #1
0
    def get_display(my):
        top = DivWdg()
        top.add_color("color", "color")
        #top.add_color("background", "background")
        top.add_class("spt_simple_upload_top")
        
        top.add(my.browse)
       

        hidden = HiddenWdg( "%s|path" %  my.get_input_name() )
        hidden.add_class("spt_upload_hidden")
        top.add(hidden)


        # this can be used for some other transaction that picks up this file to checkin
        hidden = HiddenWdg( "%s|ticket" %  my.get_input_name() )
        hidden.add_class("spt_upload_ticket")
        top.add(hidden)

        # if not specified, get the sobject's icon context 
        my.context = my.kwargs.get("context")
        if not my.context:
            current = my.get_current_sobject()
            if current:
                my.context = current.get_icon_context()
            else:
                from pyasm.biz import Snapshot
                my.context = Snapshot.get_default_context()

        top.add_attr("spt_context", my.context)

        top.add( my.get_info_wdg() )


        files_div = DivWdg()
        top.add(files_div)
        files_div.add_class("spt_upload_files")
        files_div.add_style("font-size: 11px")
        files_div.add_style("margin-top: 10px")

        my.add_action()

        return top
Example #2
0
    def get_display(my):
        top = DivWdg()
        top.add_color("color", "color")
        #top.add_color("background", "background")
        top.add_class("spt_simple_upload_top")

        top.add(my.browse)

        hidden = HiddenWdg("%s|path" % my.get_input_name())
        hidden.add_class("spt_upload_hidden")
        top.add(hidden)

        # this can be used for some other transaction that picks up this file to checkin
        hidden = HiddenWdg("%s|ticket" % my.get_input_name())
        hidden.add_class("spt_upload_ticket")
        top.add(hidden)

        # if not specified, get the sobject's icon context
        my.context = my.kwargs.get("context")
        if not my.context:
            current = my.get_current_sobject()
            if current:
                my.context = current.get_icon_context()
            else:
                from pyasm.biz import Snapshot
                my.context = Snapshot.get_default_context()

        top.add_attr("spt_context", my.context)

        top.add(my.get_info_wdg())

        files_div = DivWdg()
        top.add(files_div)
        files_div.add_class("spt_upload_files")
        files_div.add_style("font-size: 11px")
        files_div.add_style("margin-top: 10px")

        my.add_action()

        return top