Validation problem in table form

Hello
I have a tabular presentation that I created in the "Sample Application" apex.oracle.com. Table used DEMO_CUSTOMERS and I don't want to duplicate 'CUST_FIRST_NAME', based on the button SUBMIT. My problem is that I found a code that does not allow me to add duplicates of a particular field. But this code works only 4 of the 10 times in my application. Not sure why it is not consistent in my application. I would really appreciate if someone can take a look at this code and help me to change is consistent or perhaps take a look at the app thanks in advance.
BEGIN
  FOR i IN 1 .. apex_application.g_f03.COUNT-1 
  LOOP
      IF upper(apex_application.g_f03(i)) = 
            upper(apex_application.g_f03(apex_application.g_f03.COUNT)) 
      THEN
         RETURN 'Employee Name <b>' || apex_application.g_f03(apex_application.g_f03.COUNT) 
            || '</b> already exists.';

      END IF;
  END LOOP;
  RETURN NULL;
END;

Hi Charles,

OK - Here are the final validation code:

DECLARE
vCOUNT NUMBER;
vID NUMBER;
vNAME VARCHAR2(100);
vIDITEMS VARCHAR2(1000);
BEGIN
  vIDITEMS := ':' || APEX_UTIL.TABLE_TO_STRING(APEX_APPLICATION.G_F02) || ':';
  FOR i IN 1..APEX_APPLICATION.G_F02.COUNT
  LOOP
    vID := APEX_APPLICATION.G_F02(i);
    vNAME := APEX_APPLICATION.G_F03(i);
    FOR j IN 1..APEX_APPLICATION.G_F02.COUNT
    LOOP
      IF APEX_APPLICATION.G_F02(j) <> vID AND UPPER(APEX_APPLICATION.G_F03(j)) = UPPER(vNAME) THEN
        RETURN 'Employee Name <b>' || UPPER(vNAME)  || '</b> used more than once.';
      END IF;
    END LOOP;
    SELECT COUNT(*) INTO vCOUNT FROM DEMO_CUSTOMERS WHERE UPPER(CUST_FIRST_NAME) = UPPER(vNAME) AND vIDITEMS NOT LIKE '%:' || TRIM(TO_CHAR(CUSTOMER_ID)) || ':%';
    IF vCOUNT > 0 THEN
      RETURN 'Employee Name <b>' || UPPER(vNAME)  || '</b> already exists.';
    END IF;
  END LOOP;
  RETURN NULL;
END;

As we have, we must ensure that (A) control us the duplicates in the form of tables and (B) check duplicates against the records in the table appear not on the form of tables (excluding the records displayed allows the user to exchange names in the records of the table without falling foul of the validation check form). The above code will first get a list of the CUSTOMER_ID values on the form (in the Bay of f02). It then iterates through the collection of f02, make a note of the CUSTOMER_ID and CUST_FIRST_NAME (f03) values. He travels the collection once again in the first loop to check connections (note that we check the point where the inner loop is the same folder as the outer loop, as this would be in line with of course) - all matches across different row throws an error (it is a validation of PL/SQL that returns an error message and the error is just a returned string). Finally, always in the outer loop, it checks for all records on the table that has a CUSTOMER_ID value that is not included in the list but it has the same name - if a match is found, again an error message is returned. If there are no errors, NULL is returned that indicates at the Apex, that there is no validation error. This code can be unconditional because it must be run from SUBMIT buttons and add a line.

Just to clarify... My registration of the point P1 in a previous thread was because I assumed you were referring to an element on a previous page. "Previous page" in this context actually related to paging in the presentation table itself

Andy

Tags: Database

