check the value of a model input QGIS - qgis

I am making a graphical modeler in QGIS and I want to know if the value of an input can be checked.
This is to see if the user has filled in that value or left it empty. I have put the entry that is not mandatory.
Can this be checked and if it is null do one thing and if it is not null do something else?
enter image description here
Currently, if the user does not enter a variable in that field (although it is not required), it gives the following error: "Could not load source layer for INPUT: not found".
I have tried the "Conditional branch" tool, but I don't get out of here.
enter image description here

Related

How to link an Input Control to a report's Parameter

I'm unable to link an Input Control to my report's Parameter. I feel I'm doing right, but I can't see the desired result in the final report.
My intention is to create a list, filled by some options, and display the list in a report as a parameter, so the user can (multi)select the options. As far as I know, I must create an Input Control on the server, create a Parameter on the report using the same name between the Input Control and the Parameter.
I've created a List of Values named ListaCalificaciones as follows:
Then, this is the Input Control:
Finally, this is the parameter:
However, when it comes to show the report on Jasper Server's web interface, I can't see a filled input:
Am I missing something?
By the way, I'm using Jasper Studio 6.6.0 and Jasper Server 7.1.0 (compiled version 20180504_1307).
Edit 2018/10/05 13:04
I've changed the input control, so that the id is ic_calificaciones and the name stays as it was (Calificaciones). I've found a way to make it work. First, I deploy the report to my server (local server in my case). Then, I edit the report, go to "Controls and resources", remove the ic_calificaciones parameter and add a InputControl parameter to the report. That way the Calificaciones parameter gets filled up with options.
I found the solution, it was just in front, but due to a poor UI I just didn't realise...
You must edit your parameter's name to match the Input Control's name, in my case it ought to be ic_valoracion. Then, the parameter-to-input-control-binding has to be made when publishing the report to the server.
So, being in Jasper Studio, click on publish button, as seen in the following picture:
Now, select the location where to publish the report. Then, the second step is what we're looking for, it's the place where you must select the resources to publish. As seen in the next image, you must edit your parameter's type to select "Link To Resource", click on whichever place and a new prompt will appear. Now, there, select the desired Input Control.
Finally, test your report.

In Selenium IDE create node text title not found and give the error

Generate error Image screenshot :
I am also use command and run that i.e. type, typeAndWait, typeKeys, typeKeysAndWait , also give the error
Selenium IDE:
Command : Target
type : id=ctl00_Dialogproxy_deletenews_btnDelete
Reference box give the message text :
type(locator, value)
Arguments:
locator - an element locator
value - the value to type
Sets the value of an input field, as though you typed it in.
Can also be used to set the value of combo boxes, check boxes, etc. In these cases, value should be the value of the option selected, not the visible text.
I am send the image URL for all details
Edit: Image was hidden so make it visible.
This looks like it is again a duplicate of the issue you've noted in In Selenium IDE btnDelete (Button) not found
You follow up a "click" that loads a dynamic pop up with an action on a new element. It's possible that selenium is moving to fast for the pop up and the new elements are not in the DOM yet for selenium to access.
I suggest using a "waitFor" action, such as waitForElementPresent. You can also see if this is a case by inserting a pause (with 5 or 10 seconds). I do not recommend pause since it's a hard stop where as a waitFor command will take the minimum amount of time it needs.

Live search combo in Ext JS 4.2.2

I'm trying to implement a live search combo. It suppose to work like this:
When I enter a character into the combo field I read the current value and send it as a parameter to the store's url. In the backend the parameter is used to return any value from the database that contains it, so the store behind the combo gets filled only with those filtered values.
As I continue to enter characters into the combo, the parameter should be updated and sent again to the backend and so on, getting like this a smaller and smaller store.
I tryied to achieve this behaviour using the combo's event keypress, even keyup, but the problem is it's impossible for me to get access to the current value from the combo field.
For example, when I entered the "for" string into the combo, how can I obtain this value using the combo object? comboName.getValue() doesn't work, it returns nothing "".
I already saw the live combo example here: http://docs.sencha.com/extjs/4.2.2/#!/example/form/forum-search.html but doesnt help me at all.
So my big question is: how do i get the current value while still editing the combo's field?
Any help would be appreciated, thanks.
You should be able to use
comboName.getValue();
or
comboName.getRawValue();
Where comboName is your combo box. Are neither working- I note in your post you state getValues() which is an improper method. You may want to also check whether when you're referring to your combo box object, that the reference is actually correct. The first argument from the key events is actually the object itself, so you should be able to do, e.g.
listeners:{
keyup:function(comboBox){
var value = comboBox.getValue() || comboBox.getRawValue();
console.log(value);
}
}
Swapping you the value getting method as appropriate.
I found that the combo already has a quick search behaviour, I just have to set queryMode on 'remote' and some other small configurations. More details here:
Ext Js 4.2.2 combobox queryMode

Cascading input control is empty while accessing a Jasper Report

I call a jasper report through an independent URL through which I pass one of the input controls needed to run the report.
E.g. http:// localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&standAlone=true&reportUnit=xyz&ParentFolderUri=abcd&j_username=xyz&j_password=xyz&parameter1=value1& . . .
As you can see in the above independent URL, I pass the JasperServer username and password, reportUnit name and location and other mandatory parameters, along with the report input parameter, i.e., "parameter1" which can have a value like "value1".
I used a mandatory, read-only and visible input control for this input value. Its value would come from the independent URL, showed in the box but was read-only and hence could not be changed.
The report was working absolutely fine upto this point.
But the tragedy began when my client rejected this idea. He wanted a completely invisible input control to my report and the input value would be passed through the independent URL, just like illustrated above.
And then my client asked me to refer to this and made me work on cascading input controls.
Recently I added a cascading input control to this report. The input control type is a single select query, which utilizes two parameters that I pass to the report through the independent URL.
Now when the Jasper server responds to the independent URL with the input parameters, all the other static parameters work properly, except for the cascaded one.
When I click the select box of the cascaded input, I can see the desired options for a second, and then, it just goes empty while I'm viewing the select list.
But when I make the "Parameter1" input control visible, the cascading input control works!
And then I turn in invisible, the cascading input control turns into a beast that does things by itself and not listen to his master.
I am not able to understand why this is happening. Could anybody please provide me a solution to this?
I have found a temporary solution for this.
I made the "Parameter1" input control visible and read only.
Next, I used a stylesheet and defined a style rule that would affect that input control's display on the web page, making "display: none".
I passed the name of the stylesheet through the URL. So this stylesheet is used for the report.
Now, the "Parameter1" input control is invisible to the end user and my report still runs with no one knowing it's just a fix.

Dynamically add fields to input dialog

Is it possible to somehow add input fields to an input dialog (inputdlg()) in MATLAB when a specific event occurs, e.g. the user types in a certain value in one of the existing fields...?
Or is there any other 'hacky' way to achieve this so that the user doesn't have to click "OK" and I have to code to reopen another input dialog which contains more input fields..
Thanks!
inputdlg is not a built in function, so you might as well copy it, call it by another name and change its functionality.