Focal Point
htm composer combo box /drop down list limit 5

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

February 07, 2017, 08:14 PM
BM
htm composer combo box /drop down list limit 5
HI,
Is there a way to increase the limit from 5 to let say 10 or 15?

Thanks


WebFOCUS 8202M
February 07, 2017, 09:47 PM
Waz
What do you mean by Limit ?

Number of items in the list ?

Number visible ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 08, 2017, 04:40 AM
Avinash
quote:
combo box /drop down list limit 5


If you question is regarding combo box /drop down list item need to increase, so you can increase that item form setting of that control. There is a ADD/UP/Down/Remove button. so you can do as require.

If not then please provide more information that what you need.


Thanks!
@vi

WebFOCUS 8105, Dev Studio 8105, Windows 7, ALL Outputs
February 08, 2017, 09:08 AM
SeyedG
Hi BM,
If you mean to change the number of rows displayed in the combo box, then do the following:

Click on the combo box and then in the 'Properties' window, under "Miscellaneous", change the 'Size' to 10 or 15 or whatever. This will set the number of rows in the combo box. I just changed it in App Studio 8009, but it should be the same in your version.

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
February 09, 2017, 05:48 PM
BM
Thanks all.
I am referring to number of ITEMS it shows when I click on the down-arrow for the drop down to activate it.
Currently, it only shows 5 with the scrollbar.
I would like to change that option and cannot find it.

Thanks


WebFOCUS 8202M
February 13, 2017, 06:09 AM
Tony A
I have just created a simple form with a combobox, populating it from the CAR file with the data from MODEL.

Upon execution, clicking the down arrow shows ALL values.

This was on 8.1.05 so I would ask if your HTML page has custom JavaScript which takes control of this?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 13, 2017, 08:48 AM
Squatch
I am puzzled by this question, because my experience with 8.1.05 agrees with what Tony has written.

If it is custom JavaScript as Tony hints at, it is the "Size" property that matters (Like SeyedG suggested).

In actual HTML it would look like this:

<select size="3">
   <option value="volvo">Volvo</option>
   <option value="saab">Saab</option>
   <option value="opel">Opel</option>
   <option value="audi">Audi</option>
</select> 

HTML select size Attribute

So in this example, you would need to scroll down to see "Audi".

Or perhaps you mean there should be more than 5 TOTAL and there is not?


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 13, 2017, 09:25 AM
SeyedG
After reading Tony and Squatch's posts, I focused on figuring out how to set the size in JavaScript. From this example, I was able to add the following code to the onclick event of my combobox and it worked.

//Begin function combobox2_onclick
function combobox2_onclick(event) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
// TODO: Add your event handler code here
    var x=document.getElementById("combobox2");
    x.size="6";


}


This JavaScript code worked for me, it will work for you. Just change the name of your control and the size to meet your situation.

Seyed

This message has been edited. Last edited by: SeyedG,
February 13, 2017, 01:19 PM
Squatch
SeyedG,

That is very good code. You could even check to see how many items are in the list and change the "size" to something appropriate for how many items you have.

I will remember this trick!


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 13, 2017, 04:16 PM
Waz
Was you HTML page created in Composer ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 13, 2017, 04:42 PM
SeyedG
Waz,
If your question is for me, the answer is 'Yes'. I just used App Studio 8009 HTML Composer to create a guided report from a report that used GGSALES and put two controls on the page making the controls combo boxes and tried the JavaScript code for 'ST' column control.


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
February 13, 2017, 04:49 PM
Waz
Has the Size option been set for the combo boxes in Composer.

I was thinking that composer may have set the size for some reason.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 13, 2017, 05:14 PM
SeyedG
There are two different size properties. One is the number of rows shown when the page is first loaded. Second is when only one row is shown at load time, but when one clicks on the down arrow, they get to see rows. This is what I believe BM wants to control. The first property can be set through GUI as I stated in my first reply, the second size property is done through JavaScript.
February 13, 2017, 05:24 PM
Waz
I'm losing track of who started the thread.

Question was for BM

Wants interesting is that it doesn't seem to be an issue for others.

Even out own HTML forms build with composer are not limited to 5 lines.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 13, 2017, 06:52 PM
BM
quote:
Originally posted by SeyedG:
There are two different size properties. One is the number of rows shown when the page is first loaded. Second is when only one row is shown at load time, but when one clicks on the down arrow, they get to see rows. This is what I believe BM wants to control. The first property can be set through GUI as I stated in my first reply, the second size property is done through JavaScript.



Nice trick.. thanks.. will give it a try


WebFOCUS 8202M
February 13, 2017, 07:01 PM
BM
quote:
Originally posted by Tony A:
I have just created a simple form with a combobox, populating it from the CAR file with the data from MODEL.

