Announcement

Collapse
No announcement yet.

How to "Use AJAX to reload other fields of type Select"?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to "Use AJAX to reload other fields of type Select"?

    Assume:
    • [li]The Form has a SELECT field called agroupid[/li]
      [li]Dependent on this is another SELECT atypeid[/li]
      [li]the SQL construct for selecting atypeid is something like "SELECT id, atypename FROM grouptypes WHERE agroupid = {agroupid} ORDER by atypename"[/li]
      [li]I enable "Use AJAX to reload other fields of type Select" on the SELECT field agroupid so the selection list for grouptypes is refreshed when the user changes the agroupid SELECT.[/li]
      [li] I correctly flag the field to reloaded in the AJAX part.[/li]

    The dependent SELECT (lookup) never refreshes when the user changes the value for {agroupid}. What have I missed? Do I need to reload the whole form as well?

    Thanks

    The GuiGuy
    ... from Down Under

  • #2
    Re: How to "Use AJAX to reload other fields of type Select"?

    You should never have to reload a form when using AJAX. That is the purpose of AJAX. Have you looked at the online examples to compare?
    Do you have all 3 items populated when you created the AJAX event? (field/event/param)?
    It is hard to debug this over the wire. Can you load Firebug/Developer tools and see if you are getting answer back (callback) from the server? NET tab.

    Regards,
    Scott.

    Comment


    • #3
      Re: How to "Use AJAX to reload other fields of type Select"?

      [quote author=ScottMartin link=topic=4211.msg10015#msg10015 date=1303434275]
      You should never have to reload a form when using AJAX. That is the purpose of AJAX. Have you looked at the online examples to compare?
      Do you have all 3 items populated when you created the AJAX event? (field/event/param)?
      It is hard to debug this over the wire. Can you load Firebug/Developer tools and see if you are getting answer back (callback) from the server? NET tab.
      [/quote]

      I had everything right AFAIK. Anyway, I "created" and AJAX event for the field's "onchange" and that got it working. To explain, I had flagged "Use AJAX to reload other fields of type Select" and set the parameters. This had no effect. I then went to "AJAX Events" and created an on change event for the field as well. I padded the event with a comment, which appears in the generated code. On change now triggers the dependent lookup box to refresh. Maybe another SC code generation issue brought on by release .14?

      Who knows....
      The GuiGuy
      ... from Down Under

      Comment

      Working...
      X