Validation + form

import bb.cascades 1.2

Page {
    Container {
        id:rootContainer
        // Strips out non numeric characters allowing only 0-9 and '.'
        function numericOnly (textin) {

            var m_strOut = new String (textin);
            m_strOut = m_strOut.replace(/[^\d.]/g,'');

            return m_strOut;

        } // end numericOnly
        background: Color.Red

        layout: DockLayout {

        }
        topPadding: 100.0

        TextField {
            inputMode: TextFieldInputMode.Text
            autoFit: TextAutoFit.Default
            maximumLength: 5
            textStyle.textAlign: TextAlign.Center
            preferredWidth: 205.0
            horizontalAlignment: HorizontalAlignment.Center
            hintText: ""
            id:txtAmount
            onTextChanging: {
                txtAmount.text = rootContainer.numericOnly(text);
            }

        }
        Button {
            text: "Submit"
            onClicked: {

            }

        }

    }

}

How can I on click of submit call a function c ++?

How can I check if the text box is valid or not?

And how can I after submit call opened a new page?

If you want to call javascript, do it in qml (prior to doStuff or after)

If you want to post simple stuff, I would in qml/javascript. to complex things, you must use RPC

ibrahimovic12 wrote:

If the validation of evil, I have will pop up in my code c ++? a popup?

<-- i="" don't="" understand="" this?="">If the validation is incorrect, do what is appropriate

and the function is not recognized: you probably declared wrong. It must be a public Q_INVOKABLE can be counted in qml. Like this

applicationui. HPP

// Default empty project template
#ifndef ApplicationUI_HPP_
#define ApplicationUI_HPP_

#include 

namespace bb { namespace cascades { class Application; }}

/*!
 * @brief Application pane object
 *
 *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
 */
class ApplicationUI : public QObject
{
    Q_OBJECT
public:
    ApplicationUI(bb::cascades::Application *app);
    virtual ~ApplicationUI() {}

    Q_INVOKABLE
    void doStuff();
};

#endif /* ApplicationUI_HPP_ */

applicationui.cpp

//other stuff...

void ApplicationUI::doStuff()
{
   qDebug() << "function was called!";
}

Also, I recommend strongly that you read the documentation first

Tags: BlackBerry Developers

