Pentaho report designer , checkbox parameter checked by default - pentaho

we have set a check box parameter in Pentaho report designer .
When we launch the report the check box is unchecked .
what we want is , to set the default value of that Check box to be checked
so when we launch the report we don't have to check it .

Question: And how would you do the same things on Pentaho cde?
Answer:
Step1: First create one simple datasource.
=> Datasource name: query
=> Query:
SELECT "option1"
UNION
SELECT "option2"
UNION
SELECT "option3"
UNION
SELECT "option4"
UNION
SELECT "option5"
Step2:- Goto component panel and then select "Check Component". click on advanced properties.
Name: checkcomponent,
Parameter: checked,
Datasource: query,
HtmlObject: panel_1 (assumption),
preexecution: function f(){checked = ['option1','option2'];}
that's it run dashboard and see. Defaultly option1 and option2 are selected.
Thank you.

Related

Oracle APEX 18.2 -> need dynamic action based on list of values to make a field required

When overall_status in list ('Yellow Trend Up'...etc) then overall_description is required for user to enter information
overall_status:
Select List, Required-Above, Status Values(Red Trend Up, Yellow Trend Up) Dynamic Action * When Event=Custom, item=overall_status, condition=overall_status=Yellow Trend Up
True: Action=Show, Affect Elements=overall_description
overall_description:
Text Field * Appearance=Optional-Above
Validation=Value Required (YES)
When i run application/page and select Yellow Trend Up a Popup window appears with
Leave site? Changes you have made may not be saved Leave Cancel
Not sure what True: Action should be selected
Assuming you want the user to be required to fill in a description field when a certain value from the selection list is selected (like 'Yellow Trend Up' in this example), then a simple way to achieve this is to:
Create 'overall_status' as Select List.
For 'Page Action on Selection' choose: 'Redirect and Set Value'.
Create 'overall_description' as Text Field.
For 'Value Required' choose: 'Yes'.
In the 'Conditions' section of 'overall_description', choose 'Condition Type': 'Value of Item / Column in Expression 1 = Expression 2'.
For Expression 1 enter: 'overall_status'.
For Expression 2 enter: 'Yellow Trend Up'.
If you want to show this required description field if any value is selected in your 'overall_status' Select List, then choose 'Value of Item / Column in Expression 1 Is NOT NULL' and Expression 1 as 'overall_status'.

How do deselect a particular SELECT option in a non multi-select selenium

Select sel41 = new Select(TestUtility.getElementByXpath("//[#id=\'supervisor_select_list_id\']"));
//sel41.deselectByValue("167805");
sel41.selectByVisibleText("Employer Demo2 [HR Director]");
I want to deselect the default selected and select another value

How can I stop executing code after getting a result?

I have a textbox named "Search" and code that filters a customer out by name. I also want to display the whole table if the textbox is empty but don't know how to do it.
NOTE : I am using Microsoft Access.
Here is my code :
SELECT * FROM Customers
WHERE Forms.[Form1].[Text4] = Forms.[Form1].[Text4] AND FirstName=Forms.[Form1].[Text4];
Thank you for any help.
You need validate if text is empty or filter to another rules, this can be something like this:
SELECT * FROM Customers WHERE Forms.[Form1].[Text4] IS NULL OR FirstName = Forms.[Form1].[Text4];

How to select value from search drop down

How to select value from this type of drop down.
// select value from dropdown
Select dropdown = new Select(driver.findElement(By.id("select2-operative_id-container")));
dropdown.selectByVisibleText("Administrator");
and
Try above both method but not able to select value.
Please consider below image for better Understanding.
click this Image Link
For drop down value I am not able to select Xpath.
This is select drop down.
Select dropdown = new Select(driver.findElement(By.xpath("put here xpath")));
dropdown.selectByValue("A");
For bootstrap dropdown
# you have to first click on the arrow icon(v) of the drop down.
driver.findElement(By.xpath("put here xpath of the v icon")).click();
# Then find the xpath of the value which you have to select from drop down and then apply click operation on it.
driver.findElement(By.xpath("put here xpath of the value within drop down")).click();
Inspect the dropdown find the value and select your chosen option.
Select dropdown = new Select(driver.findElement(By.id("select2-operative_id-container")));
dropdown.selectByValue("Administrator");
or another method than should work is to send keys to select the option.
WebElement dropdown = new WebElement(driver.findElement(By.id("select2-operative_id-container")));
dropdown.sendKeys("Administrator");
You can use SelectByValue method.
Add the value name as string as below.
Select oSelect = new Select(driver.findElement(By.id("select2-operative_id-container")));
oSelect.selectByValue(<your value>);

How to display the name in an array containg name=>value pair

I'm new to yii framework. I have created a simple dropdownlist.
echo $form->dropDownList($model, 'max_cost', array('2'=>'Yes', '0'=>'No'),
array(
'empty'=>'Choose one',
'onchange'=>'alert(item.value);',
)
);
Now when I select Yes, the alert box will display Yes and when i select no the alert box will display no.
Suppose I want to display 2 when I select yes and 0 when I select no . What should I do for this? item.value displays the RHS I want to display LHS
log the "item" and you will know what are exactly parameters bound to items, then you can alert it or whatever you need:
'onchange'=>'console.log(item);', // here you can see what's inside item