Expand my Community achievements bar.

SOLVED

Echoing entered field in master pages/headers

Avatar

Level 1

I'm creating a form that needs to have some data entered on the first page (a patient name) which then gets echoed to all of the subsequent pages on the form in case the pages get separated.

I have two master pages: one for the first page, with the company logo, and one for subsequent pages, which has the same logo but also includes a read-only field for the redisplay of the patient name. The patient name is entered on the first page, and a script that runs on change populates the read-only field in the second master page with the value of the entered field.

The second and following pages use the "subsequent page" master page.

All of that works, but the odd thing is that the value of the field only displays on the FIRST iteration of the subsequent page. In other words, the value entered on page 1 displays correctly on page 2, but on pages 3 and forward it doesn't show. The field is there, but it's empty.

I assumed that setting a read-only field's data within a master page / header would cause it to display on all pages that use that master page, but it seems to only get displayed on the first such page.

How do I make the field entered/filled out on the first page echo on all subsequent pages, in the header?

Thanks for any tips.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The reason why the 1st one is the only one filled is that each field has a unique name .....soyou woudl have to determine how many pages you have and write a for loop to place th eentered value into each of the fields (the page number is part of the Expression that is used to make the field unique). You can see the unique expression by adding  the javascript comand app.alert(this.somExpression) in the enter event. Now each time you enter the field it will display the somExpression and you can see the difference in the field name (it will be a page occurance number).

OR......

If you set the binding to global then all fields that have the same name will get the same value.

Hope that helps

Paul

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

The reason why the 1st one is the only one filled is that each field has a unique name .....soyou woudl have to determine how many pages you have and write a for loop to place th eentered value into each of the fields (the page number is part of the Expression that is used to make the field unique). You can see the unique expression by adding  the javascript comand app.alert(this.somExpression) in the enter event. Now each time you enter the field it will display the somExpression and you can see the difference in the field name (it will be a page occurance number).

OR......

If you set the binding to global then all fields that have the same name will get the same value.

Hope that helps

Paul

Avatar

Level 1

Brilliant! Setting the binding to global did the trick. Thanks very much

Avatar

Level 2

If adding fields to the Master Page, make sure that it is set to protected, and not just readOnly. This has the effect that the field will not be part of any tab set that you have

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----