Similar Questions

  • Different between validation form

    What is the difference between the below statement form

    FORMS_DDL ('validation');

    commit;

    commit_form;

    In mathematical notation:

    FORMS_DDL ('VALIDATION') = database VALIDATION

    VALIDATION formulas = COMMIT_FORM = forms POST + database VALIDATION + base - Commit (forms trigger)

    Kind regards

    Zlatko

  • Validation form column against the value of another Table

    Hello

    I'm new to this forum, so please bear with me a bit!  I only have a small amount of writing PL/SQL experience, and I've never written Javascript or JQuery before.  I am an Oracle DBA and I coding experience C and PERL, so I have a strong technical background.  But I need some advice on the best way to approach a problem.

    I have an application of data base in Oracle Apex (version 4.2) with a tabular form on a table: Let's say that #1 with the conditions of licence 1 a, 1 b, and1C.  I have to make sure that the value entered in col B is not greater than the value of a column in another table (for example table #2 pass 2 (a).  From a conceptual point of view, the amount of money available is in the #2 table, and my tabular form lines are an act of spending money (such as orders or invoices), so I have to make sure that we spend more that we have.  Who is?

    Does anyone have tips for the best way to do it?  I'm figuring that the biggest problem here is perhaps to account for people who enter multiple lines in the form of tables at the same time, right?  So, if a person is entered 3/invoices, I need a total to ensure that they do not have spend more than we have in the #2 table.

    I really appreciate your help!

    Best regards

    Laurie Baublitz

    Ah, I was not totally with you on this charge then. My validation works overall, but it totals the amount for each line, regardless of the task. Okay - who was not totally my solution but more a demonstration of the technique that you can use to validate your tabular presentation in this way.

    You could solve this issue with a safe collection, or with a table plsql where you add an entry for each task name and keep the amount stored in there.

    Anyway, it would be better for you to spend a little time on playback on the plsql collections or collections apex!

    Remember, this is a sample and you will need to take stock of it. The best solutions are those where you need to experiment with 8)

    DECLARE
      TYPE tt_taskamount IS TABLE OF NUMBER INDEX BY VARCHAR2(20);
      t_taskamount tt_taskamount;
    
      l_task VARCHAR2(20);
      l_amount NUMBER;
      l_max NUMBER;
    BEGIN
      -- F02 is the taskname
      -- F03 is the amount
      -- adapt to your situation!
      FOR i IN 1..apex_application.g_f02.count
      LOOP
        l_task := apex_application.g_f02(i);
        l_amount := apex_application.g_f03(i);
        IF NOT t_taskamount.exists(l_task) THEN
          t_taskamount(l_task) := l_amount;
        ELSE
          t_taskamount(l_task) := t_taskamount(l_task) + l_amount;
        END IF;
    
        -- it's not the best idea to perform a select each time and could be
        -- done better but for the sake of the example it's fine
        -- not too bad either if the rowcount is small.
        SELECT maxamount
          INTO l_max
          FROM table2
         WHERE taskname = l_task;
    
        IF t_taskamount(l_task) > l_max THEN
          -- returning will stop further processing and throw an error message as soon as a budget has been overrun
          -- it might or might not be required behaviour but that's up to you
          RETURN 'The max amount ('||l_max||') for task ' || l_task ||' has been exceeded. Reduce the total amount on associated tasks!';
        END IF;
      END LOOP;
    END;
    
  • Problem of column 'Validation' form online

    Hi all

    11.1.2.1 running.

    I have a composite webform consisting of 3 individual forms. A mixture of percentage entered for 52 weeks (down lines) and 6 produced (in columns). I added a column formula after products that add up the percentages per week (must total 100%).

    I added validation to this column of formulas, to say that if the current cell value <>1 then watch cell in red.

    I have 5 weeks of met data, three of the verified cells show ok, two in the red, despite the fact that all the lines are estimated at 100%...

    I can't put my finger on what is the decomposition of is... data problem by rank, as follows (figures in %s)):

    50,5,2,1,15,27--OK
    12,17,30,25,5,11--GLOBULE RED
    8,20,40,18,6,8--GLOBULE RED
    10,30,10,30,10,10--OK
    5,5,5,5,4.9,75.1--OK

    I tried another set of figures in a problem like 10,10,10,10,10,50 and it verified fine lines. I tried replacing the lines by just in case of problem with the same data validation something funny was going on, but the question remains.

    Problem arises if see us form via Smart View or directly in the planning.

    Someone has an idea what is the problem? Did I miss something blatantly obvious or is - this a known issue? What is the characters in problem lines that are causing this - I don't see anything in common between the two.

    All advice appreciated.

    Thank you

    JB

    I've seen this before, and you do not have something "evil". This issue seems to be very similar to the floating point decimals errors we will see when we created these validations with JavaScript. (Google 'floating point decimal error' If you're having a really hard time, sleep...) A user can enter several values added up to 100, but the JavaScript interpreted the value as 100.00000000001.

    In any case, the solution is this - instead of create a validation that seeks 1, create looking for values higher than 0.99999 and 1.00001.

    Hope this helps,
    -Jake

  • Column manual non-null validation form

    Hi all

    I don't get the actual result with the code to validate the columns not null manual tabular form before submitting below. It retrieves the first row column only. I want to validate the columns in all rows.

    Can anyone please help and explain?

    begin
    for i in 1..apex_application.g_f03.count
    loop
    for j in 1..apex_application.g_f03.count
    loop
    if apex_application.g_f03(j) is null or i!=j
    then
    return 'Please Select a value';
    else
    return null;
    end if;
    end loop;
    end loop;
    end;
    

    Thank you

    Zourk

    Ourk

    Well go you twice the same table that seems weird.

    Then using return in the if statement you finish the operation of the service.

    If you want to collect all the lines for which the element is empty, see you the lines or the error message in a variable. And return the message only when all rows are processed.

    Something like

    declare
      v_message varchar2(2000);
    begin
      for j in 1..apex_application.g_f03.count
      loop
        if apex_application.g_f03(j) is null
        then
         v_message :=v_message||' Please select a value in row '||j ;
        end if;
      end loop;
      return v_message;
    end;
    

    Nicolette

  • Pending validation form sup

    Hello

    I have a form main user who allows to call another form of inserting data into a table, once the user has completed the work on this form of overtime, it will return to the main form.

    Is there a way for me to do the DML arrived on this form of sub only committed if the user hit the Save button on the main form?

    Thank you

    Not possible, due to the which command Commit?.

    Instead, keep the form sub data temporarily in session or state collectionsand treat it when the main form is saved.

  • Separate into sections for the validation form

    I have a form that is really two forms in one. Section of the Internet and a lower part. Each section has a send by email button that sends the PDF form to the Department and the next. I want the top half of the form and make sure all required them areas are met when is clicked on send by email button in the upper part. So I want the bottom section send by email button to check only the lower part before sending the form. Is it possible to break it down into two parts like that?

    Hello

    If each part of the form is in its own subform, you by targeting the subform that you want to validate. For example, e-mail insertsactuellement button would in the click event:

    if (topSection.execValidate() == true) {
         // send email script
    }
    else {
         // warn user script
    }
    

    Hope that helps,

    Niall

  • How to request for validation form, when a CRE is inserted when checked chkbox

    A card must be connected in box checked, deleted when it is disabled.
    I have the Insert/delete trigger WHEN_checkbox_changed statement. What happens perfectly.

    I want the form to request the user weither to save / don't save the changes...
    Please help me with this...

    Thank you
    Dembélé

    Dembele,

    To do this, set a global variable (Say 'True' value) when you insert / delete data, and in the KEY-RELEASE trigger, if the value of the global variable is defined, then ask if want to save the changes or not.

    Don't forget to set the value of the variable global ((dire la valeur 'False') WHEN-CREATE-RECORD and WE PEOPLE DETAILS of the main block triggers.)

    Kind regards

    Manu.

  • How to disable the AutoSubmit validation form.

    I use Jdeveloper 10.1.3.

    I have a list box with autosubmit set to true to generate a list for a second list box... I also have other input on the form fields that have the required property set to true.

    When I select an item in the drop-down list, it sends the entire form and stops on fields that are required. Is it possible that I can use this autosubmit without affecting the entire form?

    Hello

    Didier Laurent has provided a very nice solution on how to avoid this behavior.
    http://blogs.Oracle.com/Didier/2008/04/02/#A301

    -Juan Camilo

  • 2 valid forms of personal identification number

    I was wondering what IDS are used when sitting in review of VCP.

    It is common to bring the Passport?  Just watch the ID or they will have to save what ID you bring with you.

    I take the test tomorrow morning.

    Thank you and have a nice week,

    Anthony.

    The test center must register the ID you present. I don't know if one or two ID is required for VMware reviews, I usually present my license of passport and drivers. The test center will also have a photo of you, which is printed on the results of the review.

    André

    ... and good luck with the exam.

  • Tabular form validation

    Apex 4.2

    Problems with the validation of the form in a table and not sure what type of validation to use:

    My tabular presentation is based on a table SURVEY_JOB_TASKS:

    Survey_Job_Task_ID PK

    Percentage

    Task_Id FK

    Bundle_Id FK

    I also have a TASK table that contains all the tasks

    Task_Id

    TaskName

    In the validation form, the Survey_Job_task_Id is managed by a trigger. The percentage is an entrable field. The Task_Id is a selection list. The Bundle_Id is passed to the page; It is hidden.

    The Task_Id / select list is created with the following query

    Select task_name, task_id
    From TASKS
    
    

    I want a validation so that a user cannot enter the same task_id. If the selection list should look like:

    TaskName Task_Id

    Apples 1

    2 oranges

    Bananas 3

    Pears 4

    If a user accesses the page, enters an information line and select bananas in the selection list. The user saves / submits and leaves the page. The user returns to the page and they seek to enter another line, if they choose bananas once again, then validation strikes by saying that they cannot enter a double task identifier. There is an already established constriant in place which does not allow to do so. It gives an error ORA, but I wanted to make the error message a bit more friendly user.

    I tried some queries of variation of validation with type Exists or not exists but I may be missing it completely.

    Any help on this would be greatly appreciated. Thanks in advance

    plus extra extra extra... the logic should be a little different because otherwise it will always return false

    IF (( APEX_APPLICATION.G_F03(I) = APEX_APPLICATION.G_F03(j)) AND I<>J ) THEN
      RETURN false;
     end if;
    
  • AJAX Multiple form sent with attachments.

    Hi everyone and everyone

    I have a problem with a form when using ajax, that I can't seem to download the attachment.

    < b >

    < td > < label for 'FileAttachment' = > attach a file (250Mb limit) < / label > < br / >

    < input type = "file" name = "FileAttachment' id = 'FileAttachment' class ="cat_textbox"/ > < table >

    < /tr >

    Well that's not exactly true, but if I use the standard form of BC FormProcessV2 with ajax, this is no a upload of files.

    But if I put this small piece of code in the validation form ( If (theForm.FileAttachment) theForm.FileAttachment.value = theForm.FileAttachment.value ) then the files download correctly ONLY I get the redirect to a page with this:

    {'FormProcessV2Response': {'success': true, "entityId": "28589333", "objectTypeId": 'Business', 'objectId': '4686492', 'message': "< table class =------'tabledefault\' > < tr > < id = td------"title\"> < strong > summary of submitting a web form: < \/strong > < attention / > <!-IP address: 27.252.113.60--> < \/td > < \/tr > < tr > < id = td------'name\' > < strong > your name < \/strong > < attention / > Daniel Telfer < \/td > < \/tr > < tr > <"}} TD ID =------'email\' > < strong E-mail address > < \/strong > < attention / > < a href =------"mailto:[email protected]\" > dtug.co.nz < \/a > < \/td > < \/tr > < tr > < td = id-'casenumber\' > < case number > < \/strong > < attention / > 4682 < \/td > < \/tr > < tr > < td > < attachment > < \/strong > < attention / > .pdf (31.06 KB) < \/td > people... {{"Deleted... < \/tr > < \/table > < \/td > < \/tr > < tr > < td = id------"innerform_95487\"> < table class =------"tabledefault\"> < tr > < id = td------"CAT_Custom_293_957\"> < strong > upload your CV < \/strong > < br------/ > < \/td > < \/tr > < \/table > < \/td > < \/tr > < \/table >"}}

    I can also do that and ( If (theForm.FileAttachment) theForm.FileAttachment.value = theForm.CAT_Custom_264793_95487.value; ) I want to do but also gives the above error. Even if when I go on the case of the file are there.

    I need to do this because the customer wants to be able to click on these files and open them and simply expanding the field of CRM database gives a url component and the customer has problems with this when they want to show files (having to copy and the paste in the url especially when the url is incorrect because bc changes it in the CRM page without being in edit mode. PLEASE ADD THIS ADOBE! a FILE LINK is the same one the case of linked files.

    Extend CRM CV image.jpg

    I also want to do this because I want all the details of the client on the same page and thus need to use ajax to send two forms at the same time that works as long as I do not download a file, a way works, but I get an error and the other, that files don't no download and no mistake. ADOBE PLEASE USER DETAILS FORM WOULD BE GREAT FOR IE. name, username, password etc.

    I try to keep things as simple as possible for the customer and the customers. I'm so close but so far away.

    (1) is - anyone else know if ajax must submit the images automatically or there at - it a necessary addition code?

    (2) does anyone know why my validation code works, but gets an error in ProcessFormV2.aspx (unless it's a hack, I know this)?

    (3) I am going about this completely wrong and there is a better way.

    Any HELP! would be great?

    The code to ajax for a file transfer on is not supported in British Colombia.

    So you can send files to BC normally, you can ajax submit using JSON but that JSON will not process files.

  • Table background color forms valdiation notification field

    Hello

    normally when you use validation forms tabular for the APEX 4. If the validation is triggered then an error occurs and the corresponding field becomes a red background color. I got a costumer where this has not happened. Only the validation error occurred.

    Where can I configure the notification against a tabular form background color. Could not find anything in the models, the report attributes, the attributes of the element or elsewhere.

    Hope for help. My question. Determines the background color in the postings in a table?

    Best regards

    Tobias
    -------------------------------
    http://Apex-at-work.blogspot.com/

    Tobias,

    Create your own class css as follows:

      
    

    Key word is *! important *!

    Here is the explanation:
    http://webdesign.about.com/od/CSS/f/blcssfaqimportn.htm

    Best regards
    Marko

    Published by: Marko Goricki, February 11, 2011 11:12

    Published by: Marko Goricki, February 11, 2011 11:14

  • Interactive validation report error messages...

    Hi guys!

    I was looking for answer to this question for some time... is it possible to change the interactive report validation error messages?

    With respect,

    PsmakR

    Hello

    There are validations more than you think. Anthony Rayner has prepared a good summary in a blog post [url http://anthonyrayner.blogspot.com/2010/08/apex-40-enhancements-validating-form.html].
    You see in this post, where and how to disable the validations, but also, that you cannot disable all the. The only way to avoid all postings would be to implement yourself the report completely.
    The good news is, you can replace these messages. The following documentation tells you how to:
    http://download.Oracle.com/docs/CD/E17556_01/doc/user.40/e15517/global.htm#CHDEDHBJ

    -Udo

  • Remove the element-centric validation

    Greetings,

    Is there a way to remove element-centric validation (http://anthonyrayner.blogspot.com/2010/08/apex-40-enhancements-validating-form.html) of APEX 4.0, such as automatic validation of 'hidden' created by entering a certain mask format in a DatePicker element?

    The reason being that I already have a validation for this article, and it stops as some other validation to be executed if one breaks down. So, I don't have the automatic validation.

    Best regards
    Mathieu

    Hi Mathieu,

    What do you mean by "and it stops as some other validation to be executed if one does not? What is related to the automatic validation? Because I just had a quick glance in the code, all automatic and defined validations are manually triggered.

    You have different possibilities to stop the automatic validation for a shooting date picker.

    Set-) 'Perform validation' = 'No' in your submit button that will skip all the automatic, but make sure you set the indicator "always run" in your manual validation.
    Use the classic date picker that does not perform automatic validation of-)
    -) Create your own type of date picker plugin that does not perform automatic validation

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

Maybe you are looking for

  • Why the links on the homepage of Bing not work after updates of Firefox 17 to 18 Firefox?

    The hyperlinks on the Bing home page don't work. When I move the mouse over the links click on them; the links are neither highlighted nor when I click on the links they activate. I can refresh the page and quickly click on a link, but if I do not cl

  • Re: Internet browser does not have the full content of the page

    Hello Have a Satellite L300 laptop. Problems with opening the pages of website. I use Vista.When I try to open Internet pages pages explore does not bring to the high content full screen is full of information, but the content is not.Say yes they is

  • Power with Equium L10 problems

    Hello world When I insert the power cord into the laptop it does not load upward or indicator will quickly change from battery power provided by the plug. I bought another adapter and I still have the same problem. I wonder if it's something internal

  • Problem with my wireless card please help me!

    Hi all, I recently bought an Inspiron 3537 provided with ubuntu windows. I have install Windows 8.1 Pro with media center 64 bit for compatibility with my other program and I find almost all the drivers except the wireless. System model number: Inspi

  • Collections and exports

    I have asked about this and was not sure of the correct answer. He wants to have his pictures changed to book the creation, within a collection in Lightroom. Here's the workflow:Original JPG photos stored in the HD by file date.Collection is created.