Similar Questions

  • Problem in table form

    Hi all

    For our customer, we want to create a tabular presentation for all the world to reserved for hours in our database.

    Looks like the shape of tables:
    Read activity I we Th his di ve
    1 3 8 1 5 example
    2 3 5 0 7 2 example

    A reserved time may be a different type of time.

    Now, we want to create a total row below the last row of availalable for each type of time. It should like this:
    Read activity I we Th his di ve
    1 3 8 1 5 3 example
    2 3 5 0 7 2 4 example

    1 1 3 8 1 5 3-total
    2 3 5 0 7 2 4-total

    The total line by default, in the form of tables, I can't use because I have to show several total lines.

    I also tried to create a new region with the totals. Then I have 2 problems.
    The first problem is the lay-out. I would like to show the totals exactly under the value of the day. When I use a default report (with standard report columns) so it is highly impossible to do (and if I try in Firefox and Internet Explorer, then it will not look the same). When I use text instead of columns fields report standard then the lay-out is perfect but then my table won't work any more (problem 2).

    It seems that if I create a new region with textfield (also if I disable them) that the name of the field (F01, F02 etc.) might be the same as the name of the textfields in tabular form. If you ever read where I can change this name.

    Does anyone have a solution for this problem?

    I am using Oracle 11 G with APEX version 4.1

    Thanks in advance!

    As stated in my previous post, use the APEX_ITEM. API TEXT such as described here http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_item.htm #CHDDCHAF.

    Do not forget that you are using p_idx a value greater than 12.

    Once you do this the standard AppyMRU will not process the f13 from. You will need to treat f13 from using your custom MRU, use you your MRU APEX_APPLICATION. G_F13 leave.

    FOR I IN 1..APEX_APPLICATION.G_F13.COUNT LOOP
     -- DO YOUR INSERTS/UPDATES HERE
    END LOOP;
    

    Kind regards

  • Problem of update in table form (after validation fails)

    Hello.

    I have a problem on the shape of tables using APEX 4.2.5.

    Application page has a table and a filter element to filter results in a table.

    The default value of this element is 0 (zero). This means that all the records are retrieved.

    SQL WHERE clause look like where deptno = decode(:P1_deptno,0,deptno,:P1_deptno)

    I created testcase: https://apex.oracle.com/pls/apex/f?p=4000

    W: nlzoh

    SUP: test01

    P: test

    The application name is A1.

    Everything works fine (insert and update), until there are validation error - due to an incorrect value in the column form.

    If I add by example in the second row (ename BLAKE) in the column WORK 1111 - so it would look like MANAGER1111 I get a validation error.

    Then I remove 1111 so validation would be ok, form insert 16 records (all). I is not updated that one record, it inserts all records.

    This allways happens after the validation error.


    When there is no validation error, changed row is updated as expected

    Insert also didn't happen, when there are value DEPTNO in filter.

    So the unexpected result is because of that where would adopt.


    So I have two questions.

    1. Why does it inserts all lines after the validation error? When there is no validation error, only the changed rows are updated - even if there is no DEPTNO in the filter.

    -Why modified column id drop apex?

    2. How can I change where clause, so iz will not work correctly.


    I hope it's understandable.


    Kind regards

    Dean


    Hello

    I created a new shape similar to your condition. His work with no problems.

    Please check Page 2 of application A1

    BR,

    Patrick

  • I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because that box "email".

    I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because the 'email' box keep rejecting their email address valid. And I just tried to remove the line in my form and it does not allow me to delete or to mark it as not necessary either.

    Currently, there is no way around the field email forms of the Muse. Another option is to have a look at Jotforms or another third-party provider of shape that Muse has widgets for.

  • How can I recover file in table form in a modal window with the id of the request.

    Dear all,

    I use Apex 4.2 worm.

    I've created classic report with 5 columns and add additional column with the name "ADD COMPONENT" link in classic report.

    I call in a table in a modal window, click on link add COMPONENT classic report. .

    Modal window is popup when I click on the link add COMPONENTS , but it does not have any record of respective "Reservation_id and Res_line_id" I have place in link add COMPONENT report Classic.

    How can I view respective folder of reservation_id and res_line_id in table form in the modal window.

    I create in my account. You can view using

    Workspace: APEX_ISSUE

    User:               [email protected]

    Password: kaushik1@34


    Application 71690 - questions

    Page not 13

    Tab: In the form of modal window.

    Thank you

    Hi Maxence,

    CORINE wrote:

    It is wounderfull but I use the Apex 4.2 worm. There is no dialogue option and page mode.

    So how can I do that in Apex 4.2 worm.

    Check this old similar thread that runs in 4.2 APEX where I explained step by step: How to extract the values inside the jquery element dialogue modal rigion

    Also check the options of the iframe for your application sholud be set to 'Allow' or ' Allow from same origin.

    Edit Application Properties-> security-> the browser-> Embed security Connectionwithsuchprocedures-> is set to 'Allow' or 'Allow same origin'

    Hope this helps you,

    Kind regards

    Jitendra

  • Problem in the form of Oracle Apex 4.2.5 manual insertion process

    Hello

    I am not able to insert data through tabular presentation. I created manual Insertion and query update, update data are happing but can't insert a data get error line 6' insert. I have the trigger on insert. Please help me to get the process of manual insertion in table form.

    Kind regards

    Harish Sharma

    Why no one is using the new processing system where you don't need the loop in the table and can use the normal syntax with regard to page elements, that references the columns as tabular

    : column

    For example:

    BEGIN

    INSERT INTO task_entries

    (NAME, env, demo

    )

    VALUES (: NAME,: env: demo)

    );

    END;

    Denes Kubicek

  • Problem with contact form

    I don't have the same experience in the Web design, but I create a using Adobe Muse. Everything works on the site expect Web contact form. If I use a gmail account I get the form but or my domain email I get nothing. I am in contact Godaddy for help but they don't know what to do...

    The domain is ensmarble.com. Can someone help on this topic?

    What should I do or how should I solve this problem?

    Thank you.

    Hi filiper79629728,

    There is an easy solution if you use GoDaddy's Web hosting.  Just a warning, this only works if you use GoDaddy Web hosting and forms of the Muse.  This isn't a problem with Muse for as long as it is a setting that needs to be adjusted on all that the host you are using.

    1. Place the shape in the Muse. Make sure to add the correct settings, that is, the e-mail address that will receive the forms.
    2. Next step is to navigate to your cPanel on GoDaddy.  This is where you manage your web hosting.
    3. On the main page of cPanel, scroll up to where it says ": Email".
    4. Click on "MX", which is located just below the 'accounts '.  This is the mail server setting.  By default, GoDaddy assume you are using a GoDaddy mail account.
    5. Make sure "Remote mail server" is checked on and that "Local mail server" is turned off.
    6. Your form should now be functional.

    The problem with the forms of the Muse and GoDaddy is that GoDaddy assumes that you will welcome your emails via GoDaddy.  If you have configured an e-mail address for your shape in the Muse that isn't an e-mail address hosted GoDaddy, GoDaddy and then do not accept by default. You must give permission to GoDaddy to send a form to what GoDaddy considers that an email "at a distance".

    I hope this works for anyone who has struggled with form when using of Muse forms that are hosted on GoDaddy servers.

    Thank you

    Ankush.

  • When we publish a Web site create in MUSE, the server must be linux? Please let me know because I have the problem with the form works... now the server that I use is the window...

    I am trying to publish in my domain on windows server, but I have a problem with the form...

    The server must be linux to work the form?

    Thanks in advance for your help...

    Thank you Brad... but how can I understand if a Linux server support? I try to do something in particular?

  • JHeadstart - how to configure the form to be modal window in the style of table-form available?

    JHeadstart release 11.1.2 Relase

    When you use the Application JHeadstart Editor, I chose "table-form" style of layout for the field.

    Issue. When the field editing either way, by clicking on the edit button, which will be the user to the form, is it possible to have the form opens in a modal window?  If Yes, where and how configure this option?

    Summary: currently, the flow is as follows: field displays in a table.  The user clicks on the button Edit and screen refreshes the field in a form.  What I want is to have the form to be displayed as a modal window with the table in the background.

    Thank you.


    I think you could do this with 2 different versions of the JHS group.  A configured as 'table' and set up the other as a 'form '.  Then, add a groupLink item in the table to open the form in a modal popup.  (you might even be able to link the group to itself, but then you will need to do some adaptations to prevent it to generate the default table-form link)

  • Insert a file .swf by Dreamweaver validation problem

    Insert a file .swf by Dreamweaver validation problem.  I tried this code for html5, but I can't make it work for firefox.

    < object data = "path_to_file/file.swf" type = "application/x-shockwave-flash" width = "insert_width_of_movie" height = "insert_height_of_movie" > "

    < param name = "movie" value = "path_to_file/file.swf" >

    < param name = "SomeOtherParam" value = "ParamValue" >

    < / object >

    Try:

    <>

    Type = "application/x-shockwave-flash" data = "images/homewebpageflash.swf"

    width = "500" height = "375" >

  • Refresh table-form query on table only for pages in .jsff

    I have a group being generated as a presentation of table form. I would like for the page of the table to always refresh, and submit the form to refresh page after.
    I saw a thread about how to do this on a .jspx page: Refresh table-form query on table only

    Unfortunately, this does not work for me because I use the .jsff pages and they do not have access to the facesContext. Does anyone know how to do this for a .jsff page?

    Thank you
    Michelle

    Michelle,

    The taskflow 11 ADF in the equivalent of the region of this expression would be

    #{jhsPageChanged and controllerContext.currentViewPort.viewId=='/MyGroupTaskFlow/MyGroupTable'}

    Unfortunately, this currently does not work because there is an error in the JhsNavigationHandlerImpl class we're going to fix in the next release.
    You can apply a work around by creating a subclass of JhsNavigationHandler and replace as follows:

    ' public Sub handleNavigation (FacesContext facesContext, string action,
    The string result)
    {
    String oldPageFragmentId = ControllerContext.getInstance () .getCurrentViewPort () .getViewId ();
    super.handleNavigation (facesContext, action, result);
    String newPageFragmentId = ControllerContext.getInstance () .getCurrentViewPort () .getViewId ();
    If (! oldPageFragmentId.equals (newPageFragmentId))
    {
    JsfUtils.storeOnRequest (JHS_PAGE_CHANGED, Boolean.TRUE);
    }
    }

    To use your subclass, create a custom template for the facesConfig.vm and modify the navigation Manager to use your subclass.

    Steven Davelaar,
    JHeadstart team.

  • ScrollBar in table form

    Is it possible to put the region in a table for a height/width set with a vertical scroll bar, allowing users to scroll the rows if several lines appear that what is permitted for the height?

    If this is not possible, is it possible to have a region move with the page? For example, I have 2 regions on the page (display in 2 columns). A region is an updated report which shows 25 rows of data in a spreadsheet pre-filled the other region is a region which list availability that users can use to help determine the data for information entry in region 1. The tabular presentation requires scrolling to display all records if then the user loses sight of the valuable information contained in region 2.

    Any help would be appreciated.

    Thank you!

    Hello

    Very quick and dirty will be added to your presentation tabular region header somethinglike

    and at the foot of the region

