Editable fields in $$ViewTemplateDefault?

I’ve got a $$ViewTemplateDefault form - not a page - with a field named Filter. Filter has the following formula for its keywords:

vu := @ViewTitle;

vw := @If(@Elements(vu) > 1; @Subset(vu; -1); vu);

tmp := @DbColumn(“”:“”; @DbName; vw; 1);

@If(@IsError(tmp); “"; "”:tmp)

If I preview this in a browser, I get the field with all my choices but no view. If I preview the view, I get the embedded view OK but the field is not presented. I put in computed text with the same formula and all my choices are there and they even change based on the view I open but if the field isn’t shown as an editable field, this won’t do me any good. I’ve tried force to edit on open, display HTML for all fields and every other option I can think of. I’m already logged in through the browser and have manager access so it’s not a read-only access problem. Any thoughts?

Subject: Editable fields in $$ViewTemplateDefault?

$$ViewTemplates are by definition incapable of editable use – but that’s not a huge drawback. You can create an HTML field to do the job:

The computed-for-display field will use almost the same formula as you’re using now. Make sure it’s multi-value:

vu := @ViewTitle;

vw := @If(@Elements(vu) > 1; @Subset(vu; -1); vu);

tmp := @DbColumn(“”:“”; @DbName; vw; 1);

allValues := @If(@IsError(tmp); “"; "”:tmp);

“<option value="” + allValues + “">” + allValues + “”

That gives you something you can submit to the server as part of a “RestrictToCategory” parameter in the URL. Note that the “single category” setting in the object browser does not work on $$ViewTemplates when they are loaded by the view – you absolutely need to set the category via the URL.

Subject: RE: Editable fields in $$ViewTemplateDefault?

Yep, I figured that part out because that was the easy bit. The hard part was the javascript to handle onChange and add the RestrictToCategory= to the URL for the view. I got it working though.