code: def get_input_widget(self, fieldname, arnum=0, **kw):
          
  
          # temporary AR Context
          context = self.get_ar()
          # request = self.request
          schema = context.Schema()
  
          # get original field in the schema from the base_fieldname
          base_fieldname = fieldname.split("-")[0]
          field = context.getField(base_fieldname)
  
          # fieldname with -<arnum> suffix
          new_fieldname = self.get_fieldname(field, arnum)
          new_field = field.copy(name=new_fieldname)
  
          # get the default value for this field
          fieldvalues = self.fieldvalues
          field_value = fieldvalues.get(new_fieldname)
          # request_value = request.form.get(new_fieldname)
          # value = request_value or field_value
          value = field_value
  
          def getAccessor(instance):
              def accessor(**kw):
                  return value
              return accessor
  
          # inject the new context for the widget renderer
          # see: Products.Archetypes.Renderer.render
          kw["here"] = context
          kw["context"] = context
          kw["fieldName"] = new_fieldname
  
          # make the field available with this name
          # XXX: This is a hack to make the widget available in the template
          schema._fields[new_fieldname] = new_field
          new_field.getAccessor = getAccessor
  
          # set the default value
          form = dict()
          form[new_fieldname] = value
          self.request.form.update(form)
          logger.info("get_input_widget: fieldname={} arnum={} "
                      "-> new_fieldname={} value={}".format(
                          fieldname, arnum, new_fieldname, value))
          widget = context.widget(new_fieldname, **kw)
          return widget
docs: Get the field widget of the AR in column <arnum>
  
          :param fieldname: The base fieldname
          :type fieldname: string