Edit entity object and use the Create() method for generating ID's

Hello,
I have and InserPage.jsp and defined the datasoucre correctly.
<jbo:InputText datasource="ds" dataitem="Clientid" /> gives me
the unique ClientID from the FIRST client-record in my table ,
although this page is for inserting a NEW Client, with a new
ClientID.
So, on the Clients Entity i made a create() method and put the
following code in it:
public Number getClientid() {
return (Number)getAttributeInternal(CLIENTID);
public void create(AttributeList attributeList) {
SequenceImpl seq = new SequenceImpl
("Clientid",getDBTransaction());
Integer i=(Integer)seq.getData();
setClientid(new Number(i.intValue()));
super.create(attributeList);
the getData() Returns a sequence value, but what sequence value?
Do i have to create a sequence on the ClientID column in my
Oracle Table in the DB too?
The problem is, the first ClientID # is 819 and the current last
one seems to be 2899, so how do i achieve that when opening the
insert.jsp the new ClientID shows up (ie. 2900)?
How can i achieve this?
thx

OK, managed to track down the HowTo on triggers? I created the
trigger.
create sequence client_seq
start with 8900
increment by 1
nomaxvalue
nocycle;
I changed the create() method for the entity object to:
public void create(AttributeList attributeList) {
SequenceImpl seq = new SequenceImpl
("Clientid",getDBTransaction());
SequenceImpl s = new SequenceImpl("client_seq",
getDBTransaction());
Integer next = (Integer)s.getData();
setClientid(new Number(next.intValue()));
and running the tester for the module works fine. ;-)
But...
The Insert.jsp page has to insert/show this sequenced value!
After i defined the datasource and let us say:
<jbo:InputText datasource="ds" dataitem="Clientid" />
...the number 819 shows up, which is the FIRST record, so i do
not get the new ClientID with the correct number.
Any help is always nice. ;-)

Similar Messages

  • How to use the index method for pathpoints object in illustrator through javascripts

    hii...
    am using Illustrator CS2 using javascripts...
    how to use the index method for pathpoints object in illustrator through javascripts..

    Hi, what are you trying to do with path points?
    CarlosCanto

  • I can't turn on my MacBook Air despite trying to hold down the power button and using the SMC method. BTW my battery charger lights up to a green when plugged into the laptop.

    I can't turn on my MacBook Air despite trying to hold down the power button and using the SMC method. BTW my battery charger lights up to a green when plugged into the laptop.

    Hello cass528,
    I would be concerned too if my MacBook Air would not power on.  I recommend following the steps in this article when experiencing an issue like this:
    Troubleshooting: My computer won't turn on
    http://support.apple.com/kb/TS1367
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • What is authorization object and how to create it for a table

    Hi All,
    What is authorization object and how to create it for a table?
    Thanks

    Hi
    Authorization
    For authorization checks, there are many ways of linking authorization objects with user actions in an SAP system. The following discusses three possibilities in the context of ABAP programming.
    Authorization Check for Transactions
    You can directly link authorization objects with transaction codes. You can enter values for the fields of an authorization object in the transaction maintenance. Before the transaction is executed, the system compares these values with the values in the user master record and only starts the transaction if the appropriate authorization exists.
    Authorization Check for ABAP Programs
    For ABAP programs, the two objects S_DEVELOP (program development and program execution) and S_PROGRAM (program maintenance) exist. They contains a field P_GROUP that is connected with the program attribute authorization group. Thus, you can assign users program-specific authorizations for individual ABAP programs.
    Authorization Check in ABAP Programs
    A more sophisticated, user-programmed authorization check is possible using the Authority-Check statement. It allows you to check the entries in the user master record for specific authorization objects against any other values. Therefore, if a transaction or program is not sufficiently protected or not every user that is authorized to use the program can also execute all the actions, this statement must be used.
    AUTHORITY-CHECK OBJECT object
                            ID name1 FIELD f1
                            ID name2 FIELD f2
                            ID namen FIELD fn.
    object is the name of an authorization object. With name1, name2 ... , and so on, you must list all fields of the authorization object object. With  f1, f2 ... , and so on, you must specify the values that the system is to check against the entries in the relevant authorization of the user master record. The AUTHORITY-CHECK statement searches for the specified object in the user profile and checks the useru2019s authorizations for all values of f1, f2 ... . You can avoid checking a field name1, name2 ... by replacing FIELD f1  FIELD f2 with DUMMY.
    After the FIELD addition, you can only specify an elementary field, not a selection table. However, there are function modules available that execute the AUTHORITY-CHECK statement for all values of selection tables. The AUTHORITY-CHECK statement is supported by a statement pattern.
    Only if the user has all authorizations, is the return value sy-subrc of the AUTHORITY-CHECK statement set to 0. The most important return values are:
    ·        0: The user has an authorization for all specified values.
    ·        4: The user does not have the authorization.
    ·        8: The number of specified fields is incorrect.
    ·        12: The specified authorization object does not exist.
    A list of all possible return values is available in the ABAP keyword documentation. The content of sy-subrc has to be closely examined to ascertain the result of the authorization check and react accordingly.
    REPORT demo_authorithy_check.
    PARAMETERS pa_carr LIKE sflight-carrid.
    DATA wa_flights LIKE demo_focc.
    AT SELECTION-SCREEN.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                      ID 'CARRID' FIELD pa_carr
                      ID 'ACTVT' FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE e045(sabapdocu) WITH pa_carr.
      ELSEIF sy-subrc <> 0.
        MESSAGE e184(sabapdocu) WITH text-010.
      ENDIF.
    START-OF-SELECTION.
      SELECT  carrid connid fldate seatsmax seatsocc
        FROM  sflight
        INTO  CORRESPONDING FIELDS OF wa_flights
        WHERE carrid = pa_carr.
        WRITE: / wa_flights-carrid,
                 wa_flights-connid,
                 wa_flights-fldate,
                 wa_flights-seatsmax,
                 wa_flights-seatsocc.
      ENDSELECT.
    Regards
    Hitesh

  • How do I set up and use the TV tuner for an ENVY 23 TouchSmart​?

    How do I set up and use the TV tuner for an ENVY 23 TouchSmart?

    Hello LindaLamb:
    First thing is connect your coex TV Anti cable to your computer the end connector looks like a bolt. Then open up Windows Media Center go down the list to live tv and follow and fill in your information with wizard . If your computer doesn't have an built in TV Tunner then you will need to purchase an USB TV tunner. http://www.bing.com/shopping/search?q=usb+tv+tunne​r&qpvt=usb+tv+tunner&FORM=HURE . frrw

  • Can I get an Ipad with wifi and cellular but no contract with a carrier in the US?  I want to use it overseas in Africa with a local SIM card and use the cellular signal for all my internet.

    Can I get an Ipad with wifi and cellular but no contract with a carrier in the US?  I want to use it overseas in Africa with a local SIM card and use the cellular signal for all my internet. 

    Yes you can.  All Ipad's are unlocked and can be used any where in the world. Buy the AT&T version which is GSM in other countries

  • CL_RSPLS_CR_EXIT_BASE  how to use the create method

    Hi everybody
    I am using a copy of CL_RSPLS_CR_EXIT_BASE in the relationships derivation of our planning project. I do not understand how CL_RSPLS_CR_EXIT_BASE works.
    Here is the problem:
    I use the class to derivate 0COSTCENTER from 0CO_AREA and 0COORDER. In one planning function everything works fine. With the use of the relationships the class is called and in the DERIVATE Method I can select the responsible costcenter from the 0COORDER data with 0COORDER and 0CO_AREA.
    But I also have a planning sequence which is also using the relationships but on step 7 (costcenter from co_area and coorder) it directely calls the DERIVATE method. But in the DERIVATE Method I do not have the source fields COORDER and CO_AREA as source data available....
    How does this work? Where do I get the source data from? In the first case I have it all in the parameter c_s_chas.... but in the CREATE method I can't find the source data.
    Thanks for any input.
    Have a nice day
    regeards
    Christophe

    Hi Gregor
    thanks for your reply. I definitely am or was pretty confused about DERIVE and CREATE. Can you confirm the following so that I know if I got it now:
    In CREATE i select data from the master table (for example COSTCENTER COORDER and CO_AREA if those are the characteristics I use in the exit relation (source = COORDER, target = COSTCENTER and CO_AREA). Those are also the lines I find in the selection criteria table i_tsx_seldr.
    I fill all the selected combinations into the internal table e_th_chas (in the same order of fields like they are in i_tsx_seldr).
    That's it and then the system gets the necessery data from this selection?
    In this way I get a new error message in my planning sequence:
    Nachwert-Einschränkung 1 zu Teilvorgang 1 bewirkt folgenden Fehler
    Es konnte keine Kombination erzeugt werden
    What am still doing wrong?
    Thanks a lot!
    best regards
    christophe

  • Mouse Coordinates and using the getPoint method

    Hello,
    I have a mouseClicked event that uses the getPoint method to get the coordinates of the mouse. Because the mouse is a shape (the cursor), it contains more than 1 pair of coordinates, so getPoint is supposed to return the coordinates of what is called the "hit point" of the mouse. Now because I use the standard mouse cursor (an arrow), the "hit point" is supposed to be its point edge, but I get the coordinates of the other edge!
    Now if I have a big JPanel in the window (without controls) that the user can press and the program needs to respond to the clicks, there are situations that the user presses somewhere and expects to get a specific response, but instead gets another one. That's because he/she is accustomed from other applications to use the point edge, but if the 2 edges of the cursor are in different regions in the panel (and thus generate different responses), they get the response of the other edge's region.
    Is there a way to solve this?
    Thanks.

    I still don't understand your problem and apparently nobody else does either since there are no responses. Why don't you write a simple program (like I did for you on your last post) that demonstrates the problem.
    "A picture is worth a thousand words".

  • Is it possible to use the Intel graphics for the display and use the NVIDIA GPU for rendering at the same time?

    I have been trying to figure this one out for a couple of days. I found the CUDA mac drivers on NVIDIA's website and installed them. I have been working in Blender. After the driver install I can now switch between CPU and GPU processing, Great. It works, but I am not experiencing decreased render times like I had read about or expected. It's about the same. While using the GPU for rendering, my OS is choppy, leading me to wonder if there is a way to use the NVIDIA just for computing power?
    Any help would be grand.
    Thanks

    No.

  • I want to transfer my data to new computer and use the new computer for iPhone 5. Have anyone can recommend the best way for me?

    I have some problem to transfer my data via home sharing. (Maybe my internet connection is poor)
    I tried to transfer all the apps and music via home sharing. When it's done, it showed the internet connection is time-out. (So sad )
    So I want some people to help me about the methods to transfer datas from old computer to the new one.
    Then I can use the new one with new iphone 5.
    PS. I use iPhone 3gs with iOS 4.3.5.
    Old computer uses Microsoft WIndows XP.
    New one uses Microsoft Windows 7.
    Thank you

    you can't recover iOS crypted backup password, for security purposes. your backup is useless. sorry.
    if you still have your old iPhone, make a new back-up

  • If we have 3 iPhones, and use the same iTunes for all content, should we use 3 Apple IDs and authorize for all 3 or just use 1 ID?

    I want to enable us to share all apps, music, videos and photos, but enable each phone to keep its contacts and history separate. If I use 1 ID, all new purchases will go on the same credit card, which I'm not sure is ideal, but not horrible. Since we use the same computer and iTunes using only 1 appleID, and the phones are new to the equation since it was only iPods before, what is the best way to handle a family with 3 phones that can share all entertainment content, but not all phone-related stuff? I saw that you can use one AppleID for purchases, but another for iCloud. That may be the best solution, but I don't know enough about this yet to move forward yet- migrating from Android...
    Appreciate the help.

    Thanks for the help, but a follow up question now.
    My iPhone won't arrive for a little while, but my wife already got hers and she wants to set it up now. Using my Apple ID for the purchases, if she starts setting hers up, can she change her iCloud ID to something else quickly? It keeps telling us that we have to sign in with the AppleID first.
    Should we just set up an iCloud account via normal internet before trying all this via iPhone?

  • Printing a report and using the print dialog for it

    i already have the print dialog vi from NI. I am using the normal report generation toolkit for printing reports. But I want to give the user an option to choose the number of pages and landscape/portrait options. But how do I integrate the 2 so that before printing the user can select these features.

    There is an activeX control that will set these settings. It is called IAS Helper COM Component 1.0 Type Library. It operates the Windows printer configuration program. Since another company wrote the code, I do not have the resources to help you use the control, but the attached example program should get you started.
    Jeremy Braden
    National Instruments
    Attachments:
    Print_Window_Example_v61.llb ‏59 KB
    Print_Window_Example.llb ‏59 KB

  • How to use the complete method for as3 FLV component

    Hi team,
    I am using an FLV component dragged to the stage and then bringing in video content.  How can I make it visible=false when it has finished playing using the COMPLETE event?
    Cheers.
    sub

    if your component's instance name is flv_pb, use:
    flv_pb.addEventListener(Event.COMPLETE,completeF);
    function completeF(e:Event):void{
    flv_pb.visible=false;

  • Using the Function:: Method for Spry Processing

    i have read the relevant article (
    http://labs.adobe.com/technologies/spry/samples/data_region/Function_colon.html)
    and have successfully managed to format as currency my price data
    in my spry table.
    what syntax do i need to format dates ? and is there a
    general reference i can look at for creating similar finctions ?
    regards

    There isn't a general reference, mainly because there are a
    wide variety of date formats ... but I suppose any sample would be
    better than none.
    In any case, what is your date format in your data, and what
    is the format you want it to look like in the output?
    An example would be:
    function FormattedDate(region, lookupFunc)
    // Get the date column which is in the format "20090120"
    // and format it so it looks like "01/20/2009".
    return
    lookupFunc("{date}").replace(/(\d\d\d\d)(\d\d)(\d\d)/, "$2/$3/$1");
    <div
    spry:region="ds1">{function::FormattedDate}</div>
    --== Kin ==--

  • How to copy and use the RAID files for ATI SB600 for a new build

    WinXP Home
    MSI K9A Platinum
    AMD Athlon X2-3600+
    2 x Seagate 250GB SATA2 3GB/s HHD
    2 x HIS X1950Pro in Crossfire
    2 x OCZ2A8002GK Crossfire certified modules
    Enermax Galaxy 850
    Hello, I plan on setting this new build up with SATA RAID 0. I tried to follow the ReadMe file in the RAID drivers download but think I am not fully understanding. The ReadMe says to copy all files to the media...it said floppy but I am going to use a flash drive. I did so but there were two folders, X64 and  X86. Do I open those two folders and copy all the contents or do I just copy the two folders directly to the drive?
    Thank you

    Quote from: lewislink on 05-July-07, 02:13:43
    Open the sub-folders and copy their contents, or copy the sub-folders, themselves?
    What about BIOS update? Will it be necessary to use a floppy or can a flash drive function?
    "What about BIOS update? Will it be necessary to use a floppy or can a flash drive function?"
    don't update the BIOS when everythink is working...
    "Open the sub-folders and copy their contents, or copy the sub-folders, themselves?"
    copy them as is.. directly with sub-folders included.

Maybe you are looking for