tags:

views:

122

answers:

1

Hi,

I've value prompt with ui:checkbox group
parameter: p_IsLastMonth
Name: Prompt_IsLastMonth
ItemCount: 1; UseValue:Yes, DisplayValue: LastMonth?

and two Date Prompts.

Whenever the checkbox is checked, the UseValue 'Yes' is passed to the parameter 'p_IsLastMonth'. But whenever the checkbox is left as it is, it results in an error.

Element 'selectOptions' is not valid for content model: 'All(style,defaultSelections,conditionalStyles,conditionalRender,XMLAttributes)' 

I also tried giving a default value. But the default value has to be in the collection. But i want only one checkbox to be displayed.

I tried with html checkbox. But i'm not able to send the value 'either yes or no' to the parameter through javascript because however the finish button overrides the value.

Any help?

A: 

Unfortunately, I don't think you can accomplish what you want to do with only one checkbox. The only way you can leave a value prompt unselected and still submit the prompt page is to make it "optional", which means no value will be passed. An option is to use two check boxes and make them "required" so that either "yes" or "no" must be selected (but this can result in both being selected, which isn't good), or preferably use a radio list with two values and "yes" as the default. There may be a javascript answer to this, but I try to avoid that as much as possible since it sometimes leaves you open to version upgrade issues. Using a radio list is your easiest option.

Jamey
For the time being, i've created a checkboxlist with two checkboxes. clipping out the 2nd using a border surrounding the checkboxlist. IF nothing is selected 'no' will be passed. If 'yes' is selected, 'yes','no' will be passed which will be handled in the else statement:). Ofcourse you cannot select 'no' as it is hidden. Yes, I had the idea of radiobutton. But my client unfortunately prefers checkbox. But now the problem is, whenever the report is run in other versions or run from report studio,the checkbox is rendered as a radiobutton. Trying to fix it but in vain all the time:(.
Veer