Ticket #244 ( Closed )

Short Description Attempting to get the SELECTED option within a selection drop down
Entered By: costanzocj@lilco.com When: 1999-01-14 17:52:11 Build: 1.03.07A
Categories Type: Question   Department: Product   Category: TEIF Expressions
Description
I tried using the following code, so that on return back from a 3270 screen I would like the ability to re-enter the selected drop down values if the page had to be sent back to the browser for further corrections.
<TD>
 <SELECT NAME="AMR_Inter1" VALUE="<TESHOW  TextTrim(Screen(3,40,2))>">
 <OPTION>0
 <TEIF TextTrim(Screen(3,40,2)) = "15"> <OPTION  SELECTED>15 <TEELSE> <OPTION>15</TEIF>
 <OPTION>60
 </SELECT>
</TD>
I keep getting the following error message with the above code: Expression cannot have two values without an operation between them! I would appreciate any alternative you may have to this problem. Thanks, Craig C.
Append By: WindSurfer  When: 1999-01-14 21:59:19  New Status: Pending Customer
Comment The quick answer is that the TEIF requires a line end immediately following the greater-than symbol so that it can differentiate it from a REAL greater-than. We someday will improve the intelligence of the statement parser, but until then, this is how the TEIF works...if you do:
<TD>
 <SELECT NAME="AMR_Inter1" VALUE="<TESHOW TextTrim(Screen(3,40,2))>">
 <OPTION>0
 <TEIF TextTrim(Screen(3,40,2)) = "15">
   <OPTION  SELECTED>15 
 <TEELSE> 
   <OPTION>15
 </TEIF>
 <OPTION>60
</SELECT>
</TD>
Then you should get the correct results.

Meanwhile, if you have a lot of selection lists, I would strongly recommend the use of JavaScript to produce your lists and perform the SELECTED at the same time--I'm going to append another action to this ticket with an example of this to assure it all fits...