Focal Point
[CLOSED] HTML: double list control, Selection Required "No"

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4857017826

February 12, 2013, 06:29 PM
JennyY
[CLOSED] HTML: double list control, Selection Required "No"
I have a procedure that lets user to choose which "By" fields they want. I generated one variable for the three optional BY fields. The code looks like this:

TABLE FILE T1
SUM
H1 AS ''
BY LOWEST Field1
BY &RP_FN02B_Sort2.(BY(,,)).Please select sort field(s).
ACROSS YEAR AS ''
END

Then in an HTML file, a double list control is generated for this variable. I set the Selection Required property of the double list control to "No" since I'd like the option to select none. However, when I run it without any selection, I got the error:

THE FIELDNAME IS NOT RECOGNIZED: ACROSS
BYPASSING TO END OF COMMAND

Could anyone help me to find the problem?
Thanks!

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
February 12, 2013, 06:34 PM
JennyY
The code looks like this:

TABLE FILE T1
SUM
H1 AS ''
BY LOWEST Field1
BY &RP_FN02B_Sort2.(BY(,,)).Please select sort field(s).
ACROSS YEAR AS ''
END


WebFOCUS 7.6
Windows, All Outputs
February 13, 2013, 11:39 AM
BarryS
Hi Jenny

You are using the new feature in the Report Painter that is created the double list box.

Make sure you select the customselect1 object (the Parent control for the double list box) and there is a property "Default selection" to No. If that does not work then open a case for that issue.

A workaround to the issue is that on load of the double listbox the right box always comes up with the default selected. In the function onInitialUpdate you can try to fire an onclick event for the customselect1_removebutton and that should move the selected value back to the left listbox.

I have not tried the workaround but it should work but if it does not work, open a case with tech support.

Thanks Barry


WebFOCUS 8103, Windows, App Studio
February 13, 2013, 01:42 PM
JennyY
Hi Barry, I tried the first option, and it doesn't work. I'll open an case for this.

thanks!
Jenny


WebFOCUS 7.6
Windows, All Outputs
February 14, 2013, 10:21 AM
J
Jenny, what is happening is that when you set the field to no selection, the by statement is sorting by nothing.
This is what is being processed at runtime:
BY (nothing)
ACROSS ...

Since there is nothing after BY, webfocus goes down to the next line and sees ACROSS, but across is a key term and not a field thus throwing the error. Here is a trick for optionally having a by field:

   -DEFAULT &RP_FN02B_Sort2 EQ 'Empty';
-SET &BYFIELD = IF &RP_FN02B_Sort2 EQ 'Empty' THEN 'FOC_NONE' ELSE '&RP_FN02B_Sort2_TEXT'

TABLE FILE T1
...
BY &RP_FN02B_Sort2.(BY(,,)).Please select sort field(s). AS '&BY_FIELD'
...
END 


There are several parts to this code so I will go line by line.

-DEFAULT &RP_FN02B_Sort2 EQ 'Empty'; 
-- This will set that variable to empty for no selection.

-SET &BYFIELD = IF &RP_FN02B_Sort2 EQ 'Empty' THEN 'FOC_NONE' ELSE '&RP_FN02B_Sort2_TEXT' 
-- This is the heart of the logic.
Basically, if the variable is not selected, set the field title to 'FOC_NONE' ELSE, set the field title to the RP_FN02B_Sort2_TEXT.
RP_FN02B_Sort2_TEXT will return whatever the description value is for that variable. The key is FOC_NONE. Even in the column title, if FOC_NONE
is placed there, then it will wipe out the entire line of code eliminating the by statement all together.

Hope this helps.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
July 12, 2013, 04:19 PM
J
Was this ever resolved?


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
June 03, 2015, 04:27 PM
vaayu
Hello there.
I'm experiencing this issue in my HTML form using double list control. The first item gets selected and moved to "customselect_selectto" even though I have Default Selection =No for both list boxes. I'm using WF 8.104. Also, I'm not using RIA theme.

Please advise.