Forum OpenACS Development: widget::inform shouldn't set a hidden field object...

if the display field should be updated when the form is refreshed (using __on_refresh_p) because the act that refreshed the form affects that displayed value, then the refreshed form will always show the old value because the form submitted it in a hidden field.

simply by changing the inform widget to:

    return "$element(value)"
    instead of:

    return "$element(value)[input hidden element $tag_attributes]"
solves this problem, and causes (to my eye) no other problems (since the value will be set by the ad_form setup every time)

it also cuts down on the crazy length of a GET url for a form with a lot of inform's.

If noone thinks i'm crazy or worng i will make this change to head.

ok i;m wrong - that will only wok when the inform gets it's value from tcl - not from an sql block (because they aren't run on __refreshing_p)

so instead i just made a new widget called static that does what i want.

Collapse
Posted by Dave Bauer on
Aha!

I see what you are trying to do.

Here is how I solve that, really it needs to be another widget that generates two elements.

{foo_inform:text(inform) {value $foo} }
{foo:text(hidden) {value $foo}

I want to show the value, but not allow editing, and I need to pass it along for processing.

I guess this is redundant, you already figured this out?

Collapse
Posted by Dave Bauer on
Oh, i should read that. Looks like inform _does_ set a hidden form element.
yeah - and i wanted to do the opposite. I thought about adding a flag something like ,ignore_refresh that would cause the value to be updated as if it was a new_request or edit page as appsropriate.

but that would be very scary to implement in the current ad_form code structure and i'm not sure it's even possible, so i made a new statisc widget that sets no hidden field.