Upon execution, clicking the down arrow shows ALL values.

This was on 8.1.05 so I would ask if your HTML page has custom JavaScript which takes control of this?

T


Hi Tony,
I just created a blank HTML with no custom javascript.. Upon execution it shows ALL values.
But if you change the properties to allow "Multiples" then it shows 5 values with a scrollbar.

Thanks

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


WebFOCUS 8202M
February 13, 2017, 07:10 PM
BM
quote:
Originally posted by SeyedG:
After reading Tony and Squatch's posts, I focused on figuring out how to set the size in JavaScript. From this example, I was able to add the following code to the onclick event of my combobox and it worked.

//Begin function combobox2_onclick
function combobox2_onclick(event) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
// TODO: Add your event handler code here
    var x=document.getElementById("combobox2");
    x.size="6";


}


This JavaScript code worked for me, it will work for you. Just change the name of your control and the size to meet your situation.

Seyed


Thanks but as soon as I change the property to "multi select" then it doesn't work.

Thanks


WebFOCUS 8202M
February 13, 2017, 07:17 PM
Waz
Looks like that is it.

The combination of Combo Box and multiselect, that is sort of impossible, as a combobox only shows 1 selection.

There must be some interesting stuff going on behind the scenes.

I would suggest opening a case with IBI about it.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 14, 2017, 05:05 AM
Tony A
quote:
But if you change the properties to allow "Multiples" then it shows 5 values with a scrollbar.

This is the sort of information that needs to be given right at the start Smiler It provides qualifying information as to why you are "having an issue"!

As Waz suggests, there is something going on behind the scenes and it is within the core JavaScript modules.

I have had a recent situation where I needed similar functioning on a report. I needed to add a multi-select combo which showed as a single line until it was opened, when it should show a maximum of 10 (with scrolling) or the actual number if is was LE 10. This was because of available page space. When it collapsed, I show a count of items and not the list (akin to iOS functioning).

This is easy to achieve (similar to Seyed's suggestion above but using onFocus and onBlur) when you are controlling the JavaScript libraries, but using the HTML Document builder, there is little that you can do to effect what you want to achieve as it would be controlled by IB core JavaScript functions.

It might be a suggestion for an NFR as I have heard this question before.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 14, 2017, 08:16 AM
Squatch
quote:
Originally posted by Tony A:
It might be a suggestion for an NFR as I have heard this question before.

Whenever an open standard such as HTML is commercialized, there will never be an end to new feature requests.

It's like me supplying you with automobiles, and I decide the autos should have three wheels instead of four. If you think the fourth wheel would be useful to you, I would invite you to submit an NFR to me and I'll think about it.

And don't try to add the fourth wheel yourself. The change will be detected and the car will warn you that it may not start because of it.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 14, 2017, 11:09 AM
MAdams1
From the Manual

A drop-down list enables you to select a single value from a list of supplied values. You can use a dynamic or static list of values for the drop-down list.
'Then it goes on to say'
When using a drop-down list input control to supply parameter values, the Multiple property value indicates whether multiple values can be selected from a list of supplied values at run time.
Note: A multiselect list enables you to select multiple values by using the Ctrl key while selecting values. In order to select multiple values in the drop-down list, the procedure must be set up to accept multiple values. Ensure that the Variable Type for the parameter value is Multiselect OR or Multiselect AND in the procedure.
From HTML Composer, insert a report with parameters that accept multiple values.
For example, create a report with Multiselect OR as the variable type for the parameter, accepting a dynamic list of values from ggsales, with REGION as the value for returned and displayed fields.
When the New Parameters dialog box appears, accept the default control type of Drop down list and click OK.
A drop-down list is created in the layout and assigned the name combobox(n), where n is a number.
Select Multiple from the Multiple drop-down list in the Properties tab of the Properties window.
This indicates that multiple items can be selected from the drop-down list.


The pictures of the multi select drop down don't indicate any scroll bars. I made an html page(using version 8105) and also get the scroll bars once the multiple property is selected. It does look to me like WF is changing the control type to a listbox from a drop down once the multiple property is selected.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
February 14, 2017, 03:38 PM
Waz
Using Developer Tools in the browser, I found that this happens.

The combobox (unfocused) has one option, size=1.

When Clicked on, (focused) it has all the options expected, size=5.

Behind the scenes, the control is dynamically being changed from a combo to a list box by changing the size from 1 to 5 and the options dynamically loaded into the control. Then when the control loses focus, the size is reset to 1 and the option is set to a concatenated list of selected options.

I would strongly suggest opening a ticket with techsupport on this one.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!