Forum Discussion

RalphKrausse's avatar
RalphKrausse
Qrew Trainee
7 years ago

Enumerate UI controls in a view

Is there an API that will allow me to enumerate all the UI controls in a view. I wish to get the IDs, names, values, etc.

Thanks
Ralph

11 Replies

  • I am not aware of such APIs to get that information. But, yes, you can get that information by just inspecting that particular UI element.

    Thanks,
    Gaurav
    • RalphKrausse's avatar
      RalphKrausse
      Qrew Trainee
      What if I do not know the ID. How can I get a list of IDs?

      Thanks
      r
    • GauravSharma3's avatar
      GauravSharma3
      Qrew Commander
      I am not sure what are you talking about? but, you can get the id like this.

    • GauravSharma3's avatar
      GauravSharma3
      Qrew Commander
      or you can use the View Source Chart plugin in Firefox. It will give you the full source HTML structure of any web page.
    • RalphKrausse's avatar
      RalphKrausse
      Qrew Trainee
      I just tried that but unfortunately it doesn't get all the data. I am specifically interested in Section Heading information.

    • MCFNeil's avatar
      MCFNeil
      Qrew Captain
      Section Headings on a form are not part the schema, but part of the service, and the only way to pull that is by pulling the logs when you submit the request to edit the form.
      i.e. ?a=DformProps&dfid=2

      I have to ask, Why do you need the form headings via the API?
  • >Is there an API that will allow me to enumerate all the UI controls in a view

    It isn't clear what you are looking for. "Controls" normally refers to form elements such as <input>, <textarea> etc on a form but these elements are on present on a view page (they display on an new or edit page). On the other hand the screenshot you posted suggests that you want to grab the essential data associated with a form editing page such as section heading text. In either case you can easily get this information using JavaScript although by different means.

    The general idea is to load the page in question into a hidden <iframe> and when it loads you use jQuery's serializeArray method or the FormData API to grab a representation of the form's state as either an array or object.

     https://api.jquery.com/serializeArray/

    https://developer.mozilla.org/en-US/docs/Web/API/FormData