?
Solved

Subforms not loading for web application

Posted on 2005-05-01
16
Medium Priority
?
549 Views
Last Modified: 2013-12-18
Hello,

I am writing an application where i have to load computed subforms based on values that i pass in through the url. It appears that when you submit the main form, the subforms get re-computed and loses context. You then get the following error  
HTTP Web Server: Item Not Found Exception - fldEvent [/EventReg.nsf/frmRegister?OpenForm&Seq=1]. I tried several things like using a web queryopen agent to populate a field on the form and then use that in the subform computaion but it did not work either.

Any help in regard to this problem will be greatly appreciated.

Pat
0
Comment
Question by:pcorreya
  • 5
  • 5
  • 5
  • +1
16 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 13907335
Refreshing will make you lose the URL parameter.
Have you tried storing it in a field? Something like:

@If(<fieldname>=""; <retrieve parameter>; <keep current value>)

The field's value can be used to get hold of the right subform.
0
 
LVL 1

Author Comment

by:pcorreya
ID: 13907365
Hi Crak,

This part works fine, but when you submit the form it breaks because it tries to recacluate the field again.

Pat
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13907410
Hi Pat,

No, indeed, using LotusScript to compute a field value to be used for the name of a computed subform is impossible. I have the same problem and I'm afraid there's no real solution. Fortunately, you're not using the Notes client but a browser, and then there are possibilities. I forgot the question we discussed this in, but the solution was to use some sort of two-stage approach: the first stage finds out the name(s) of the subform(s), then redirects to a new url that loads the real page.

As far as I know, subform computation using ONLY Formula language will work. So if you disassemble the Query_String in Formula, and use the outcome in subform computation, you get the subforms you want. Now I suppose, in your case, you lose the computed subform names, for you try to recompute them each time. I'd suggest one or more additional fields on the form, text, editable, which you give an additional HTML option: TYPE=HIDDEN. Fill the field when computing the subforms the first time, then the field's value will then be sent to the browser (not to be modified by the user) and sent back to the server to be stored when re-computation is necessary.

Might this help?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13907415
Check in your formula if the field has already got a value.
0
 
LVL 1

Author Comment

by:pcorreya
ID: 13907771
Hi sjef,

The problem that i am having is not when the subforms are being loaded, but when they are submitted things break.

Pat
0
 
LVL 13

Expert Comment

by:CRAK
ID: 13907852
> HTTP Web Server: Item Not Found Exception - fldEvent [/EventReg.nsf/frmRegister?OpenForm&Seq=1]

What code does fldEvent contain? Or is there a reference to fldEvent?
0
 
LVL 1

Author Comment

by:pcorreya
ID: 13907925
Hi Crak,

It is just the first field on the form.

Pat
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13908194
pcorreya,

> The problem that i am having is not when the subforms are being loaded,
> but when they are submitted things break.

Don't think so. You also have
    ...&Seq=1
Which makes me assume that the form is opened for the second time, and that it fails then, so it doesn't fail when something gets submitted. The Domino server has to be able to evaluate which subforms to load when building the webform, or when storing the received values in a document. It's too hard to give simple directives to get this solved. I wouldn't mind if you'd send me a (working) example-db with the form in it, to try when I have the time. You'd have to do the same for CRAK, or anybody else asking.

Sjef
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13909274
When you submit, redirect the page with the subform name in the URL and assign it to the computed value of hte subform

Partha
0
 
LVL 13

Expert Comment

by:CRAK
ID: 13911966
The EE rulebook says to upload it to a (free?) host so everybody can get it. Equal changes for all experts and a higher value (reusability) of this question as PAQ are the reasons.

So fldEvent is the first field on the form. The error message points to it.... there must be a reason. It must be related to the loss of parameters in the URL in a refresh, but numerous fields using those parameters could be cause those parameters. fldEvent or perhaps a formula poining to it would be a good point to start looking!

Like Sjef, I'd like to see what's behind it.... It would certainly cut a lot of chit-chatting short.
0
 
LVL 1

Author Comment

by:pcorreya
ID: 13914006
Hello,

This is very easy to simulate. Just create a main form and two subforms with a single field on it. Insert the subform as computed and compute the value from a query string parameter. Then put a button on the main form to save and close. They try loading each subform using the query string parameter and submit. You will get the same error that i am talking about.

Pat
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 750 total points
ID: 13916017
C'mon, the least you could have given us is the formula we need to get the subform-names from the Query_String. Oh, well, maybe if I can find some spare moment...

Anyway, did you try my suggestion to store the subform-names in one or more hidden fields?

Sjef

.
.
So I created a form, added a Query_String field (Text, Computed for Display, value Query_String), added two fields SF1 and SF2 (also Text, CfD) with values like
    @ReplaceSubstring(@Subset(@Trim(@Right(@Explode(Query_String; "&"); "sf1=")); 1); "%20";" ")
added a field Field1 (Text, Editable) on the form, then added two computed subforms with value SF1 and SF2 (to be taken from the earlier mentioned fields SF1 and SF2). In the two subforms, I added just one text-field. LBNL, I added the Submit-button.
.
Fee Fie Foe Fum... And it works :)

I suppose there is some tiny essential detail you failed to describe...
0
 
LVL 13

Assisted Solution

by:CRAK
CRAK earned 750 total points
ID: 13916072
Sjef,

My tip of the day (freebie!) for you:

if you use Query_String_Decoded instead of Query_String, you won't have to write a parser: %20 is delivered as " " without additional effort. ;-)

With it, the formula
@ReplaceSubstring(@Subset(@Trim(@Right(@Explode(Query_String; "&"); "sf1=")); 1); "%20";" ")
would read:
@Subset(@Trim(@Right(@Explode(Query_String; "&"); "sf1=")); 1)

It'll save you even more work if you need to pass all kinds of exotic characters in peoples names....
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13916379
I know, thanks, it was just a cut'n'paste job, some old formula from somewhere.

Scusi...

PS Please re-read your "improved" version ;-))
0
 
LVL 1

Author Comment

by:pcorreya
ID: 13916460
I have found a work around for this problem, not bothered anymore with using subforms.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 13917465
Ok Sjef, you got me there!

For anyone reading this in future, I meant of course:
@Subset(@Trim(@Right(@Explode(Query_String_Decoded; "&"); "sf1=")); 1)

Thanks for the points pcorreya. Good luck on your workaround. If it doesn't work out, bear in mind that the solution to the original issue is now available on EE!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question