Display and sum numbers
Hi, I am a new developer and try to learn the native sdk.
I tried several times, but don't know how I can add 2 numbers and display, don't have an option convert or number type just the text.
I want to receive 2 issues (in diferent textfield) and display the result of the sum in a label.
My code:
--------------------
import bb.cascades 1.2
{Page}
{Of container
TODO: fill me with QML
ID: containerID
layout: {DockLayout}
background: Color.Red
layout: {StackLayout}
}
topPadding: 80.0
rightPadding: 60
leftPadding: rightPadding
onCreationCompleted: {}
OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
}
TextField {}
ID: number 1
inputMode: TextFieldInputMode.NumbersAndPunctuation
}
TextField {}
ID: number2
inputMode: TextFieldInputMode.NumbersAndPunctuation
}
{Label
ID: result
Text located with the dynamic translation and locale update support
text: qsTr ("Hello World") + Retranslate.onLocaleOrLanguageChanged
textStyle.base: SystemDefaults.TextStyles.BigText
}
Button {}
onClicked: {}
result. Value = nuber1.value + number2.value
}
}
}
}
--------------------------------
Thanks for the attention,
David L
JavaScript has no type, if you add variables that contain numbers, you should get the result of the addition.
If this fails, you can multiply the variable with 1 to ensure that it is a number.
text in a textfield is in the property 'text', not 'value '.
Tags: BlackBerry Developers
Similar Questions
-
display and simple sum numbers 2
Hello everyone, well, I'm new in AS3 and I was looking for, but found no solution, so I hope someone can help me because this mast would be easy for the people who work with AS3.
My question is how do 2 fileds (numbers) of text input and a dynamic text field that will display the result of the sum of the fields (numbers) of text input 2?
"FirstInputTextField + SecondInputTextField = display the sum in the dynamic text field.
I hope I'm explaining just because my English is not so good.
Kind regards
SEA_Elvir
If you want it to happen automatically when you enter the values, you will need to have event listeners assigned at the entrance two textfields as well.
INPUT1.addEventListener (Event.CHANGE, sumInputs);
INPUT2.addEventListener (Event.CHANGE, sumInputs);function sumInputs(evt:Event):void {}
If (input1.length > 0 & input2.length > 0) {}
dynamic1. Text = String (Number (input1.text) + Number (input2.text));
}
}The code checks only to see the two entries contain something, so you'll have to add more terms if you want to have more control of what is considered to be a valid entry.
-
SQL query to display the sum of the values of each June and December
Hello having problems of construction of a query to the list SQL query to display the sum of the values of each June and December each year.
My Table;
TABLE name: MONTH_TERM
Fields with values:
TERM_KEY MONTH_ACTUAL MONTH_DATE 82 500 01/11/2015 0:00 82 450 01/12/2015 0:00 82 405 01/01/2016 0:00 82 400 01/02/2016 0:00 82 450 01/03/2016 0:00 82 425 01/04/2016 0:00 82 435 01/05/2016 0:00 82 410 06/01/2016 0:00 82 409 01/07/2016 0:00 82 415 01/08/2016 0:00 82 420 09/01/2016 0:00 82 422 10/01/2016 0:00 82 436 11/01/2016 0:00 82 556 01/12/2016 0:00 82 568 01/01/2017 0:00 82 624 02/01/2017 0:00 What I would like to see in a query result:
TERM_KEY MONTH_ACTUAL MONTH_DATE Total of 6 months 82 500 01/11/2015 0:00 82 450 01/12/2015 0:00 950 82 405 01/01/2016 0:00 82 400 01/02/2016 0:00 82 450 01/03/2016 0:00 82 425 01/04/2016 0:00 82 435 01/05/2016 0:00 82 410 06/01/2016 0:00 2525 82 409 01/07/2016 0:00 82 415 01/08/2016 0:00 82 420 09/01/2016 0:00 82 422 10/01/2016 0:00 82 436 11/01/2016 0:00 82 556 01/12/2016 0:00 2658 82 568 01/01/2017 0:00 82 624 02/01/2017 0:00 ---
Here's my query:
Select
"TERM_KEY,"
"MONTH_ACTUAL,"
to_char(MONTH_DATE,'MM/YYYY') MONTH_DATE,
DEAL to_char (MONTH_DATE, 'MM')
WHEN '06' THEN (SELECT SUM (MONTH_ACTUAL)
OF MONTH_TERM
WHERE the to_char (MONTH_DATE, 'MM') between 1 and 6
AND term_key = 82)
WHEN '12' THEN (SELECT SUM (MONTH_ACTUAL)
OF MONTH_TERM
WHERE the to_char (MONTH_DATE, 'MM') between 7 and 12
AND term_key = 82)
ELSE null
END as SIX_MO_CUMM,
of MONTH_TERM
where term_key = 82
It's my results:
TERM_KEY MONTH_ACTUAL MONTH_DATE Total of 6 months 82 500 01/11/15 0:00 82 450 01/12/15 0:00 3608 82 405 01/01/16 0:00 82 400 01/02/16 0:00 82 450 01/03/16 0:00 82 425 01/04/16 0:00 82 435 01/05/16 0:00 82 410 01/06/16 0:00 3717 82 409 01/07/16 0:00 82 415 01/08/16 0:00 82 420 01/09/16 0:00 82 422 10/01/16 0:00 82 436 01/11/16 0:00 82 556 01/12/16 0:00 3608 82 568 01/01/17 0:00 82 624 01/02/17 0:00 Any ideas on how to fix would be great
Select term_key,
month_actual,
month_date,
case mod (to_char (month_date, 'mm'), 6)
When 0 then sum (month_actual)
During)
term_key partition
order of month_date
between the previous month '5' interval and the current line
)
end '6 MONTHS in TOTAL'
from tbl
order of term_key,
month_date
/
TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
---------- ------------ --------- --------------
82 500 NOVEMBER 1ST, 15TH
82 450 1 DECEMBER 15 950
82 405 1 JANUARY 16
82 400 1 FEBRUARY 16
82 450 1ST MARCH 16
82 425 1ST APRIL 16
82 435 1 MAY 16
82 410 2525 1 JUNE 16
82 409 1 JULY 16
82 415 1ST AUGUST 16
82 420 16 - SEP - 01TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
---------- ------------ --------- --------------
82 422 1 OCTOBER 16
82-436 NOVEMBER 1, 16
82 556 2658 1 DECEMBER 16
82 568 1 JANUARY 17
82 624 1 FEBRUARY 1716 selected lines.
SQL >
SY.
-
even and odd numbers with level
Hi Master,
I tried to display numbers with level like that...
Select the level from dual connect by level < = 10;
1
2
3
4
5
6
7
8
9
10
How to display odd and even numbers with level. I tried with mod(level,0) but does not work very well.
Please notify.
Concerning
SA
Odd:
Select 2 * level - 1 from dual connect by level<>
/
2 * LEVEL 1
----------
1
3
5
7
9Still:
Select 2 * double connection by level<>
/
2 * LEVEL
----------
2
4
6
8
10SY.
-
resolution retina MacBook display and external
I have a MacBook to the retina 12 inches early 2015 with a multiport Apple USB - C card that has a HDMI connector. I am using a monitor Dell 27 ' u2713hm with a HDMI cable. However, the display preferences do not allow me to set the resolution. I have the choice between the default value for display (and this is 1080 px, even if the screen has a native resolution of 2560 x 1440) and update the scale that offers a resolution of 1080 or lower. How to use my monitor at its full resolution with HDMI connector I have on the multiport card?
Thanks for your help
Samuel
As far as I know, the U2713HM Dell only supports 1920x1080@60Hz via its HDMI port.
http://superuser.com/questions/606946/does-the-Dell-u2713h-support-2560-x-1440-o worm-hdmi - 60 fps
-
Firefox bookmarks bar does not allow me to drag-and - drop Web site icons. I went into the display and click on "bookmarks bar". bookmarks bar but her but its not allowing me to drag and drop the icon on the toolbar. I tried everything it is supposed to do, but his does not work. his frustration.
Stef. /. \
Make sure the toolbars like the toolbar 'Navigation' and the 'personal bar' are visible.
- View > toolbars
- Right click on empty toolbar space
Use the toolbar (Customize) to open the Customize and set the toolbar to display items.
- Make sure the "bookmarks toolbar items" are on the personal bar
- If "Bookmarks Toolbar items" is not on the bookmarks toolbar, then FRY it in the palette of the toolbar in the window the bookmarks toolbar Customize
- If the missing elements are in the toolbar palette then drag them from the window, customize the toolbar
- If you do not see an item on a toolbar in the toolbar palette and then click the button "Restore default" to restore the default toolbar configuration
- https://support.Mozilla.org/KB/how+to+customize+the+toolbar
- https://support.Mozilla.org/KB/back+and+forward+or+other+toolbar+items+are+missing
You can check the problems caused by a corrupt localstore.rdf file if the above didn't help.
-
Random HTTPS of image not displaying and be abandoned
This is a file that includes pictures posted on my site:
https://polishwords.com.pl/dev/testAbort2.php
They are provided by HTTP and they work well.
But in this file:
https://polishwords.com.pl/dev/testAbort.php
But I show the same images over HTTPS not HTTP and every time I refresh the page (CTRL + F5) one, at random, pictures is not displayed and in console network red poster with information: abandoned.
I've tried it in Chrome, Internet Explorer, and Opera, and everything is ok. Only in the latest Firefox.
I tried with deleted complete privacy, restarted several times updated FF, disabled addons, extensions disabled and it's the same thing. Another person who also has FF me reported the same situation.In my server log, it looks like this:
Bad load:
[22/Mar / 2013:23:29:11 + 0100] "GET /images/mukonczeniestudiow.jpg HTTP/1.1" 200 6705 "-" "Mozilla/5.0 (Windows NT 6.1;". (RV:19.0) gecko/20100101 Firefox/19.0 "
Good load:
[22/Mar / 2013:23:30:41 + 0100] "GET /images/mukonczeniestudiow.jpg HTTP/1.1" 200 6907 "https://polishwords.com.pl/dev/testAbort.php""Mozilla/5.0 (Windows NT 6.1; (RV:19.0) gecko/20100101 Firefox/19.0 "
What is the cause of this behavior?
Hi tomaszs, based on your journal, your Web server is receiving and responding to the request, but the small size of the response suggests that there is some sort of glitch. Can you spot any model it?
Unfortunately, I'm no expert on web servers and I find encrypted traffic very stimulating to see - using a debugging proxy can work around the problem that you are trying to diagnose by managing connections differently.
It is without doubt a documentation on when Firefox give up the demand for a particular item.
-
Whenever I start Firefox, my home page is displayed, and then another tab of a page I looked at in the past. I don't know how to do stop to load to the top of this additional page at startup and can't seem to find information on how to disable this junk page. Any suggestions? Thank you!!
Maybe you inadvertently set both pages to be your Homepage"(s)"?
-
Its keyboard functions normally everywhere outside of Firefox, including other browsers. In the Firefox browser, each keystroke releases only the numbers.
I'm glad that you have solved the problem after trying safe mode.
I note the software GuardedID does not seem to be designed to work with Firefox, at least on Windows Vista, by this faq, it is slow: http://www.guardedid.com/support_faq.aspx#EBCDA
And other FAQ, on the same web page, to mention going out of sync and producing numbers when you type.
No doubt the other thread you found was: numbers of types only Firefox instead of letters
I wonder if a better solution to prevent the strikes may have an including installed AV security suite.
-
I can't install aperture 2, I had an original cd and how numbers do
I can't install aperture 2, I had an original cd and how numbers do
What happens when you try?
-
Difference between display and iMac Thunderbolt
What is the difference between Thunderbolt display and iMac, in terms of display quality? It seems to be too expensive compared to the latter? Although the iMac 27 "is 5 k and Thunderbolt Display is just HD?
The standard iMac has the same resolution as the TBD. Only the retina iMac is sharper, but can be difficult to tell the difference on most of the images. You can get the exact specs on Apple's site.
-
My iMac cursor is stuck in the upper left corner of the login screen and I can't move it and now I can't use my iMac. What can I do? My iMac is a 27-inch 2014 release (one thin without retina display) and uses the keyboard and wireless mouse. It runs OSX Mountain Lion (not sure which version) and is a model 27 inches.
have you tried to change the batteries in the mouse?
-
Display and circuit damaged for my iphone6. Can it be fixed?
Display and circuit damaged for my iphone6 due in the fall. Can it be fixed?
Take in an Apple Store or authorized service provider. I will give you the possibility of an out of warranty replacement.
-
Satellite 1000-Z2: I need a driver for the display and the LAN
Hello
I reformatted my laptop S1000-Z2, and I have a real problem trying to find all the information about this model!
Basically, I need a driver for the display and the LAN?
Best regards
Austin.
What operating system do you use?
If you use XP, you will not find the network on the site recommended driver driver!
I can't give you advice where to find such driver because I don t know what the LAN card is installed in your oldie.But why you n t check yourself? Try to know what the LAN card you use and googel a bit for compatible applications ;)
-
I have an external display and close my macbook, and still be able to look at the screen and work. Currently when I close the screen closed macbook.
You must ensure that you have an external trackpad and a connected external mouse/trackpad.
https://support.Apple.com/en-us/HT201834
http://lmgtfy.com/?q=close+MacBook+lid+while+using+external+monitor
Maybe you are looking for
-
I used a master password for years. I also use Sync. Today, I wanted to watch one of my saved passwords. When I went to do this, I noticed that Firefox was no longer is configured to use a master password. I'm afraid I can have been hacked, or that s
-
in the following link, I'm using the option "Erase your device with the recovery mode", I got up to step 3. step 3 at first, he says "restore iphone" when I choose it appears with only the option of "restore and update, when I click on the update sta
-
Cannot install Driver Ethernet on my Equium A100-147
I'm trying to install my ethernet drivers and drivers that I got on the site, apart from not being able to access them on Sunday they do not work, windows does not pick up them and there seems to be no installation/configuration file? Please can some
-
When taking picture with the light in the background with the camera back from my iPhone more than 6 s, there is a clear blue colour square (a bit like a reflection of the light) will appear. someone has an idea of what's going on?
-
Battery Bluetooth and Nokia PC Suite V6
Hello I had a Satellite U300 with XP SP2, I try to connect my mobile nokia via Nokia PC Suite v7.0.8.2. He had no luck, my v6.1 Toshiba bluetooth stack According to Nokia, I need v5 Toshiba Bluetooth stack but I had no way to do it, in Toshiba web, o