This is making me nuts.
In my web application, on my $$ViewTemplate, I have inserted a subform which has several fields I use for view navigation.
Fields on the subform are:
Query_String (text, editable)
SetFields (computed, which takes values from the query string and sets them into corresponding fields)
Start (computed, number - set by SetFields to the the value that is passed in the query_string)
Count (ditto above)
Country (computed, text, value=Country. The initial value is set by SetFields - which sets Country equal to whatever is in the query string unless there is no value for country in the query string, in which case it does nothing. So the value in Country should be set when the view is first opened, and then remain whatever it was set to unless there is a Country value in the query string. Either way, it should always have a value)
The code in the navigator that opens this view, goes something like this:
/ViewName?OpenView&Country=United_States&Start=1&Count=30
The value of Country is different depending on the view being opened, and is used to display a single category.
All of this works fine when you open the view initially. The minute you expand a category however, Country loses its value.
It is the only field on the form that loses its value.
The Country=Value part of the query string disappears upon refresh.
I have “generate HTML for all fields” checked.
I’ve tried it with the fields on the form both above and below the body tag. No difference.
I’ve tried putting the fields directly on the form (no subform). No difference.
I’ve tried making the field editable instead of computed. No difference.
I am tottally not getting what the problem is here! A computed field on a web form that is set to be itself should preserve its value unless something is overwriting it, or unless the generate HTML of all fields isn’t checked, which it is!
Here is the code for SetFields in case there is something there I’ve missed:
FIELD Start := Start;
FIELD Count := Count;
FIELD Country := Country;
setStart := @Middle(QUERY_STRING; “Start=”; “&”);
setCount := @Middle(QUERY_STRING; “Count=”; “&”);
getCountry := @Middle(QUERY_STRING; “Country=”; “&”);
parseCountry := @Explode(getCountry; “_”);
setCountry := @Implode(parseCountry; " ");
@Do(
@SetField(“Start”; setStart );
@SetField(“Count”; setCount);
@If(getCountry = “”; “” ; @SetField(“Country”; setCountry)))
If I can’t get this to work, I have to create a separate view for each country, for each type of document adding about 10-15 views to the db instead of just using the 5 I have now!
Any ideas would be welcome.
Christy Zurcher
Hewitt Associates