adjust the style width and height to your needs

But as table form is the same as classic report, you can use the method for example from this post
Scroll to report but I want the column headings to stay where they are

And if you look in the forum there is same more friendly messages

BR, JAri

Published by: jarola November 4, 2009 01:02

  • The two problems with sub form of table, associated with check boxes

    Hi all -
    Jari already helped me thereby once last week, but I'm running into some new questions.

    http://Apex.Oracle.com/i/index.html
    workspace: Leppard
    username: Guest
    PW: app_1000
    Application: MyTestApp

    Maybe I need to split these into two questions, if so just let me know.

    Question 1: On the first tab (tab 1 report) I have a simple tabular presentation based on the EMP table. The column of the box on the far right, when checked restores the Ename column readonly. The problem is that it only works one way. Unchecking the checkbox is not cancel the read-only.

    It is javascript code that I have on the page:
    function test(pThis) {
     //get the current row index on change
     var currIndex = $('input[name="'+pThis.name+'"]').index(pThis);
    
     // check current items value (return value of lov)
     if (pThis.value=='Y') {
      $('input[name="f02"]')[currIndex].style.backgroundColor = "LightGrey";
      $('input[name="f02"]')[currIndex].readOnly=true;
    }
    else if (pThis.value=='N') {
      $('input[name="f02"]')[currIndex].style.backgroundColor = "Red";
      $('input[name="f02"]')[currIndex].readOnly=false;
    }
    }
    The attribute of the element on the checkbox column is
    onClick="javascript:test(this);" 
    (It seems to work although I use onClick or onChange so I don't know if that makes a difference).

    But the main problem is that the code does not recognize the value of "n" in the column. I checked with firebug and columns I have untick are definitely on 'n', but I can't get javascript code to recognize this value. Even if I take the "ElseIf" code and just change the first part to (pThis.value ==' no) still does not work. There seems to be something with the value "n" recognize themselves do not, but I can not understand.

    Question 2: on the second tab - tab report 2. The same report but this time, I use a javascript character counter similar to that described in the sample application of the Dene (page 276 > http://apex.oracle.com/pls/otn/f?p=31517:276:19207673535900:NO). The counter of characters on the Ename field include javascript and an expression of HTML on the Ename column. The counter works fine, but now, the javascript code to make the column readonly work over all.

    Any ideas on these are much appreciated!

    Thanks in advance,
    John


    • Please please understand what HTML is generated and how to inspect. Once you do this, you can easily eliminate many problems with selectors not seeming to work. A text box is not an input for example element.
    • Boxes rely on the checked, not the value property. Apex circumvents this by creating a hidden extra element which will get the value based on the checked property of the visible checkbox
    • Do not use these horrible onchange and onclick attributes :( Use a dynamic action or jQuery to bind events.
    • Do not apply a style via javascript. Use CSS for this drive as with jQuery, you can easily add, remove, or toggle the classes too. And if you know jQuery selectors, you can understand css selectors because they are substantially the same.
    • I don't know why people insist on using rowIndex or substringing ID. I find it unnecessary and more complex that the alternative (crosses with jQuery)
    • The difficulty also in things into action through pagination. Running on just the visible page it of a trifle, but through paging requires more work than just check "fire on loading the page" is not enough. I'm sure you'd want your ENAME either red or gray column and readonly as soon as the page is loaded, and not when you start typing in the box...

    Form 1 tab: copied to Page 12 and made my changes here:_


    • OnChange on ENAME. This removed. No idea why you would need it there seems a crutch for not having the field in the desired state when the page is loaded.
    • OnClick on CHECKBOX. Removed what I hate these attributes. Replaced by a dynamic action.
    • Dynamic action "checkbox: ENAME readonly value."

      • Event: After refresh
      • Selection type: region
      • Region: Form of tab 1
      • No condition
      • Scope of the event: static
      • Real Action

        • Run the JavaScript Code
        • Fire on loading the Page: YES
        • Code:

          //at page load and after each region refresh:
          //each: check all checkboxes and set readonly on ename accordingly
          //click: when the checkbox changes, change ename accordingly
          $("td[headers='CHECKBOX'] input[type='checkbox']:visible")
          .each(function(){checkReadonly(this);})
          .click(function(){checkReadonly(this);});
          



  • Page > function and global variables declaration

    function checkReadonly(pCheck){
       var lCheck = $(pCheck);
       lCheck.closest("tr")
       .find("td[headers='ENAME'] input:visible").each(function(){
          $(this).prop("readonly", lCheck.prop("checked"));
       });
    };
    

  • Page > CSS Inline

    td[headers='ENAME'] input{
    background-color: red;
    }
    td[headers='ENAME'] input[readonly]{
    background-color: lightgrey;
    }
    

    CSS works so much better for this than the application of style through js...

  • Form 2 tab: copied to Page 13 and made my changes here:_


    • OnChange on ENAME. This removed. No idea why you would need this.
    • OnClick on CHECKBOX. Removed what I hate these attributes. Replaced by a dynamic action.
    • Dynamic action: identical to page 12, just modified trigger area
    • Changed input to TEXTAREA when it is required:
    • Page > function and global variables declaration

      function checkReadonly(pCheck){
         var lCheck = $(pCheck);
         lCheck.closest("tr")
         .find("td[headers='ENAME'] textarea:visible").each(function(){
            $(this).prop("readonly", lCheck.prop("checked"));
         });
      };
      

    • Page > CSS Inline

      td[headers='ENAME'] textarea{
      background-color: red;
      }
      td[headers='ENAME'] textarea[readonly]{
      background-color: lightgrey;
      }
      

    • The f_set_counter function, I changed a bit: there are 2 straps too, put a semicolon at the end of each line.
      -Change $x (node) .value $s (node, value) and $v (node)
      -changed $x (node) .innerHTML to $(node) .text)
      I know: it worked. I like this better. OCD? :/

    function f_set_counter(pThis,pLength,pMaxLength,pReset)
    {
       if (pLength>pMaxLength){
          alert('The maximum length of '+pMaxLength+' exceeded.');
          $s(pReset, $v(pReset).substring(0,pMaxLength));
          $("#"+pThis).text(pMaxLength);
       }else{
          $("#"+pThis).text(pLength);
       };
    };
    

    Published by: Tom on February 15, 2013 12:48
    Made a mistake in the case of dynamic action :->, click after refresh!

  • Form validation problem

    I cannot using the form validate of Dreamweaver and the Yaromat check form. Here's what's happening.

    With the form validation of Dreamweaver, I pointed out the form tag, go to the Insert menu and select validate the form. He brings to the top of the box, but there is no way to save the selections and options. If it is supposed to be a save button, it isn't here.

    When I try the Yaromat extension, when I go to save my selections, I get an error message that says:
    "This change should change the code which is locked by a model or a translator. The changes will be rejected. »

    I do not use a template, then nothing should be locked.

    Any ideas?

    Thank you
    Miriam

    I think I solved this problem. It seems that after the upgrade to version 8.0.2, on a page that will have a form that requires validation, you cannot use SSI calls (in php).

    So I replaced all SSI calls with the actual data, just for this page. The form then properly validated using the extension Yaromat check form.

    Built in form to validate Dreamweaver does not always show a way to save the settings, so I don't know if this would work also.

  • problem in the form of master-detail when you use the ADF table for detail

    Hello

    jdev version - 11.1.2.1.0


    I create master shape detail using datacontrol drag as ADF master shape secondary Table.


    Now when I create a new line in the detail table using the key CreateInsert a new empty row created on top of the secondary table.

    and other show line that the previous record data based on the master.

    problem is I want to when I click on the createInsert button all the line of the secondary table must be empty and what line to fill two or three user then validate.



    Thanks in advance

    Hello

    If a secondary table has data, then createInsert adds to them. If you want to hide the existing lines, create a new instance of the View object and set the option "extract database" to "No. Rows. Use an af:switcher to change the specified table when the user clicks the createInsert button. There is some coding needed to have this use case in the ADF, but its essentially declarative. Bottom line, is that there is no option automated other than to create new lines in a separate page or dialog box if you are bothered by existing lines

    Frank

  • Maybe you are looking for