Refresh Views

I would like to automatically refresh the main view page. I have a @SetViewInfo command with a button in a view that effects all my views. Once you navigate from the view in question I would like that Main View page to automatically refresh.

Subject: RE: Refresh Views

I would like to automatically refresh the main view page. I have a @SetViewInfo command with a button in a view that effects all my views. Once you navigate from the view in question I would like that Main View page to automatically refresh.

As you have noticed, @SetViewInfo remains in effect when you navigate to another view. However, it’s not clear from your message whether this is the behavior you desire.

In most cases, you’ll probably want to not have it remain in effect. In that case, you can use @SetViewInfo in the Queryclose event of the view to clear your restriction, as follows:

@SetTargetFrame(“framename”);

@UpdateFormulaContext;

@SetViewInfo([SetViewFilter];“”;“columnname”;@True)

If you don’t use a frameset to organize your application, the first two lines are unnecessary.

Subject: RE: Refresh Views

Thanks again for your suggestion. It works great in the QueryClose but after further testing I cannot get it to work all the time in the QueryOpen. Any suggestions?

Subject: RE: Refresh Views

I don’t understand what you’re doing in Queryopen. If you’re trying to @SetViewInfo and specify a key, I would use Postopen. During Queryopen there might not be a view open yet, and so the command would be illegal.

Subject: RE: Refresh Views

This worked Great!! Thank you very much. I have now changed my @SetViewInfo from a button to the QueryOpen and set it back with the QueryClose. Thanks again.

Subject: RE: Refresh Views

After further testing I find that if I go into the view where I set @SetViewInfo in the QueryClose and I do not have any documents in the view it wipes out all the documents from all views until I exit the database and re-enter the database. If I have documents in the view thgen it works great.

Subject: RE: Refresh Views

I don’t have time to experiment with it now, but there’s probably something you can do with @SetViewInfo that will clear the setting back to the default of displaying all documents. If you find out what that is, please let us know.

Subject: RE: Refresh Views

I use the @setviewInfo in the Postopen and it changes the views back as suggested. I found this code on the web for using the @SetViewInfo in a button:

REM { — this action button filters a view based on the user’s input —

};

tmpVName := @Subset( @ViewTitle; 1 );

@If( tmpVName = “”;

@Return( @Prompt( [Ok]; “Warning”; "This only works when a database

is opened to a view.") );

@Success );

tmpCol := 1;

REM { produce a list of categories from the current view };

tmpList := @Unique( @DbColumn( “”:“”; “”:“”; tmpVName; tmpCol ) );

REM { handle common errors – reset filtering in an inappropriate view };

warningText := "This action only works in a categorized view where the category

is the first column." + @Char(10) +

"This will not work in a flat view or in a view where the first column is not

the category";

@If( @IsText( tmpList[1] );

@Success;

@Do( @SetViewInfo( [SetViewFilter]; “”; “”; 1); @Return( @Prompt(

[Ok]; “Warning”; warningText ) ) ) );

REM { Let the user pick one category };

tmpChoice := @Prompt( [OkCancelCombo];

“Select a Category for Filter”; “This will filter the view to a single category.” + @Char(30) + " (specify blank for all)";

“”; “” : tmpList );

REM { reminder: expand the view or it may appear empty };

@Command( [ViewExpandAll] ) ;

REM { Set the filter (or clear the filter) };

tmpCName := “sPOAreaName”;

@SetViewInfo( [SetViewFilter]; tmpChoice; tmpCName; 1 )

I also found out that if you make the view Private on first use I do not even need to use the @SetViewInfo command.

Thank you for all your help.

Subject: Refresh Views

Perhaps I don’t understand, but what exactly are you doing? If you want to refresh a view in a web browser, you can simply find the URL of the view currently and reload that view URL in the same frame or window.

If this isn’t what you are asking, please be more specific.

Thanks.