Forum OpenACS Development: Re: Simple page using ad_form and -on_refresh

Collapse
Posted by Nis Jørgensen on
Hmmm - in that thread, the most elaborate example contains this:

-on_refresh {
    # didn't use -on_refresh
    # set subcategory_options before ad_form
    # because I couldn't find a way to set them here
}

So at least I am not alone with my problem 😊

Another post lead me to this solution for doing what I want to do:
-on_refresh {
  template::element::set_value homepage_edit hp_title REFRESHING
}

I would have assumed that ad_form_set_value would work also, but it doesn't. It doesn't give an error either. Strange.

Collapse
Posted by Nis Jørgensen on
OK, I am changing this from a "How do I make this work" to a "Wouldn't it be smarter if it worked like this"

My suggestion is this: Variables set in the on_refresh block should be automatically assigned to elements of the same name - similar to how on_request works.

I am trying to get this working by frankenstein programming - but I don't really understand ad_form (or the form builder) well enough to know if I am breaking things.