Going through all selected documents on the web using the next button

Hi,

I am having a difficult task with one of the application that I need to enhance,

From the client I have a series of questions (each questions are a separate document).

From the web, I need to have one document to show at the time with a next and previous button, until there is no documents left. Then some how I need to keep track of the answers of those questions and give a past of failed answer

How could I do this?

Any help would be appreciated.

Alena,.

Subject: Going through all selected documents on the web using the next button.

It depends if you want to store the answers in one document or in several.If you want all the answers to all the questions in one document, then I recommend setting up a tabbed table in the notes design, use $tablename as the key to move from one tab to the next, put each question in a separate tab of the table and program your next and previous buttons to show currenttab+1 and currenttab-1.

Once your user has completed all the tabs (i.e. when the last tab in in view) you can show the submit button and save the answers in the server database.

If you want each answer in a separate notes document, then you should give each question document an ascending id number, and create buttons that submit the current document and access the next or previous one depending on which button is pressed.

If you go this way you should set up logged in and authenticated users and authors fields so that you can’t get one user accessing the answer another user has entered!

Subject: RE: Going through all selected documents on the web using the next button.

thanks Leo, I looked for $tablename and currenttab, but I found nothing in the help. Could you please give me a little more info about this…

thanks again,

Alena

Subject: RE: Going through all selected documents on the web using the next button.

Create a tabbed table in a notes form - i.e. one that only displays one row at a time, and specify in the the table properties that users choose which row to display programmatically.in the html properties of the table give it a name, and additionally, give each row an id.

On the form, above the table, create a computed for display text field and give it the same name you gave the table.

Set the value of the field to be the ID of the row of the table you want to display at any one time.

Clicking your next or previous buttons should change the value of the computed field to be the ID of the next or previous row.

If you use a number in the ID field, bear in mind that it will be regarded as text by the field.

e.g. table name is $tablename

table rows have ids TR1, TR2, TR3, TR4 and TR5.

computed for display field is called $tablename

when the form loads, the initial value of this field is “TR1”

formula for “next” button would be something like:

REM {get the current row number};

NTxt := @Right($tablename; “TR”);

REM {convert text to number};

NNum := @TextToNumber(N);

REM {add one to it };

NNum1 := NNum + 1;

REM {set the field to display the next row};

@Set(“$tablename”; “TR” + @Text(NNum1));

Obviously I’ve done it step by step above, but you can reduce the formula to two or even one line if you want to!

you can hide the next button if $tablename=“TR5”, and the previous button if $tablename=“TR1”

Please note you don’t have to call the table $tablename, but that’s the field used in the example in designer help. Try searching for tablename without the $?

Subject: RE: Going through all selected documents on the web using the next button.

Thanks Leo,

I have done what you gave me, I can see that I am almost there, my next button is the word Next I have made it an action hotspot , on the web I can see that it would go to TR2 but the link is not active… how can I do this.

I certainly would prefer a nice image button but I don’t know how to code it…

I have tried putting 2 buttons one Previous and one Next but on the web it is active as a submit form.(there must be other things I can use)

I would appreciate your help for my next move…

thanks again (as you can see I am new to this…)

Alena,

Subject: RE: Going through all selected documents on the web using the next button.

If you are going the tabbed table route you are basically sending the document to the server and having it refreshed each time you change tabs.If you know javascript you can do it quicker on the browser side so you only have to submit the document back to the server once at the end. (I’m not good on Javascript, so you’ll have to check with someone else if you decide to do that).

If you are happy with the overhead on the web of carrying on using the tabbed table, then continue as follows:

in your back button, which is a (hotspot action button by the way) you can put FIELD tablename := Page-1; @Command([FileSave]); @Command([FileCloseWindow])

in your next button put the same, but Page+1

Page is a hidden numerical field on your form, or you can compute it from the current value of the TR variable each time if you wish…

$$Return field:

To stop the ‘form processed’ message appearing when you save a web document you can either use the $$Return field to direct your user to a new page (try opening the new document in a view? - you’ll have to run a webopen agent to save it before it is ever presented to the user in order to let the view index catch up - maybe give it a ‘draft’ status or something?)

The alternative is to set up a webquerysave agent. Using lotusscript you can do pretty much anything with this. Do some back end processing if you like, then put a print statement in the code (which will be output directly to the browser) and say

Print ||

(where sLinkURL is the full http url to the document

Image button.

If you use a hotspot action button you create a standard browser button with the text you give it.

Subject: RE: Going through all selected documents on the web using the next button.

Leo, can this work on the web…? I really need help with this…

anyone!

thanks

A.