Not call the HelpRequest function - sapui5

I have a Input field created into a controller.
sap.ui.getCore().byId("SimpleFormChange354").addContent(new sap.m.Input({value : "", enabled:true, editable:true, showValueHelp:true, valueHelpOnly:true, valueHelpRequest:"handleValueHelp"}));
In the same controller I define the function:
handleValueHelp : function (oCOntroller) {
if (! this._oDialog) {
this._oDialog = sap.ui.xmlfragment("apps.appIntra.fragment.dialogClienti", this);
}
.....
},
But if i click on the suggestion element at the end of input field i have an error:
Uncaught TypeError: undefined is not a function sap-ui-core.js:122
a.fireEvent sap-ui-core.js:122
a.fireEvent sap-ui-core.js:134
(anonymous function) sap-ui-core.js:134
sap.m.Input._fireValueHelpRequestForValueHelpOnly Input.js:16
sap.m.Input.ontap Input.js:17
a._callEventHandles sap-ui-core.js:134
a._handleEvent sap-ui-core.js:134
U._handleEvent sap-ui-core.js:134
Q.extend.proxy.p sap-ui-core.js:16
Q.event.dispatch sap-ui-core.js:27
g jquery-mobile-custom.js:17
p jquery-mobile-custom.js:17
Q.event.dispatch sap-ui-core.js:27
Q.event.add.v3.handle sap-ui-core.js:27
Q.event.trigger sap-ui-core.js:27
(anonymous function) sap-ui-core.js:27
Q.extend.each sap-ui-core.js:16
Q.fn.Q.each sap-ui-core.js:16
Q.fn.extend.trigger sap-ui-core.js:27
P jquery-mobile-custom.js:17
R jquery-mobile-custom.js:17
Q.event.dispatch sap-ui-core.js:27
Q.event.add.v3.handle sap-ui-core.js:27
Instead, if I try to attach the function by:
sap.ui.getCore().byId("SimpleFormChange354").addContent(new sap.m.Input({value : "", enabled:true, editable:true, showValueHelp:true, valueHelpOnly:true}).attachValueHelpRequest(this.handleValueHelp(this)));
when in execution time I arrive at this code the handleValueHelp get fired (immediately, not even I click on suggestion item!).
Then, I try to click on the suggestion item i got this error:
Uncaught TypeError: Cannot read property 'call' of undefined sap-ui-core.js:122
a.fireEvent sap-ui-core.js:122
a.fireEvent sap-ui-core.js:134
(anonymous function) sap-ui-core.js:134
sap.m.Input._fireValueHelpRequestForValueHelpOnly Input.js:16
sap.m.Input.ontap Input.js:17
a._callEventHandles sap-ui-core.js:134
a._handleEvent sap-ui-core.js:134
U._handleEvent sap-ui-core.js:134
Q.extend.proxy.p sap-ui-core.js:16
Q.event.dispatch sap-ui-core.js:27
g jquery-mobile-custom.js:17
p jquery-mobile-custom.js:17
Q.event.dispatch sap-ui-core.js:27
Q.event.add.v3.handle sap-ui-core.js:27
Q.event.trigger sap-ui-core.js:27
(anonymous function) sap-ui-core.js:27
Q.extend.each sap-ui-core.js:16
Q.fn.Q.each sap-ui-core.js:16
Q.fn.extend.trigger sap-ui-core.js:27
P jquery-mobile-custom.js:17
R jquery-mobile-custom.js:17
Q.event.dispatch sap-ui-core.js:27
Q.event.add.v3.handle

In your first line you have:
valueHelpRequest:"handleValueHelp"}));
which is just a string.
Replace that string with the actual reference to your method:
valueHelpRequest:this.handleValueHelp}));
and it will work ;-)

Related

Pine Script - ternary operator in "display" parameter in plot call causes invalid argument error

//#version=5
strategy(title='Test',overlay=true)
i_hide_eq = input.bool(true, title='Hide Equity Curve')
plot(strategy.equity, display=i_hide_eq ? display.none : display.all)
plot(series=1.5, color=color.red, style=plot.style_linebr, title='Test Point')
Why does this code cause following error? I am using "Possible values".
Invalid argument 'display' in 'plot' call. Possible values: [display.none, display.all]
Make it in this way.
//#version=5
strategy(title='Test',overlay=true)
i_hide_eq = input.bool(true, title='Hide Equity Curve')
plot(i_hide_eq == true ? strategy.equity : na)
plot(series=1.5, color=color.red, style=plot.style_linebr, title='Test Point')

error " Undefined function 'data_ref' for input arguments of type 'double'. "

my code matlab for denoising EEG artifact show me always this error : "error " Undefined function 'data_ref' for input arguments of type 'double'. "
%% Load Reference Data
load data_ref;
data_ref = data_ref(1:data_length)*10/2^15;
data_ref = power_supply_noise_remove(data_ref, Fs);
data_ref = data_ref - mean(data_ref);
data_ref = [data_ref data_ref];**
the error is line 26:
Undefined function 'data_ref' for input arguments of type 'double'.
Error in art_emd_ica (line 26) data_ref = data_ref(1:data_length)*10/2^15;

MATLAB: errorn in butter() command

