Primary key issue with adf Entry Form.

Hi All,
i'm using jdev version 11.1.1.5.0
use case: i have create simple entry form based on Eo and Vo using database table like student(enrollment no,name address)
where enrollment no is primary key.
so when i have create a record i have set enrollment no in entity impl class of this eo create method using some logic based on my need like(20130001)
for that i have read highest no from database field and assign to enrollment no field when user create record.
so when user create record second time then enrollment no is 20130002. and other detail like name and address user fill and commit record. and it is fine.
but problem is that when two user access same form at a time and create record so both have get same primary key like 20130003 because in current time in database maximum value is 20130002.
so which user  commit record first it record will save on database and second user get error message because of primary key violation.
so my question is that where we generate primary key value for record so when multiple user access form have get different primary key value. and in my use case i can't use sequence and any autoincrement no
because i have patter for primary key.
Thanks in Advance
Manish

Hi,
Dimitar and Frank
thank for reply.
How can i apply non-concurrent DB lock can you please explain.(because lock method on entity impl not work when user create new row as per documentation)
http://docs.oracle.com/cd/B14099_19/web.1012/b14022/oracle/jbo/server/EntityImpl.html#lock__
i have write following line of code in entity impl class to set primary key value(reqid)-
    @Override
    protected void prepareForDML(int i, TransactionEvent transactionEvent) {
         super.prepareForDML(i, transactionEvent);
        this.setReqid(genReqid());
    public String genReqid() {
        String reqby = this.getReqby();
        String qry =
            "SELECT nvl(MAX(TO_NUMBER(SUBSTR(REQID,7))),0)+1  FROM STM_REQHDR WHERE REQBY=? AND REQTYPE<>'M' and substr(reqid,1,2)<>'MT' AND SUBSTR(REQID,1,3)<>'PAY'";
        PreparedStatement ps = null;
        String no = "";
        try {
            ps = getDBTransaction().createPreparedStatement(qry, 0);
            ps.setString(1, reqby);
            ResultSet rs = ps.executeQuery();
            if (rs.next()) {
                no = rs.getString(1);
            ps.close();
        } catch (Exception e) {
            System.out.println("Exception in Gen req id ==>" + e);
        String reqno = reqby + String.format("%6s", no).replace(' ', '0');
        return reqno;
but when i run form in debug mode and two user commit concurrent manner only one time code block is executed who first commit. and second user got error message.
thanks
Manish

Similar Messages

  • Primary Key Issue With Creating Tables

    Hi,
    I have the following scripts to create my two tables in oracle 10g, i was wondering wether or not i had correctly set up my primary key or if there is a better way of doing it than the way i have.
    Here are my two scripts for my tables:
    CREATE TABLE CUSTOMER (
    fname varchar2(15) NOT NULL,
    lname varchar2(20) NOT NULL,
    age varchar2(3) NOT NULL,
    custAreaCode number(5) NOT NULL,
    custNumber number(6) NOT NULL,
    constraint cust_pk PRIMARY KEY (custAreaCode),
    constraint cust_pk2 PRIMARY KEY (custNumber),
    constraint age_chk CHECK (age >=18 AND age <150)
    CREATE TABLE PHONECALL (
    startDateTime smalldatetime NOT NULL,
    custAreaCode number(5) NOT NULL, ---Reference PK From Customer Table
    custNumber number(6) NOT NULL, ---Reference PK From Customer Table
    dialledAreaCode number(5) NOT NULL,
    dialledNumber number(6) NOT NULL,
    crgPerMinute number number (3,1) NOT NULL,
    endDateTime smalldatetime NOT NULL));
    I am not sure if i have referenced the primary keys correctly in the PHONECALL table.
    Thanks in advance :)

    Hi,
    You want like this below ? I think that smalltime data type is not a valid type. Other thing, this is not a rule, but I advice you to put the primary key columns as the first columns of your table. One question: There is no PK on the phonecall table ?
    SGMS@ORACLE10> create table customer (
      2  custareacode number(5) not null,
      3  custnumber number(6) not null,
      4  fname varchar2(15) not null,
      5  lname varchar2(20) not null,
      6  age varchar2(3) not null,
      7  constraint cust_pk primary key (custareacode),
      8  constraint cust_uk unique (custnumber),
      9  constraint age_chk check (age >=18 and age <150)
    10  );
    Table created.
    SGMS@ORACLE10> create table phonecall (
      2  custareacode number(5) not null constraint fk_phone_cusarecode_customer references customer,
      3  custnumber number(6) not null constraint fk_phone_custnumber_customer references customer,
      4  startdatetime date not null,
      5  dialledareacode number(5) not null,
      6  diallednumber number(6) not null,
      7  crgperminute number (3,1) not null,
      8  enddatetime date not null);
    Table created.
    SGMS@ORACLE10> select table_name,constraint_name,constraint_type from user_constraints
    2 where table_name in ('CUSTOMER','PHONECALL') and constraint_type in ('P','U','R');
    TABLE_NAME                     CONSTRAINT_NAME                C
    CUSTOMER                       CUST_PK                        P
    CUSTOMER                       CUST_UK                        U
    PHONECALL                      FK_PHONE_CUSARECODE_CUSTOMER   R
    PHONECALL                      FK_PHONE_CUSTNUMBER_CUSTOMER   RCheers

  • How to impliment a auto increamenting  primary key feature in ADF ??

    How to implement an auto incrementing primary key feature in ADF ( With out using database Triggers)
    Edited by: Dinil Mithra on Apr 24, 2009 2:28 AM
    Edited by: Dinil Mithra on Apr 24, 2009 2:59 AM

    Dinil,
    Create a sequence in the database.
    Read section 4.11.5 of the Fusion Developer's Guide - which has sample code to get the next sequence value from Java without a database trigger.
    John

  • Issue with filling out form fields in Safari?

    Hello,
    Has anyone noticed any issues with filling out form fields (specifically text boxes) in Safari 6.0.2 on Mac OS 10.8.2?  When I attempt to test forms I've created, there is a delay when typing values into text boxes.  Other types of input controls (check boxes, drop down lists, etc.) appear to work fine.  As far as I can tell, this only occurs with Safari 6.0.2 in Mac OS 10.8.2.  Prior versions of Safari do not have this issue, nor does Firefox in the same OS environment.  When I refresh the form, the delay is not as noticeable.  I'm searching the WebKit bug reports as well, but nothing seems to point to this issue.  Any hints would be greatly appreciated.

    From the menu bar, select
    Edit ▹ Substitutions
    and uncheck Text Replacement.

  • ADF BC Primary key generation with SQL Server DB

    Hi,
    I am using ADF 11.1.1.6 to develop a small application that will do some very basic CRUD operations on a SQL Server DB.
    I read through http://www.oracle.com/technetwork/developer-tools/jdev/multidatabaseapp-085183.html before I'm starting to implement the Entity objects.
    This document describes a way to do primary key generation using a table created in the DB and instructs to create an application connection to the Database :
    +2. Create a Connection to the Table+
    In your application, create a database connection named ROWIDAM_DB that points to the database containing your S_ROW_ID table. Alternatively, edit your BC project's properties and add the following Java option to the project's run configuration:
    -Djbo.rowid_am_conn_name= appconnection
    where appconnection is the name of a database connection that points to the S_ROW_ID table.
    My question is how do we do this when we mve to a production environment ?
    Also I'll be interested to hear if anyone has any pointers for developing ADF apps with SQL Server. (gotchas, performance pitfalls etc. )
    -Jeevan
    Upadte : This is SQL Server 2005
    Edited by: Jeevan Joseph on May 2, 2012 9:04 AM

    my apologies to everyone ... This should have been very simple. I just need to provide the config in my AM configuration(bc4j.xml)
    jbo.rowid_am_conn_name* should be set to the connection name you create. For production deployments, theres a similar
    jbo.rowid_am_datasource_name* that should work just fine (though I havent tried if it has any hiccups).
    I'd like to point out one thing though, for whoever might stumble upon this thread and find it useful later on...
    After I did the steps above, everything seemed to work when I tested the app from the AM tester. But when I built a UI for it in ADF Faces, I started getting an exception on Create/CreateInsert :
    java.lang.ClassCastException: com.microsoft.sqlserver.jdbc.SQLServerConnection cannot be cast to oracle.jdbc.OracleConnection
         at oracle.jbo.server.OracleSQLBuilderImpl.setSessionTimeZone(OracleSQLBuilderImpl.java:5533)
         at oracle.jbo.server.DBTransactionImpl.refreshConnectionMetadata(DBTransactionImpl.java:5311)
         at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1194)
         at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6826)
         at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:136)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:213)The trouble is that the ADF Faces adf-config.xml overrides the AM configuration. Oracle is the default, and it overrides the SQL flavor I set when initializing the Model project.
    This was not mentioned in the original document probably because ADF faces was out of scope for that document.
    I also found this thread extremely useful, and its what reminded me of the ADF Faces AM config overrides : Re: Locking mode 'optupdate' with SQL92
    Cheers !
    Jeevan

  • How to commit primary key in a multi level form

    Hi ,
    I am using Jdeveloper 10.1.2.3. ADF - Struts jsp application.
    I have an application that has multiple levels before it finally commits, say:
    Level 1 - enter name , address, etc details -- Master Table Employee
    Level 2 - Add Education details -- Detail Table Education
    Level 3 - Experience -- Detail Table Experience.
    Level 4 - adding a Approver -- Detail Table ApplicationApproval
    In all this from Level 1 I generate a document number which is the primary key that links all these tables.
    Now if User A starts Level 1 and moves to level 2,he gets document no = 100 and then User B starts Level 1 and also gets document no = 100 because no commit is executed.
    Now I have noticed that system crashes if User B calls a vo.validate().
    How can I handle this case as Doc no is the only primary key.

    Hi,
    This is what my department has been doing even before I joined and its been working for our multi user environment for these many years.
    We have a table called DOC_SRNO which will hold a row for our start docno , next number in running sequence. the final number. We have this procedure that returns next num to calling application and increments the next num by 1 in the table. and final commit on the application commits all this.
    I am not sure how this was working so far but each of those applications were for different employees. I am assuming this is how it worked.
    Now in the application that I am working on, has no distinct value. So two users could generate the same docno and proceed.
    I will try the DB sequence but here is what I tried. I call the next num from DOC_SRNO and I commit this table update and then proceed with this docno so at a time both gets different docno's.
    But my running session crashes when I go to next level to insert into the detail table of my multi level form. Here when I try to get the current row from the vo which is in context, it crashes.
    Here's the steps.
    Three tables : voMainTable1 and voDetailTable1 and voDetailTable2.
    voMainTable1 on create row1- I generate new docno - post changes
    voMainTable1 on create row2- I genrate another docno - post changes
    set voMainTable1 in context
    Now I call voDetailTable1 and to get the docno to join master detail, I try to get voMainTable1.getCurrentRow. Here it crashes.
    How can I avoid this

  • Flex Table Add Row Issue with Dynamic Entry Lists in Visual Composer

    All,
    Your help would be kindly appreciated in resolving an 'Add Row'-issue within a Flex Table that uses Dynamic Entry Lists in Visual Composer. The issue here is as follows :
    When I use a [Local Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=O5hrG2aMxWZ84Mu1211193041]to populate a row field, the initial row and all next rows are emptied upon 'insert row', they loose their selected values and also the entry list values ('pull-down menus') are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
    The initial row does [show the entry list values |http://www.postyourimage.com/view_image.php?img_id=2HybmEHAuQYs9cg1211192766]from the Local Dynamic Entry List based on the dynamically assigned input value; upon 'insert row' the entry lists are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
    When using a [Global Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=m5p2KYuBb442dTq1211193501]to populate the row fields the Flex-table behaves normally as expected. Unfortunately with a Global Entry List it is not possible to dynamically assign a input value. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=U96V0zENCCyO3gA1211193157].
    Please also see the [issue summary image|http://www.postyourimage.com/view_image.php?img_id=06xti08tIEfely1211195178] I made to visualize the issue.  What I basically would like to know is whether this is a 'known issue' or not, or that it is an issue that can be fixed or whether there is an alternative workaround available ... I'm using Visual Composer 7.0 and the Portal is at SP 13.
    Many thanks,
    Freek

    Hi,
    you should be able to assign a dynamic value with global entry lists as well. If you say @myParam as dynamic value. VC will indicate in red letters, that the field @myParam is unknown. However, it will work, as long as @myParam is known in the form or table where you use the entry list.
    I have never heard of the problem that entry lists are emptied after "insert"-event.
    Kindes Regards,
    Benni

  • How do I obtain the next number for a Primary Key using an ADF View Object?

    I have two separate View Objects (A & B) for the same Entity Object. View Object A does a SELECT on all of the fields in the table. This View Object is where I execute my adds and updates. View Object B is only used to retrieve the next number for the primary key. This is done so that when I add a row to the database, I always get the max number of the primary key and add one to it. I accomplished this by setting the SQL mode to Expert and using the SQL: "SELECT MAX(NBR) AS MAX_NUMBER FROM TABLE_1". This may be overkill having a seperate View Object for this, but so far this is the only way I have found to obtain the next number. However, I have discovered that this way does not always work.
    The problem I'm running into is when I try to add multiple records to View Object A without committing the transaction between each add. Because View Object B is disconnected from View Object A, the MAX_NUMBER of View Object B comes back with the same number for each add I do on View Object A. So I know I must retrieve the MAX_NUMBER from View Object A.
    I've tried using the following code in my Table1ViewImpl class:
    this.setQuery("SELECT MAX(Table1.NBR) AS MAX_NUMBER FROM TABLE_1 Table1");
    this.executeQuery();
    The view object now has what I want, but I have yet to figure a way to extract the MAX_NUMBER out of the View Object. I've also looked into using the method addDynamicAttribute() but I can't figure out any way to set the attribute with the MAX_NUMBER.
    I can't be the only one trying to retrieve the next number from a database table using ADF. Can anyone help me with this? FYI - I'm using JDev 10.1.3 EA.

    You missing the point.
    On a multi-user db knowing the next highest number doesn't guarantee the number will be available when it comes time to commit the record. You can prove this to yourself by opening two instances of your app and do whatever you do to add a new record to your VO. Both will assume the same number, and when you commit an error will be generated
    You must use sequences to avoid the possibility of duplicate keys. If you are trying to avoid gaps in your numbering then you need to convince yourself why this is necessary.

  • Issue with Variable Entry in BI 7.0

    Hi,
    I am having an issue with the variable entry in BI 7.0 Version. Here is a brief background.
    --- In BW 3.x, when we define a variable with <b>Single Value Option</b>, you can enter the value manually in the pop-up selection screen or select from the dropdown of possible values.
    ---But in 7.0 when i try to enter the value manually in the selection screen its opening the dropdown list, and is not giving me the option to enter a value manually. I am entering a valid single value in selection.
    Is this a bug or do i have to make any specific settings to correct my issue?

    When the selection screen pops up choose the KEY only function on the TOOLS on the top right corner of the screen. Then you will be able to enter the values manually.
    Hope this helps.

  • Flex Table Add Row Issue with Dynamic Entry Lists

    All,
    Your help would be kindly appreciated in resolving an 'Add Row'-issue within a Flex Table that uses Dynamic Entry Lists in Visual Composer. The issue here is as follows :
    When I use a [Local Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=O5hrG2aMxWZ84Mu1211193041]to populate a row field, the initial row and all next rows are emptied upon 'insert row', they loose their selected values and also the entry list values ('pull-down menus') are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
    The initial row does [show the entry list values |http://www.postyourimage.com/view_image.php?img_id=2HybmEHAuQYs9cg1211192766]from the Local Dynamic Entry List based on the dynamically assigned input value; upon 'insert row' the entry lists are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
    When using a [Global Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=m5p2KYuBb442dTq1211193501]to populate the row fields the Flex-table behaves normally as expected. Unfortunately with a Global Entry List it is not possible to dynamically assign a input value. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=U96V0zENCCyO3gA1211193157].
    Please also see the [issue summary image|http://www.postyourimage.com/view_image.php?img_id=06xti08tIEfely1211195178] I made to visualize the issue.  What I basically would like to know is whether this is a 'known issue' or not, or that it is an issue that can be fixed or whether there is an alternative workaround available ... I'm using Visual Composer 7.0 and the Portal is at SP 13.
    Many thanks,
    Freek

    Hi,
    you should be able to assign a dynamic value with global entry lists as well. If you say @myParam as dynamic value. VC will indicate in red letters, that the field @myParam is unknown. However, it will work, as long as @myParam is known in the form or table where you use the entry list.
    I have never heard of the problem that entry lists are emptied after "insert"-event.
    Kindes Regards,
    Benni

  • Issue with adf projectGantt showing popus

    hi all
    am working with adf projectGantt using page template every thing goes perfectly but when I want to see task properties for example or modify the time axis reliated popus never appear (when i dont use templates every thing gonna be alright :s)
    i'll be very thankful if any one could help
    this is my gantt.jspx with template
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <!--h:inputHidden value="#{typeBean.init}"/-->
    <f:view>
    <af:document title="Project Gantt"
    binding="#{templateBindings.documentComponent}" theme="medium"
    id="d">
    <af:form id="form">
    <af:pageTemplate id="gant" viewId="/tagDemoTemplate.jspx">
    <!-- Document Title -->
    <f:attribute name="documentTitle" value="Project Gantt"/>
    <!-- Tag Name -->
    <f:facet name="first1">
    <af:image source="/images/d.png"
    inlineStyle="width:1400px;heigth:150px"/>
    <!--f:subview id="enteteTache">
    <jsp:include page="/entete.jspx"/>
    </f:subview-->
    </f:facet>
    <f:facet name="auxiliaryGlobal">
    <f:subview id="menuTache">
    <jsp:include page="/MenuProjet.jspx"/>
    </f:subview>
    </f:facet>
    <f:facet name="top1">
    <af:navigationPane id="nav1" hint="tabs">
    <af:commandNavigationItem id="tagGuideTab" text="Projet Assigné"
    shortDesc="Description détaillée du projet, diagramme de gantt, tâches, etc."
    selected="true"
    actionListener="#{navigationBean.navigationItemAction}"
    action="assigne"/>
    <af:commandNavigationItem id="componentSkinningTab"
    text="Resources Consommées"
    shortDesc="Utilisation des ressources utilisées"
    selected="false"
    actionListener="#{navigationBean.navigationItemAction}"
    action="consommation"/>
    <af:commandNavigationItem id="ressTab"
    text="Resources Prévisionnelles"
    shortDesc="Utilisation des ressources prévisionnelles"
    selected="false"
    actionListener="#{navigationBean.navigationItemAction}"
    action="prevision"/>
    <af:commandNavigationItem id="fileExplorerTab" text="Aide"
    shortDesc="Aide et description du projet"
    selected="false" action="fileExplorer"/>
    </af:navigationPane>
    </f:facet>
    <f:facet name="center">
    <af:panelGroupLayout layout="scroll" id="pg1">
    <f:facet name="separator">
    <af:separator id="sep"/>
    </f:facet>
    <dvt:projectGantt id="mygantt" startTime="2010-01-01"
    endTime="2011-12-31" var="task"
    value="#{tacheBean.model}" rendered="true"
    dataChangeListener="#{tacheBean.handleDataChanged}"
    actionListener="#{tacheBean.handleAction}"
    showCurrentDate="true" showMenuBar="true"
    labelPlacement="inside"
    binding="#{tacheBean.gantt}"
    taskbarFormatManager="#{tacheBean.taskbarFormatManager}"
    backgroundColor="#F5F5F5"
    nonWorkingDaysColor="#FFE4B5"
    nonWorkingDaysOfWeek="#{tacheBean.nonWorkingDays}"
    taskSelectionListener="#{tacheBean.handleTaskSelected}"
    doubleClickListener="#{tacheBean.handleDoubleClick}">
    <f:facet name="toolbar">
    <af:toolbar id="toolbar">
    <af:group>
    <af:commandToolbarButton partialSubmit="false"
    icon="/images/new_ena.png"
    id="bt_creer"
    actionListener="#{tacheBean.nouveau}"
    shortDesc="Créer une Tâche"
    disabledIcon="/images/new_ena_002.png">
    <af:showPopupBehavior popupId="popupDialog"/>
    </af:commandToolbarButton>
    <af:panelGroupLayout layout="default" id="pgl1"
    theme="dark">
    <af:popup id="popupDialog">
    <h:inputHidden value="#{tacheBean.init}"/>
    <h:inputHidden value="#{typeBean.init}"/>
    <af:panelWindow modal="true" title="Ajout Tâche"
    id="panelWindow1"
    inlineStyle="height:300px; width:400px;">
    <af:panelGroupLayout id="pgl2">
    <center>
    <af:panelBox text="Ajout" id="pb1"
    titleHalign="left"
    inlineStyle="height:300px; width:400px;"
    background="medium"
    showDisclosure="false"
    showHeader="always"
    icon="/images/new_ena.png">
    <table id="t1" width="525" border="0"
    cellpadding="1" height="233">
    <tr>
    <td align="left">
    <af:outputLabel value="Nom :" id="ol8"
    visible="true"
    showRequired="true"/>
    </td>
    <td align="left" width="80">
    <af:inputText id="it1" rows="1"
    value="#{tacheBean.task.taskName}"
    requiredMessageDetail="Champ Obligatoire"
    shortDesc="Le Nom de la tâche"
    autoSubmit="true"
    autoTab="true"/>
    </td>
    </tr>
    <tr>
    <td align="left" width="80">
    <af:outputLabel value="Label :" id="ol6"
    visible="true"
    showRequired="true"/>
    </td>
    <td align="left" width="80">
    <af:inputText id="it2"
    value="#{tacheBean.task.label}"/>
    </td>
    </tr>
    <tr>
    <td align="left" width="80">
    <af:outputLabel value="Id Parent :"
    id="ol5" visible="true"
    showRequired="true"/>
    </td>
    <td align="left" width="80">
    <af:selectOneChoice id="soc1"
    inlineStyle="width:80px"
    valueChangeListener="#{tacheBean.changeAttributes}">
    <f:selectItems id="si1"
    value="#{tacheBean.selectItems}"/>
    </af:selectOneChoice>
    </td>
    </tr>
    <tr>
    <td align="left" width="80">
    <af:outputLabel value="Rien :" id="rien"
    visible="true"
    showRequired="true"/>
    </td>
    <td align="left" width="80">
    <af:inputText id="rien2"
    partialTriggers="soc2 si2"/>
    </td>
    </tr>
    <tr>
    <td align="left" width="80">
    <af:outputLabel value="Type :" id="ol4"
    visible="true"
    showRequired="true"/>
    </td>
    <td align="left" width="80">
    <af:selectOneChoice id="soc2"
    valueChangeListener="#{typeBean.changeAttributes}"
    autoSubmit="true"
    rendered="true">
    <f:selectItems id="si2"
    value="#{typeBean.selectItems}"/>
    </af:selectOneChoice>
    </td>
    </tr>
    <tr>
    <td align="left" width="80">
    <af:outputLabel value="Date Début :"
    id="ol3" visible="true"
    showRequired="true"/>
    </td>
    <td align="left" width="80">
    <af:inputDate id="id1"/>
    </td>
    </tr>
    <tr>
    <td align="left" width="80">
    <af:outputLabel value="Date Fin :"
    id="ol2" visible="true"
    showRequired="true"/>
    </td>
    <td align="left" width="80">
    <af:inputDate id="id2"/>
    </td>
    </tr>
    <tr>
    <td align="left" width="80">
    <af:outputLabel value="Durée :" id="ol1"
    visible="true"
    showRequired="true"/>
    </td>
    <td align="left" width="80">
    <af:inputText id="it8" rows="1"
    requiredMessageDetail="Champ Obligatoire"
    shortDesc="Le Nom de la tâche"
    autoSubmit="true"
    autoTab="true"/>
    </td>
    </tr>
    <tr>
    <td> </td>
    <td align="center" width="80">
    <h:panelGrid columns="2">
    <af:commandButton inlineStyle="width:80px"
    id="insertion"
    text="Ajouter"
    actionListener="#{tacheBean.ajoutTache}"
    immediate="true"
    visible="true"></af:commandButton>
    <af:commandButton inlineStyle="width:80px"
    id="annuler"
    text="Annuler"
    immediate="true"
    visible="true"></af:commandButton>
    </h:panelGrid>
    </td>
    </tr>
    </table>
    </af:panelBox>
    </center>
    </af:panelGroupLayout>
    </af:panelWindow>
    </af:popup>
    </af:panelGroupLayout>
    <af:commandToolbarButton partialSubmit="false"
    shortDesc="Mettre à jour la Tâche"
    disabledIcon="/images/edit_dis.png"
    icon="/images/edit16.png"></af:commandToolbarButton>
    <af:commandToolbarButton partialSubmit="false"
    shortDesc="Supprimer une Tâche"
    icon="/images/delete16.png"
    disabledIcon="/images/delete_dis.png"/>
    <af:separator id="sep1"/>
    <af:commandToolbarButton partialSubmit="false"
    shortDesc="Impression"
    icon="/images/print_ena.png"
    disabledIcon="/images/print_ena.png"/>
    <af:separator id="sep2"/>
    <af:commandToolbarButton partialSubmit="false"
    shortDesc="Couper"
    icon="/images/cut_ena.png"
    disabledIcon="/images/cut_dis.png"/>
    <af:commandToolbarButton partialSubmit="false"
    shortDesc="Copier"
    icon="/images/copy_ena.png"
    disabledIcon="/images/copy_dis.png"/>
    <af:commandToolbarButton partialSubmit="false"
    shortDesc="Coller"
    icon="/images/paste_dis.png"
    disabledIcon="/images/paste_dis.png"/>
    </af:group>
    </af:toolbar>
    </f:facet>
    <f:facet name="menuBar">
    <af:menuBar>
    <af:menu text="Custom Menu">
    <af:commandMenuItem partialSubmit="false" text="Item 1"/>
    <af:commandMenuItem partialSubmit="false" text="Item 2"/>
    <af:commandMenuItem partialSubmit="false" text="Item 3"/>
    </af:menu>
    </af:menuBar>
    </f:facet>
    <f:facet name="major">
    <dvt:timeAxis scale="months" id="monthx"/>
    </f:facet>
    <f:facet name="minor">
    <dvt:timeAxis scale="weeks" id="weeks"/>
    </f:facet>
    <f:facet name="nodeStamp">
    <af:column headerText="Id Tâche" id="c2">
    <af:outputText value="#{task.taskId}" id="taskId"/>
    </af:column>
    </f:facet>
    <af:column headerText="Nom Tâche" id="nom">
    <af:outputText value="#{task.taskName}"/>
    </af:column>
    <af:column headerText="Date Debut">
    <af:outputText value="#{task.startTime}" id="debut"/>
    </af:column>
    <af:column headerText="Date Fin">
    <af:outputText value="#{task.endTime}" id="end"/>
    </af:column>
    <dvt:ganttLegend keys="#{tacheBean.legendKeys}"
    labels="#{tacheBean.legendLabels}"/>
    </dvt:projectGantt>
    </af:panelGroupLayout>
    </f:facet>
    </af:pageTemplate>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

    hi,
    previously i asked that question about how can i get date with time fallowed by am/pm in table fields for that your post is useful.
    now have some of doubt about same thing, as we achieved like in table (date with time by am/pm) i need to get in query panel because in search criteria i not bale to search time filtering I'm able to filter with date only
    its not allowing to change to search in design time( we know adf query wont allow design time modification as my knowledge) please suggest how can i change or any other way to create search instead of creating declarative
    search modification.
    and one more question i have how can i count number of rows displayed in table which displayed in search table if we want display no.of row displayed in table.
    Thanks
    Shankar

  • Primary key issue

    Hi all,
    I'm new here, and I have a stupid problem, I think. If someone could help me, I'll be grateful.
    I have to build a very simple JSP application using a few database tables, providing the base functionality: insert, update, delete, search.
    I'm using Oracle 8.1.7, and JDeveloper 9.0.3
    One table looks like that:
    CREATE TABLE TEST (
    sPrimaryKey varchar2(30) not null,
    sField varchar2(100)
    ALTER TABLE TEST
    ADD ( CONSTRAINT test_id_pk
    PRIMARY KEY (sPrimaryKey)
    I'm using a sequence for generating primary key...
    CREATE SEQUENCE test_seq
    START WITH 100
    INCREMENT BY 1
    NOCACHE
    NOCYCLE;
    ... and a trigger before insert for seting the new value of the primary key.
    CREATE OR REPLACE TRIGGER BI_TEST
    BEFORE INSERT ON TEST
    FOR EACH ROW
    DECLARE
    new_id integer;
    BEGIN
    select test_seq.nextval into new_id from dual;
    :new.sPrimaryKey := 'AAA' || new_id;
    END;
    I have created a BC4J. How can I insert a new row into that table using a BC4J from an HTML form, within a JSP page, without providing the primary key, by hand, and let the trigger and sequence do that?
    Thank you!
    Razvan

    I'm using a sequence for generating primary key...Change the attribute type for sPrimaryKey to be a DBSequence attribute type. It assumes you have an insert-trigger that fills in the correpsonding numeric column.

  • Unable to enforce Primary Key constraint with my code

    Hi Guys
    I have a table that contains 2 columns: code and description (defined as not null). I am using oracle forms 10g, if I inset a new row both the columns: code and description should have data e.g. code: 001 and description: Main Store...
    So on forms I have an on-update trigger on block level that handles the error messages but if the user has to update the description this trigger blocks him because the value for the code i.e. 001 is already on the database but if I remove the piece of code (the first IF block on my code together with a cursor and the entire declaration section)then the primary key constraint is violated: the code is as follows:
    declare
    v_store_code store_types.code%type;
    cursor store_codes is
    select a.code
    from store_types a
    where a.code = :b1.code;
    begin
    open store_codes;
    fetch store_codes into v_store_code;
    if ( store_codes%found ) then
    Message('The Store Code you have entered already exists on the Store_Types table, please enter another code!');
    Message('The Store Code you have entered already exists on the Store_Types table, please enter another code!');
    close store_codes;
    raise form_trigger_failure;
    end if;
    close store_codes;
    if :b1.code is not null and :b1.description is null then
         message('If the Store Code has been captured, then the Store Description must be captured!');
         message('If the Store Code has been captured, then the Store Description must be captured!');
    raise form_trigger_failure;
    end if;
    if :b1.description is not null and :b1.code is null then
         message('If the Store Description has been captured, then the Store code must be captured!');
         message('If the Store Description has been captured, then the Store code must be captured!');
         raise form_trigger_failure;
    end if;
    exception
              when others then
                   message(sqlerrm);
                   raise form_trigger_failure;
    end;
    My main intention here is: the user should be able to update the description field and save the changes without violating primary key on the column: code ...... please help me guys...

    ICM
    Sir as far I could understand , your problem is that your wanna allow the end users to update the Store_description , and Store_code..
    So on forms I have an on-update trigger on block level that handles the error messages but if the user has to update the description this trigger blocks him because the value for the code i.e. 001 is already on the databaseif it's right then why don't you have unique key constraints Store_description?
    alter the tables and apply unique key constraint...
    and no need to write this code
    f :b1.code is not null and :b1.description is null then
    message('If the Store Code has been captured, then the Store Description must be captured!');
    message('If the Store Code has been captured, then the Store Description must be captured!');
    raise form_trigger_failure;
    end if;because as you mentioned
    code and description (defined as not null)if they are already under not null constraints then no need to handle this in coding..
    he/she must be able to change the description and save the changes without affecting the code i.e.:Sir I think updation in records can only be performed when the forms is in query mode e.g execute query, have all/desired records and then make changes
    (1)description is in unique key constraint it can't be duplicated ..
    (2)code is PK it can never be duplicated...
    for this I would suggest you to have a update button on forms , when-button-pressed trigger sets property of block (update_allowed, property_true);
    and check the code of unique key violation code from oracle form's help , when that error code raise up you can show those message
    Message('The Store Code you have entered already exists on the Store_Types table, please enter another code!');
    Message('The Store Code you have entered already exists on the Store_Types table, please enter another code!');I hope it could do something for you
    thanks
    regards:
    usman noshahi

  • Hi  cant see the primary key column in master detail  form

    I have a master detail form .In the first master form i am unable to see the primary key
    Now the form is built completley and i also will like to see the primary key column visible in master report
    If i had set the primary key as rowid then i could have seen the primary key ..
    Now i can see the pencil icon (The eidt row pencil icon) instead of the actual primary key column . .which is a number data..
    I will like that too be visible ..Can any one guide what should i do for this..
    Thanks

    Hi Mat,,
    I am using apex 4.2 db version 11g and in the first master page i had set the value of combo which is primary key column as text
    But still iam not able to see the number ..Note if i recreate the form ..with rowid as primary key i am able to see the column since the pencil icon(edit icon) is on row id..
    Currently All i see is the edit icon ..I need both the edit icon and also the number ..
    Thanks

  • Primary key column in manual tabular form

    I am creating a manual tabular form and am unsure what to do for my primary key column. When I do this with the wizard, I'm allowed to specifiy a Primary Key Source Type and the Primary Key Source (my sequence). Is there a way to do this in a manual tabular form?
    I'm creating the column with the call 'wwv_flow_item.display_and_save(2,hours_id) hours_id' but when I edit the 'Tabular Form Element' section, I don't have the Primary Key fields anywhere to edit...only Reference Table Owner, Reference Table/Column Name. Where can I specify the sequence?
    Thanks,
    Janel

    In the process ApplyMRD, try specifying the 'Secondary Key Column' in the section 'Source: Multi Row Update and Delete' to the second key column in the tabular form.
    I haven't tested this with your situation, but worth a shot.

Maybe you are looking for

  • Very slow broadband in Greenwich area

    Hi, My broadband speeds fell off a cliff recently. Been noticing disconnects in recent weeks, now getting speeds of about 350k upload on a line capable of 6.5mb. Help line is useless - tried to diagnose my wifi despite my explaining I was looking at

  • Program run in back ground

    Dear friends, Can u please help me to run my program in back graound. Is there any code for this. Is there any process for this task. thanks and Regards vivek

  • Dreamweaver open link in same window (basic)

    Hey, I have a verry basic question. So im creating a page with File->New->2 column left sidebar fixed. And now i want to have "Link one" link to a new page, and that new page has to be shown on the right side. so that the left bar is still there. How

  • MBA no longer detects home wifi

    Hi! I've had my MBA for a few months and always used it at home with no issue. Recently my housemate forgot to pay our internet bill and our connection was cut. Now my MBA won't pick up my wifi, but my housemates pc can use it. Iv reset the router an

  • Timer on iPod Classic?

    I am iPod shopping. Is there a timer on the iPod so I can set it to run for an hour, and then it will shut itself off?? Chim