Can not bind:this on Grid.js in svelte - gridjs

When trying to do (grid is defined) i can see the $$, $destroy, $on and $set properties but for any other props such as data, columns, etc... i get Exception: Error: <Gridjs>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>' at get columns [as columns].
I am writing my own custom row select plugin with a checkbox on the side of each row, in order to check or uncheck all rows at once I need to access the the rows from inside the grid
Is there an way to do bind:this and access the properties inside the grid from svelte?

Related

pentaho first steps: link combobox to chart

I'm completely new to SO, Pentaho, and have a (very) limited knowledge on js and jquery.
I need a simple requirement: whenever my combobox changes (2 values: budget or estimate), I need to reload my chart.
What I've tried so far:
In Components panel, I've added a
-Simple Parameter
--Name: param_budget_or_estimate
--Property value: budget
-Select component
--Name: BudgetEstimate_Select
--Parameter: budget_or_estimate
--Datasource: budgetestimate_query
-CCC Pie Chart
--Name: piechart_linecosts
--Listeners: added param_budget_or_estimate
--Parameters: arg param_budget_or_estimate, value param_budget_or_estimate
--Datasource: budgestimate_piechart
In Datasrouces panel, I've added a
-sql over sqlJndi query budgetestimate_query, named budgetestimate_query, that returns a
select distinct budget_or_estimate from budget_or_estimate;
-sql over sqlJndi query named budgetestimate_piechart, that returns a
SELECT COST_LINE_NAME
,amount
FROM VI_LINE_COSTS_PIE_CHART
WHERE budget_or_estimate=${param_budget_or_estimate}
;
Yet, I fire up my dashboard and changing the combobox changes nothing.
What am I doing wrong?
Thanks in advance!
First, you need to create a parameter. Let it be named parameter_one.
Then, you set your select component to have parameter_one as Parameter property (so it propagates the onchange event's value to the parameter).
Now, the piechart must have parameter_one as listeners, and parameter_one as parameters (arg=parameter_one, value=parameter_one). So, you declare that whenever parameter_one changes, the piechart should be reoloaded (listener) and that parameter_one's value is relevant to the calculation (parameter).
Finally, the piechart DataSource should look like:
select A.id,A.value
FROM
(
select '1' as id, 10 as value
union all
select '2' as id, 20 as value
) A
WHERE A.id=${parameter_one}
;

How to retrieve the rows which are selected in the list report page of smart templates

This is the List Report type of Smart Template application
Here I have selected 2nd and 5th row, I also have a button named Send Requests in the section part which is highlighted. If I click this button it calls a javascript controller function which is defined in the extensions of the application. In this js function how can I retrieve the selected rows that are selected?
I have enabled the checkboxes in this page by mentioning this code
"settings": { "gridTable": false, "multiSelect": true } in the manifest.json
As it was recommended by this link https://sapui5.netweaver.ondemand.com/#docs/guide/116b5d82e8c545e2a56e1b51b8b0a9bd.html
I want to know how can I retrieve the rows which got selected?
There is an API that you can use for your use case. It is described here: https://sapui5.netweaver.ondemand.com/#docs/guide/bd2994b69ef542998becbc69ab093f7e.html
Basically, you just need to call the getSelectedContexts method. Unfortunately you will not be able to really get the items themselves, only the binding contexts (which point to the data entities which are selected). Excerpt from the documentation:
After you have defined a view extension, you can access and modify the
properties of all UI elements defined within these extensions (for
example, change the visibility). However, you cannot access any UI
elements that are not defined within your view extensions.
In this type of table there is way.
var myTable=sap.ui.getCore().byId("your table id");
get all rows:
var myTableRows=myTable.getRows();
now get selected Indices
var selectedIndeices=myTable.getSelectedIndices(); //this will give you array of indeices.
now run loop on indeices array. And get particular row item;
// get binding path
var bindingpath=myTableRows[2].getBindingContext().sPath; // this will return eg:"/ProductCollection/2"
// now get Binding object of that particular row.
var myData=myTableRows[2].getModel().getObject(bindingpath); // this will return binding object at that perticular row.
// once your loop is over in the end you will have all object of selected row. then do whatever you want to do.
If you use smart template create an extension.
This is the standard event befor the table is rebinding:
onBeforeRebindTableExtension: function (oEvent) {
this._table = oEvent.getSource().getTable();
}
In your action function (or where you want) call the table and get the context :
this._table.getSelectedContexts();

Issue in setting Value in Select Item from RPC Call in GWT

I am facing issue in Setting the Value of Select Box in Grid .
Scenario: in the ListGrid i am having two Combo box .
For One combo box i am getting the value in the list during the onload and displaying .
On change value of first combo i need to fetch data from a list with input value from frst combo. i am getting the value from list but when i try to set in the second combo its not loading
Please find my code below.
//Properly Loading Combo
TaskName=new ListGridField("task_name","task_label);
SelectItem taskItem=new SelectItem("task_name","task_label);
taskNameList=populateTaskName();//Getting while onload
taskItem.setValueMap(taskNameList);
taskItem.addChangedHandler(...);
TaskName.setEditorType(taskItem);
TaskName.setValueMap(taskNameList);
TaskName.setRequired(true);
TaskName.setCanEdit(true);
//Not Loading Combo
SubTaskName=new ListGridField("Sub_task_name","Sub_task_label);
SelectItem subTaskItem=new SelectItem("Sub_task_name","Sub_task_label);
subTaskItem.addChangedHandler(...);
SubTaskName.setEditorType(taskItem);
TaskName.setRequired(true);
TaskName.setCanEdit(true);
//ChangeHandlerFor taskItem-FirstCombo
onChange(){
Form item=event.getItem();
item.setTooltip(item.getDisplayValue());
String taskId=String.valueOf(item.getValue());
populateSubTaskname(taskId);
subTaskItem.setValueMap(subtaskNameList);//getting the subtaskname List from RPC Call
SubTaskName.setValueMap(subtaskNameList);
populateSubTaskname(){
getting the value and loads in List
//subtaskNameList
subTaskItem.setValueMap(subtaskNameList);//getting the subtaskname List
SubTaskName.setValueMap(subtaskNameList);
}
//ChangeHandlerFor taskItem-Second Combo
onChange(){
Form item=event.getItem();
item.setTooltip(item.getDisplayValue());
}//Here also Name in the Map is not setting instead setting the value alone sometimes
Please help me where im wrong.
Once value in the combobox/select item changes, you need to assign it again to List grid field.
eg: listGridField.setEditorProperties(selectItem)

JavaFX error: incompatible types - Object cannot be converted to Node

I have defined 3 labels in a FXML file within a grid pane. I am trying to read the following XML file and display the labels present in the file in a grid pane. The numerical values in the XML file denotes the row & column position.
<data>
<lbl1>0,0</lbl1>
<lbl2>0,1</lbl2>
<lbl3>0,2</lbl3>
</data>
I have added all the elements to the HashMap and then retrieve it to be displayed. Firstly, I added all the three labels one by one as follows:
hm.put("lbl1", eElement.getElementsByTagName("lbl1").item(0).getTextContent());
hm.put("lbl2", eElement.getElementsByTagName("lbl2").item(0).getTextContent());
hm.put("lbl3", eElement.getElementsByTagName("lbl3").item(0).getTextContent());
Then I display them as follows:
grid.add(lbl1, Integer.parseInt(hm.get("lbl1").toString().split(",")[0]),Integer.parseInt(hm.get("lbl1").toString().split(",")[1]));
grid.add(lbl2, Integer.parseInt(hm.get("lbl2").toString().split(",")[0]),Integer.parseInt(hm.get("lbl2").toString().split(",")[1]));
grid.add(lbl3, Integer.parseInt(hm.get("lbl3").toString().split(",")[0]),Integer.parseInt(hm.get("lbl3").toString().split(",")[1]));
The above code works well without any issues and I can see the labels on the grid.
Now, instead of adding the labels one by one, I added all of them in a single statement through a 'for' loop as shown below:
if (!eElement.getTagName().toString().equals("data"))
hm.put(eElement.getTagName(), eElement.getTextContent());
If I try to display the label, for example:
grid.add(hm.get("lbl1"),0,0);
I get an error:incompatible types - Object cannot be converted to Node.
If I try to typecast:
grid.add((javafx.scene.Node) hm.get("lbl1"),0,0);
I get an error:java.lang.ClassCastException: java.lang.String cannot be cast to javafx.scene.Node
If I print the hashmap entries, the following output is shown:
lbl1=0,0, lbl2=0,1, lbl3=0,2
How to fix this error? Is there any other way in which I can add all the elements in a single statement and then display them?
in your imports add:-
import javafx.scene.control.Label;
I suspect that the current import is from awt.
From your sample code, I guess that hm is an instance of Map<String, String>
So, when you call hm.get("lbl1") , you get a String.
You're trying to add this String to a GridPane, but the add() method is expecting a javafx.scene.Node. That's why you get a an error "incompatible types".
Instead, you should add your instances of javafx.scene.control.Label (lbl1, lbl2, lbl3)

In Codecharge Studio how do i get a select box with optgroup tag?

I am trying to use a optgroup tag in CCS. But the default list box doesn't have an option for this. Can someone explain how to get the recordset in After Execute Event and do a custom select HTML using PHP and put in place of the existing select code?
As you found out, the optgroup is not handled in CCS, so you are left with some overriding to do - or do what I did, and decide that optgroup wasn't worth the hassle.
You can use the Listbox Before Show (instead of 'After Execute') method to override/set up the options and use some of the supplied examples as a guide.
Check the help file for the following sections:
'Dynamically Modify the "List Of Values" of a ListBox'
'Retrieve Multiple Field Values from a Database'
There are also some partial solutions on the codecharge forums for overriding the options (search for optgroup)
Alternatively, you could consider 2 dependent drop-downs - the 'parent' with the Groups, and the 'child' with the options.
Edit: Modify SQL for listbox
You can do some pretty complex SQL in the Listbox Properties 'Data Source' (use 'Data Source Type' of 'SQL' and enter your SQL in the Query builder) As long as you return at least one column, it will be shown in the 'Bound Column' and 'Text Column' properties of the Listbox.
I'm confused why you reference the 'Before Build' events - you don't need to alter the code there - just use the Properties of the controls. For most of the setup of forms and controls, data etc, it can be done though the Properties and Events, without the need for modifying the generated code (once edited, it won't be regenerated if you change something so then you have code not updating and getting out of sync with the 'design' view)