I wrote the following function:
function [output_signal] = AddDirectivityError (bat_loc_index, butter_deg_vector, sound_matrix)
global chirp_initial_freq ;
global chirp_end_freq;
global sampling_rate;
global num_of_mics;
global sound_signal_length;
for (i=1 : num_of_mics)
normalized_co_freq = (chirp_initial_freq + chirp_end_freq)/ (1.6* sampling_rate);
A=sound_matrix ( i, : ) ;
peak_signal=max(A);
B=find(abs(A)>peak_signal/100);
if (butter_deg_vector(i)==0)
butter_deg_vector(i)=2;
end
[num, den] = butter(butter_deg_vector(i), normalized_co_freq, 'low');// HERE!!!
filtered_signal=filter(num,den, A );
output_signal(i, :)=filtered_signal;
end
This functions runs many-many times without any error. However, when I reach the line: [num, den] = butter ( butter_deg_vector(i), normalized_co_freq, 'low');
And the local variables are: i=3, butter_deg_vector(i)=1, normalized_co_freq=5.625000e-001
MATLAB prompts an error says:
??? Error using ==> buttap Expected N to be integer-valued.
"Error in ==> buttap at 15 validateattributes(n,{'numeric'},{'scalar','integer','positive'},'buttap','N');
Error in ==> butter at 70 [z,p,k] = buttap(n);"
I don't understand why this problem occurs especially in this iteration. Why does this function prompt an error especially in this case?
Try to change the code line for:
[num, den] = butter (round(butter_deg_vector(i)), normalized_co_freq, 'low');

Error reading AVI files in MATLAB

I am working on extracting features from avi files using MATLAB. Every time I run the code I get an error "Exception in Reading". Code is:
cd('D:\Classified\negative-videos');
neg_files = dir('*.avi');
% compute negative files
for fileIter=1:size(neg_files,1)
tic;
movie_name = neg_files(fileIter).name;
try
[color_score__,edge_score__,spatio_score__,score__] = lg_model(movie_name,fps,3);
if(score__ < threshold)
true_neg = true_neg + 1 ;
end
if(score__ >= threshold)
false_pos = false_pos + 1 ;
end
fprintf('[ %d / %d ]\tFile : %s\tscore : %f\tcolor_score : %f\tspatio_score : %f\n', fileIter,size(neg_files,1),movie_name, score__,color_score__, spatio_score__);
catch ME1
fprintf('[ %d / %d ]\tFile : %s\t EXCEPTION IN READING \n', fileIter,size(neg_files,1),movie_name);
end
toc;
end
fprintf('INTERMEDIATE\ttrue pos = %d \n false pos = %d \n true neg = %d \n false neg = %d \n', true_pos,false_pos,true_neg, false_neg);
What is the problem with the above code snippet?
The stack trace is as follows:
For each of the 18 videos in my directory I get following error:
[ 1 / 18 ] File : 38-Meter High Dive Goes Wrong.avi EXCEPTION IN READING
ME1 =
MException
Properties:
identifier: 'MATLAB:UndefinedFunction'
message: 'Undefined function or method 'VideoReader' for input arguments of type 'char'.'
cause: {}
stack: [3x1 struct]
Methods
ME1 =
MException
Properties:
identifier: 'MATLAB:UndefinedFunction'
message: 'Undefined function or method 'VideoReader' for input arguments of type 'char'.'
cause: {}
stack: [3x1 struct]
Methods
MException
Properties:
identifier: 'MATLAB:UndefinedFunction'
message: 'Undefined function or method 'VideoReader' for input arguments of type 'char'.'
cause: {}
stack: [3x1 struct]
Methods
Undefined function or method 'VideoReader' for input arguments of type 'char'.
3x1 struct array with fields:
file
name
line
MATLAB:UndefinedFunction
Elapsed time is 0.017901 seconds.
Apologies for not posing as a comment, but need a little more rep before I'm allowed to.
I agree with #JimInCO, it looks like you don't have VideoReader. It was first introduced in R2010b. You can try using aviread instead if you have an older version.

How to write to two output ports from inside architecture in VHDL?

I encountered a problem when trying to connect a component to two output ports of parent hierarchy in VHDL. Since the physical connection can be done only via "port map" statement, there is no way to connect local signal to more than one output port. Here is an example:
The description of the above circuit should be smth. like this:
entity HIER is
port (
IN1 : in bit;
OUT1, OUT2 : out bit);
end hier;
architecture HIER_IMPL of HIER is
component BUF is
port (a : in bit; o : out bit);
end component;
begin
BUF1 : BUF port map (a => IN1, o => OUT1, o => OUT2);
end HIER_IMPL;
However, double assignment of output port "o" to both OUT1 and OUT2 won't work as it is prohibited in VHDL.
Is there a reason why you cannot create an internal signal and use that signal to drive the two output ports like this?
entity HIER is
port (
IN1 : in bit;
OUT1, OUT2 : out bit);
end hier;
architecture HIER_IMPL of HIER is
signal temp : bit;
component BUF is
port (a : in bit; o : out bit);
end component;
begin
BUF1 : BUF port map (a => IN1, o => temp);
OUT1 <= temp;
OUT2 <= temp;
end HIER_IMPL;
If this is not possible, how about this?
entity HIER is
port (
IN1 : in bit;
OUT1, OUT2 : out bit);
end hier;
architecture HIER_IMPL of HIER is
component BUF is
port (a : in bit; o : out bit);
end component;
begin
BUF1 : BUF port map (a => IN1, o => OUT1);
BUF2 : BUF port map (a => IN1, o => OUT2);
end HIER_IMPL;

Categories