[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

How do I use a single page to display a single category view - and change the category

Hi, I am creating a dashboard application. Main page shows 4 embedded views each set to single category. The category that they show is hardcoded as the dept name.

I'm using a frameset with two frames.
The first contains an outline embedded on a page.
This loads the required dept page in the second frame

What I'm doing is defining one page for each dept with hardcoded single category views on it.
I'd love to be able to have one generic page that I can specify the category on ... but of course pages can't contain fields can they ?
How can i work around this ?

With Thanks - Andy
0
andyhines
Asked:
andyhines
  • 4
  • 4
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
Use a form...?
0
 
andyhinesAuthor Commented:
Sorry sjef maybe I'm asking a dumb question. I've always used pages rather than forms when I'm creating applications for dual web/Notes use (and I didn't say that was what I'm doing in the question).
If I use a form then how do I specify in the outline that I want to load a blank copy of the form and then set certain fields (such as the dept name) and refresh in order to make the form show the right information ? In formula language if possible.
Otherwise is there no way to use an environment variable to set the dept name and then change it programmatically ?

Thanks - Andy
0
 
Sjef BosmanGroupware ConsultantCommented:
The environment variable is not a good idea if it's a dual web/Notes application, which of course isn't what you're doing here ;-))

You can do with a form almost anything that you can do with a page. What you have to take care of is that there are no editable fields (visible) on the form, and that the form cannot be saved.

> ... load a blank copy of the form and then set certain fields  ...
Would it be possible that these fields set themselves? Or you put some buttons on the form, that set the fields and then activate some refresh mechanism? I never tried this, but it would be the way I'd go.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
andyhinesAuthor Commented:
Hi Sjef,

I have changed the app to use a form not a page. There is only one real field on the form (Dept_Name) and all the embedded views are keyed off this.
I have the following code on an outline element :
@SetTargetFrame("ContentFrame");
@Command( [EditDocument] ; 1 );
@SetField("Dept_Name";"Sales - Rollup");
@Command([RefreshFrame])
which I expected would update the one field, change the Dept and make all the views refresh. It doesn't seem to do anything.
If instead of editing the document I do a Compose then it does give me a blank form but still doesn't change the contents of Dept_Name.

Am I missing something ? Thanks - Andy
0
 
Sjef BosmanGroupware ConsultantCommented:
If you have a test database and you're willing to share it with me, you can send it to the mail address displayed in my profile.

Am I correct in  understanding that you want ALL views to show the same category?

Anyway, the settargetframe function has no direct bearing to the commands that follow, only when a link is clicked. Check the function @UpdateFormulaContext  
0
 
Bill-HansonCommented:
The embedded view name and single-category must be available to the form as the form loads.  You cannot change the embedded view name or single-category while the form is open.

In the Notes Client, you will need to set an Environment Variable in your action, then read/clear it in the form's embedded view.

For a web app, you can pass the info as a URL parameter, then set the data in the form's WebQueryOpen event.
0
 
Sjef BosmanGroupware ConsultantCommented:
I tend to disagree again. I just tested with a form, with a computed field, an embedded view and a button. The button changes the computed field, and that computed field is used in the single category formula of the embedded view. After the change, the form is refreshed, and as expected the contents of the embedded views are changed.

What probably never works is the outline in one frame and the form in another one. Sometimes, Notes mucho sucko... :-))
0
 
andyhinesAuthor Commented:
Hi Sjef - Thanks for your help.
I received my database back on Sat. and have just tested the changes in the real one.
It DOES work better using a single form as you suggested and this saves me the grief of maintaining any number of pages.
Thanks a lot. Especially for taking a look over the weekend.

Andy
0
 
andyhinesAuthor Commented:
Cheers :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now