|
Re: Setting a default parameter value from a dataset value [message #753807 is a reply to message #753785] |
Fri, 28 October 2011 20:17 |
|
Mike
I do not know of an easy way of doing this. I assume you have an issue
with the blank option that is displayed instead of the first result? If
so you could modify the parameter dialog fragment to ignore the blank entry.
Jason
On 10/28/2011 1:54 PM, Mike Wulkan wrote:
> Hi,
>
> I have a cascading parameter list as follows:
> Id (bound to Get All Subscriptions dataset)
> Start Time (bound to Get Start Times dataset)
> End Time (bound to Get End Times dataset)
>
> When the user selects an Id the Start Time parameter is filled by
> executing the Get Start Times query.
> I would like to select the first row from the list of Start Times as the
> default value of the list and subsequently the same for End Time.
> The GUI only lets you specify a constant value for the default value and
> I'm clueless as to how to access the dataset values from the available
> script exits for the parameter.
>
> I would much appreciate if someone could show me how this could be done.
>
> Thanks
> Mike
|
|
|
|
Re: Setting a default parameter value from a dataset value [message #754028 is a reply to message #754004] |
Mon, 31 October 2011 14:37 |
|
Look at the ComboBoxParameterFragment.jsp.
Try changing this
if ( parameterBean.getSelectionList( ) != null )
{
if( !parameterBean.isRequired( ) || ( parameterBean.isCascade( ) &&
DataUtil.trimString( defaultValue ).length( )<=0 ) )
{
if( allowMultiValue && DataUtil.contain( values, "", true ) )
{
%>
<OPTION SELECTED></OPTION>
<%
}
else
{
%>
<OPTION></OPTION>
<%
}
}
if ( DataUtil.trimString( defaultValue ).length( ) > 0 &&
!parameterBean.isDefaultValueInList( ) ) // Add default value in Combo Box
to
if ( parameterBean.getSelectionList( ) != null )
{
if ( DataUtil.trimString( defaultValue ).length( ) > 0 &&
!parameterBean.isDefaultValueInList( ) ) // Add default value in Combo Box
Jason
On 10/31/2011 8:03 AM, Mike Wulkan wrote:
> Thanks Jason, simply ignoring the blank entry would work for me but I'm
> not sure how to do that? When I uncheck the "required parameter"
> setting, the blank is replaced by the string "null" and the dialogue
> won't dismiss without choosing a value from the list. Fyi, the parameter
> is a date field if that makes a difference. I really just want the first
> item in the list to be the default value; ideally I'd like it to show up
> in the dialogue, but blank would also suffice. I assume that if I could
> figure out the blank issue, I'd have to have the report code test the
> parameter for blank and replace it with an equivalent query to get the
> first value from the dataset?
|
|
|
Powered by
FUDForum. Page generated in 0.03046 seconds