I'm very new in Pentaho CDE and I needs to display parameter's value as result of "select component".
I have a parameter name "selectedYear" that I needs to show parameter's value in column name "selectedYear_value".
I use "Text component" name "TC1" with expression :
function() {return Dashboards.getParameterValue("selectedYear");}
but the result is "Error processing component (TC1)".
Select Component :
Text Component :
Please help...
Regards,
Boy_Rc
You need to put a name for the function:
function fun() {return Dashboards.getParameterValue("selectedYear");}
Related
Based on this threat I've managed (with special thanks to Tami) to create a dropdown menu with variable year numbers in it.
Now I would like to use that chosen value of that dropdown menu as a (part of the) placeholder for another input field.
I tried this with no luck:
[number* ba-maanden min:1 max:12 placeholder "cf7_get_input="recent-years""]
Does anyone has an idea how to get this done?
Thanks,
Vasco
This is not tested, but should work. You can either add this to your form itself by making it all inline and surrounded with <script> and </script> or add this to your theme's js file.
jQuery(function($) {
$('select[name="ba-maanden"]').on('change', function(){
// Assign variable $placeholder to the chosen value
let $placeholder = $(this).val();
// replace 'your-field-name' with the cf7 field name
$('input[name="your-field-name"]').attr('placeholder', $placeholder);
});
});
My code is as follows:
https://jsfiddle.net/urjg6fop/
I want "Select value" to be displayed initially, but instead it shows a blank.
My value is "", my model is tracker[city] and I intialise all the values of tracker[city] to be "" so I would expect the initial value of Select value to be displayed, but instead it is blank.
What am I doing wrong?
Vue cannot detect dynamic property addition or deletion, which is what you're doing in mounted():
this.tracker[city] = ""; // dynamically adding `city` keys to `tracker` object (DON'T DO THIS)
You'd have to use Vue.set or this.$set instead:
this.$set(this.tracker, city, "")
demo
I have a v-repeat instance and want to filter it by a search key.
If there is no match for the search, i want to be able to show a message:
"There is no result that match your query" or something like that.
Her is a fiddle: http://jsfiddle.net/yMv7y/958/
So only if the filter returns no answers the message should be shown.
Ideas?
You need computed properties. Basically like:
computed: {
filteredThings: function () {
return this.things.filter(function(thing){
return thing.indexOf(this.searchQuery) > -1;
}.bind(this));
}
}
demo: http://jsfiddle.net/dewey92/Lr9r2kfv/2/
I have also answered this type of question in Vue.js empty filter results
I implemented a dynamic column visibility to hide/show columns, e.g. DT.columns(5).visible(true) and DT.columns(5).visible(false) to show/hide column 5. I also have a callback for createdRow which let's say makes a html button out of the text in column 5.
Currently in createdRow I check this.api().columns(5).visible() and if true then I proceed to do $('td:eq(5)',row).html('<button>'+data[5]+'</button>') cell content, and if false then I return because otherwise I'd overwrite the current 5th <td> which is not the intended one. But then when I unhide column 5, it comes up as text since I did not run the previous code.
I'd like to be able to run the code and cache the html of the cell in column 5 so that when it's unhidden, it comes up with the intended <button>. What's the best way to do that? The column-visibility event?
Note that I know I can use the render: function (...) {} option for the column, but I do not want to use that because it affects the raw data of the table and affects filtering and searching - I want the raw data to remain unaffected, which is why I was using the createdRow or rawCallback callbacks.
Assume column 5 has visibile: false in the DataTable initialization object which looks like this:
var DT = $('#dt').DataTable({
...
createdRow: function (row, data) {
if (this.api().column(5).visible()) {
$('<button>' + data[5] + </button>')
.appendTo($('td:eq(5)',row).text(''));
}
);
Cheers
Look into using columnDefs and the 'render' function instead...
var DT = $('#dt').DataTable({
...
"columnDefs":[
{
'targets':[0],
'visible':false,
'render':function(data, type, row, meta){
...
}
]
});
https://datatables.net/reference/option/columns.render
https://datatables.net/reference/option/columns.data
my problem is that while i am pass query string controller method accepting query string value . while i am passing value as as route it was not accepting value and showing null value . when i convert parameter name page to id then it show value is accepting route value
Route
routes.MapRoute("videoCategory", // route name
"{Controller}/{action}/{page}",
defaults : new
{ Controller = "Category", Action = "Videos", Page = UrlParameter.Optional }
controller
when i change parameter name from page to id its work
public ActionResult Videos(string page )
{
List<Videos> vid = new List<Videos>();
vid = modelvid.getVideos(page);
ViewBag.Pagecount = (int)Math.Ceiling(((double)modelvid.VideosCount(page) / (double)12));
return View(vid);
}
View
<a href="#item.masterurl/#item.suburl/#item.videoslink" id="ContentPlaceHolder1_lstview_ctrl0_A1_0" rel="bookmark">
<img src="#item.videoImage" alt="The Arctic Light" class="entry-thumb" />
<div class="video-flag">
</div>
</a>
**route url for above code **
www.domain.com/category/videos/Amazing-Leak
The framework is trying to find a value passed to it in the request that matches the name of the parameter that you have specified in the action method. Among the places it looks in are the query string, the posted data and route information.
The link you provided has no query string, and there is no posted data, so the only place to look for the parameter is in the route info. The route specifies a "Page" section, the framework uses that to fill the parameter the action method is expecting.
If you change the parameter name to id, the framework can no longer match it to anything and will therefore pass in null to the action method. If you want to use id as the parameter name, change the last section in the route to {id} instead of {page}. Or you can change the link to include a query string specifying a passed in variable as in: ?id=somevalueand you can then cancel the {id} section of the route. In case you go with the second option, don't forget to URL encode the value before passing it in.