Focal Point
[CLOSED]Regarding default value

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

February 18, 2016, 12:07 AM
Bhanusri
[CLOSED]Regarding default value
Hi,

I have following requirement that I have to give default value for a parameter or a filter.

For example I have a column Year having values like 2002, 2005, 2015,2016 etc.

When I used filter of type dynamic, by default WebFocus ordering data in ascending and giving 2002 as default but I want 2005 as a default.

Can any one help me out?

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8
Windows, All Outputs
February 18, 2016, 08:11 AM
Squatch
This can be done using JQuery:

//Begin function combobox1_ononafterload
function combobox1_ononafterload(ctrl) {
    $("#combobox1").val("2005");
}
//End function combobox1_ononafterload

This assumes you are using a combobox (drop down) with a unique identifier of "combobox1". The code will run immediately after the combobox is dynamically populated.

Add this to the "Embedded JavaScript/CSS" tab in App Studio (I am assuming you are using App Studio).


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 18, 2016, 08:24 AM
Squatch
And here is how it can be done using plain old JavaScript:

//Begin function combobox1_ononafterload
function combobox1_ononafterload(ctrl) {
    var a = document.getElementById("combobox1");
    a.value = "2005";
}
//End function combobox1_ononafterload



App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 18, 2016, 08:35 AM
SSander
I think hes speaking about "Filters" what appear on autoprompting


Release: WebFOCUS 8104, AppStudio: 8105
OS: Windows
Output: HTML,Excel,Active Reports
February 18, 2016, 08:51 AM
Squatch
In that case, I don't know how it can be done.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 19, 2016, 02:18 AM
Bhanusri
Hi,

I am not using AppStudio. I have WebFocus Express 8 trail version. I am also asking about parameters for procedure or filters for data set.


WebFOCUS 8
Windows, All Outputs
February 23, 2016, 10:20 AM
Vivian
Look at the code that is generated and add "BY HIGHEST" and that will cause your year to be in descending order.

All in the keysheets!


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

February 23, 2016, 10:28 AM
Squatch
I think the issue is that the poster wants a default year that is in the middle of other years.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 23, 2016, 10:34 AM
Vivian
Ahhhh.... perhaps just setting a default variable to his 2005 solves the problem.

hmmmm... the continuous issue of not understanding the ENTIRE need


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

February 23, 2016, 10:56 AM
Squatch
quote:
Originally posted by Vivian:
Ahhhh.... perhaps just setting a default variable to his 2005 solves the problem.

hmmmm... the continuous issue of not understanding the ENTIRE need

I think there is a mistake in WebFOCUS Keysheet 8.0.2. At the top of page 53 this:

ACROSS [HIGHEST] field [AS option]

Should be:

ACROSS [HIGHEST] field [AS col_name] option

I stumbled across that a few weeks ago (No pun intended).


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs