JSP, BC4J, Row Tag: what is the best way to delete multiple rows?

Hi all.
I have a JSP Edit page with three datasources on it. The tables these VO's represent (A, B and C) have a Parent --> Child (1:1 between A and B) relationship and then another Parent --> Child (1:n between B and C) relationship. So the user retrieves one row for Table A, 1 matching row for table B and then between 0 and 6 matching rows for Table C (there cannot be more than 6 because the user can only add these rows from a finite list).
In my EditSubmit page, I want to perform a RowTag Update action on Tables A and B and they both work no problem. They can't update any rows from Table C but they can add or delete from the list of 0 - 6 rows (the UI is actually a list of 6 checkboxes that they can turn on or off). I figure that the easiest way to handle this rather than keep a list of original values and compare them is simply to delete all existing rows and then add any that the user checked.
This is causing a problem. I have added a hidden field to the form that picks up the RowKey for each existing row. I can get these RowKeys in the Submit page but cannot find a way of using them with the Delete Row Tag.
In the end, the only way I could get it to work was the following code (which I stole from the RowTag.java file in jbohtmlsrc.zip):
if (stakeMailRowKeys != null) {
for (int counter = 0; counter < stakeMailRowKeys.length; counter++) {
Key stakeMailKey = new Key(stakeMailRowKeys[counter], stakeMailingRS.getViewObject().getKeyAttributeDefs());
stakeMailRows = stakeMailingRS.findByKey(stakeMailKey,1);
stakeMailingRow = stakeMailRows[0];
// Tell the row to delete itself from the database
stakeMailingRow.remove();Is there a simpler way to do this (I figure there probably is)? I have another problem with updating the constrained View Objects but I will leave that out of this thread for now.
TIA,
Simon

I don't know if this will help you, but this is what I do:
I separate the logic into a delete.jsp page. If you can create a View Object that will represent the rows you want to delete and append a where clause to select only the rows you want to delete. Then loop through the view deleting each row. Lets just say you have department and employee tables. and you want to delete employees within a given department. Create a view object that brings back all employees.
In your delete.jsp find out the department no. by request.getParameter("dept_id");
then append this to the where clause of your view Object and execute the query:
vo.setWhereClause(request.getParameter("dept_id");
vo.executeQuery;
now loop through and remove the rows:
while(vo.next){
vo.getCurrentRow().remove();
and commit or post changes accordingly.
There are many ways of doing this action. The easiest way I have found is to create the ViewObjects based on what actions you want to take on them. Make bc4j work for you.
regards,
aaron
null

Similar Messages

  • What is the best way to sync multiple collections of contacts among multiple users?

    (I originally submitted this question under the "Mac OS X Technologies" section, but got no response. I'm submitting a duplicate here because this is where all the smart folks are! My apologies that my question is only partially related to OS X Server . . . )
    What is the best way to sync multiple collections of contacts among multiple users on iOS and OS X?
    For example, suppose I have three collections of contacts: Bob's, Sally's, and Common. I want Bob to be able to access and sync Bob's contacts and Common contacts, and Sally to access and sync Sally's contacts and Common contacts. Bob and Sally never need to access or sync each other's contacts. Bob and Sally would both sync and share contacts in Common.
    How would I best implement this? It's my understanding I have three options for managing contacts across iOS and OS X: 1. iCloud accounts, 2. Install OS X server, or 3. Install and manage Darwin CardDAV directly. Which method would best support what I wish to do?
    I am a seasoned Unix geek well versed in the terminal, so I am prepared to get my hands dirty as much as necessary to achieve what I want. Also, it is sufficient if syncing takes place over WiFi on the local network, in fact, that is desirable versus syncing over the cloud.

    Thanks for your reply Nick101. I see my example was oversimplified. When I say "multiple groups of contacts over multiple users" I'm really referring to N groups of contacts over N users.
    So I need to add Fred, who can access and sync Bob's contacts, Sally's contacts, and Common contacts, as well as Fred's contacts. Can I do it with OS X server?
    You mention you keep your and your partner's contacts administered locally. What keeps you from administering them through OS X server as well?
    I am guessing this can all somehow be accomplished with multiple contact accounts, but I can't find any information on the web explicitly describing this.

  • What is the best way to manage multiple ipods using the same itunes?

    Hi Everyone
    i am trying to manage three different ipods through the one Itunes, all with very different tastes, not sure if I am doing it the best or easiest way so does anybody have a simple solution on what you're supposed to do, to keep it all simple!
    Cheers
    Liv

    If you have created a new Windows user account you need to log out and then log back in with your original user name. By default each Windows profile will have an independent iTunes library.
    If instead you managed to create a new library within the same profile. click the icon to start iTunes and immediately press and hold down the shift key, keep holding until asked to create or choose a library. Click Choose and navigte back to your original which should be at <User's Music>\iTunes.
    Your question as posed was:
    What is the best way to manage multiple iPods using the same iTunes {library}?
    in which case Selected Playlists is probably the best approach. Simply create a playlist for each device, Alice's iPod, Bob's iPhone etc. and sync the device with the appropriate list.
    tt2

  • What is the BEST way to delete an app on an iPhone 4S so it will NOT be added back when I sync with iTunes?

    What is the BEST way to delete an app on an iPhone 4S so it will NOT be added back when I sync with iTunes?

    To completely remove an app and all of its data, do this: First delete the app on your phone, then in iTunes, under Library, click on Apps, right-click the app you want to delete & select delete, when prompted, move all files to trash, empty your trash. Connect your phone and sync. The app and all of its data will be gone.

  • What is the best way to delete MacKeeper?

    I installed MacKeeper last year in an attempt to free up some hard drive space on my former hard drive. I now have a new SSD and have no need for MacKeeper. In addition, I see that this programme attracts a lot of negative press.
    What is the best way to delete MacKeeper from my hard drive and Time machine?

    Remove the "MacKeeper" crapware as follows. First, back up all data.
    "MacKeeper" has only one useful feature: it deletes itself.
    Note: These instructions apply to the version of the product that I downloaded and tested in early 2012. I can't be sure that they apply to other versions.
    IMPORTANT: "MacKeeper" has what the developer calls an “encryption” feature. In my tests, I didn't try to verify what this feature really does. If you used it to “encrypt” any of your files, “decrypt” them before you uninstall, or (preferably) restore the files from backups made before they were “encrypted.” As the developer is not trustworthy, you should assume that the "decrypted" files are corrupt unless proven otherwise.
    In the Finder, select Go ▹ Applications from the menu bar, or press the key combination shift-command-A. The "MacKeeper" application is in the folder that opens. Quit it if it's running, then drag it to the Trash. You'll be prompted for your login password. Then a dialog will pop up asking why you want to uninstall it. You don't have to provide that information. Enter anything you like in the text box, then click the Uninstall MacKeeper button. All the functional components of the software will be deleted. Reboot.
    Do not try to uninstall by dragging the MacKeeper icon in the Dock or the LaunchPad to the Trash.
    Here are some general suggestions. If you want your computer to be usable, don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” "tune-ups," “accelerators,” “extenders,” “cleaners,” “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, this kind of material is useless, or worse than useless.
    The more actively promoted the product, the more likely it is to be garbage. The most extreme example is the “MacKeeper” scam.
    The only software you should install is that which directly enables you to do the things you use a computer for — such as creating, communicating, and playing — and does not modify the way other software works. Never install any third-party software unless you know how to uninstall it.

  • What is the best way to delete applications?

    I am told that my Mac came with everything I need in the way of programs for basic functions.  What is the best way to delete applications making sure there are no threads left in Library and other places?

    Yes, but not always. An example of what I call "System" files/folders would be Quicktime or things like pre-installed print and scanner drivers. You have to be pretty confident to go rummaging through files in either /System or /Library. Most of the time there is no reason to be in there.
    An example of a file that is in those system folders, that does not come pre-installed as of Lion, is Flash plug-ins. That gets installed in the /Library/Internet Plug-Ins
    But your average App downloaded from the MAS, most of it's files will be in the User Folder   ~/username

  • What is the easiest way to delete multiple duplicate songs?

    What is the easiest way to delete multiple duplicate songs?

    1. Google it. You may find third party applications that do what you want.
    2. Here is the link to an Apple discussion thread.
    https://discussions.apple.com/thread/3721976?start=0&tstart=0
    3. Backup before you do anything.

  • What's the best way to delete 2.4 million of records from table?

    We are having two tables one is production one and another is temp table which data we want to insert into production table. temp table having 2.5 million of records and on the other side production table is having billions of records. the thing which we want to do just simple delete already existed records from production table and then insert the remaining records from temp to production table.
    Can anyone guide what's the best way to do this?
    Thanks,
    Waheed.

    Waheed Azhar wrote:
    production table is live and data is appending in this table on random basis. if i go insert data from temp to prod table a pk voilation exception occured bcoz already a record is exist in prod table which we are going to insert from temp to prod
    If you really just want to insert the records and don't want to update the matching ones and you're already on 10g you could use the "DML error logging" facility of the INSERT command, which would log all failed records but succeeds for the remaining ones.
    You can create a suitable exception table using the DBMS_ERRLOG.CREATE_ERROR_LOG procedure and then use the "LOG ERRORS INTO" clause of the INSERT command. Note that you can't use the "direct-path" insert mode (APPEND hint) if you expect to encounter UNIQUE CONSTRAINT violations, because this can't be logged and cause the direct-path insert to fail. Since this is a "live" table you probably don't want to use the direct-path insert anyway.
    See the manuals for more information: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#BGBEIACB
    Sample taken from 10g manuals:
    CREATE TABLE raises (emp_id NUMBER, sal NUMBER
       CONSTRAINT check_sal CHECK(sal > 8000));
    EXECUTE DBMS_ERRLOG.CREATE_ERROR_LOG('raises', 'errlog');
    INSERT INTO raises
       SELECT employee_id, salary*1.1 FROM employees
       WHERE commission_pct > .2
       LOG ERRORS INTO errlog ('my_bad') REJECT LIMIT 10;
    SELECT ORA_ERR_MESG$, ORA_ERR_TAG$, emp_id, sal FROM errlog;
    ORA_ERR_MESG$               ORA_ERR_TAG$         EMP_ID SAL
    ORA-02290: check constraint my_bad               161    7700
    (HR.SYS_C004266) violatedIf the number of rows in the temp table is not too large and you have a suitable index on the large table for the lookup you could also try to use a NOT EXISTS clause in the insert command:
    INSERT INTO <large_table>
    SELECT ...
    FROM TEMP A
    WHERE NOT EXISTS (
    SELECT NULL
    FROM <large_table> B
    WHERE B.<lookup> = A.<key>
    );But you need to check the execution plan, because a hash join using a full table scan on the <large_table> is probably something you want to avoid.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • What is the best way to have multiple devices on the same account so we can still share the same library.  Right now I have 7 and I believe it's causing them to malfunction.

    I have multiple devices on the same itunes library and they all starting to have the same issues.  Not recognizing numbers previously stored, not sending/receiving tests.  Do I need to get everyone separate itunes accounts? 

    What is the best way to set up itunes on our home network? 
    One iTunes library per person.  One iTunes account per person.
    If people wish to share songs, they can make copies.
    When the inevitable day comes when the kids get older, you will not have to come back here and post asking how all that stuff can get separated!

  • What is the best way to move multiple formats of songs/photos/podcasts to a new computer?

    For most of my life, I have used my family's home Windows desktop to establish my iTunes account with my iPod Classic (5th gen). On this computer I have:
    iTunes store purchases
    CD imports
    Other MP3 files
    Podcasts
    Photos downloaded from online
    Now I am in college in another city, and I won't be able to come home much, so I'm setting up iTunes on my laptop as my new "home base", as it were. I've already authorized it under the same account that I use on my desktop. What is the best way to move all of this stuff from my old computer to my new one? I'm thinking an external hard drive is the best decision, but I want the input of the Apple community. You guys are much more knowledgable than I am! Thanks!

    Hey Alayna,
    Welcome to Apple Support Communities, and thanks for the question! I'm not really in a position to recommend a "best" option, as there are several different ways to go. You can read over your options in the following document and decide which one works best for you:
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/ht4527
    Have a good one,
    David

  • What's the best way to sample multiple AI's with different sampling rates under one task?

    I'm using a PCI-6221 card and CVI 7.1.
    I have a tri-axis vibration sensor and two other pressure transducers.
    I want to take 10k samples from each vibration axis at 80 kHz. This is
    possible by configuring the scan rate of the "vibration task" to 240
    kHz. (The card maximum is 250 kHz).
    I want to take 1k samples from each pressure transducer at 250 kHz. This happens very infrequently.
    Each measurement is required by a separate task.
    I thought I could do this by setting up three finite tasks (1
    vibration, 2 pressure), but DAQmx won't let me run more than one AI
    task at a time. I've read other posts here, and I realize I have to
    add/remove physical channels on-demand.
    What is the best way to optimize this setup so that I'm not hogging up system resources?
    Should I do the following?
    1. Stop the task
    2. Remove the vibration channels from the task
    3. Add in a pressure channel
    4. Configure the pressure channel
    5. Start the task
    6. Take the pressure samples
    7. Stop the task
    8. Remove the pressure channel from the task
    9. Add in the vibration channels
    10. Configure the vibration channels
    11. Start the task
    Also, the vibration portion is running in finite mode, but I'm looping
    it. Should I switch it to continuous and run the "DAQmxReadAnalogF64"
    to sample the latest 10k samples. (If the task is continuous, would I
    pull the latest 10k samples, or would I pull some old buffered samples
    instead?)
    Thank you,
    Nobody

    Hello Nobody,
    If you configure your task timing to acquire a finite number of
    samples, then you can only read the number of samples that you
    specified in your configuration.  Once you try to read more
    samples, you will receive the error you are seeing.
    If you configure your task timing for continuous acquisition,k then you
    can read samples indefinitely.  Any given DAQmx Read will read the
    oldest unread samples in the buffer.
    If you are going to be switching between different tasks, you will definitely need to stop one before you start the other one.
    I hope this helps!
    Eric
    DE For Life!

  • What is the best way to send multiple pdf files to my ipad

    what is the best way or app to send multiple pdf files to my ipad, so that I can then combine them into one folder

    I have the app Readdle Docs. It allows you to move PDF files to your device and to move them around on your device. Might check it out. ( I think there's an iPad version of the app, but I have the iPhone version and it works, just not as pretty)
    THere's also Goodreader, but I don't have experience with it to know if it has folder abilities.

  • What is the best way to preorder multiple iPhone 6s and take advantage of the $200 trade in deal?

    Here's my scenario.
    Currently: I have 2 iPhone 4 and 1 iPhone 4S
    Plan: Upgrade all three to iPhone 6 Plus (16GB)
    What is the best way to do the $200 trade in deal for each of the old phone?
    http://www.verizonwireless.com/support/faqs/Equipment/trade_in_program.html#iPhone Trade-in Promotion
    1. When I preorder at 12:01 AM do I have to pay $300 or $100 for each?
    2. Do I have to send the old iPhones first in order to get the $200 gift cards?
    What should I do to make sure each preorder can be discounted?

        Vice_Actual,
    Thank you so much for reaching out to us. We are super excited about the launch of the new iPhone. In order to get the trade in deal you would need to trade in the device and then you would get a Verizon Wireless gift card mailed out to you. If you pay for the devices with a credit card on pre-order the card will not be charged until the devices are shipped.
    KevinR_VZW
    Follow us on Twitter @VZWSupport

  • What is the best way to delete folders and collections from Library?

    I have approximately 500 photographs in folders and collections. Want to delete them and start over. What is the best way to go back to Lightroom 5 cc as it was when initially downloaded?
    Using Mac running Maverick.
    Thanks for your help

    File>New Catalog and start over.
    The 500 images will stay put where they are and you can choose to import them again into the pristine catalog.

  • What is the best way to manage multiple devices with one iMac - different users with seperate itunes accounts or one mac user with different itune logons and libraries?

    Hello
    I have just purchased an imac which I am very happy with.  In our household we also have two iphones (one mine and one husbands) and one ipod (my sons). We all have individual itunes accounts set up on our previous computer (not a mac). We have sepereate apps and music, although there may be the odd occasion where we would like to share a song (if this is possible) across devices.
    I am just wondering the best way to manage these devices using the new imac.  Should I create individual accounts to logon to the imac, then from within these launch our own itunes accounts and sync our devices with these.  Or should I be using one version of itunes, logging on to this with our different itunes usernames and storing things in libraries.
    Any help would be greatly appreciated. 
    Thanks

    I am presuming that we cannot share downloaded apps and music between accounts because of the copyright issue,
    Though I'm no copyright lawyer, as long as it's within a household, you can share content among users. Such sharing is, absent specific language preventing it not present in the iTunes Store terms of use, generally considered to be "personal use". So you can share apps and music amongst your users on your computer and with their devices. You just can't give any of that content to friends or relatives who don't live with you.
    What I am not clear on, it making sure that this appears in each itunes account - is it easy to find the file storage folders that match the itunes accounts and what would these be?
    The iTunes library and files are by default in a user's Home/Music folder. But you don't have to find the folder; in fact putting a file into the folder yourself won't add the file to iTunes. Just drag the file into the iTunes window. iTunes will copy it to the correct location.
    Regards.

Maybe you are looking for

  • How to mute ALL audio in one single go in an edited multicam clip?

    Hi there I'm having to replace some audio in an already edited multicam clip. (there are mulitple audio parts I'm replacing by the way) How can I mute ALL of the audio in one go, as I have about 400 cuts and am currently having to mute one by one per

  • Game center wont let me log in and keeps starting itself whenever i try to play chess

    game center wont let me log in with my apple id, and it also starts itself whenever i click on anything in chess, so i cant play at all, it is really frustrating, and i cant figure out how to turn game center off, or make it behave.

  • Can someone take a look at site with IE 6

    I have a site I am trying to get launched but just found out IE 6 is displaying the content of the Spry Tabbed Panel down below the left Div. It might be a Double Float Margin problem. Does anyone have IE 6 on their computer that can tell me if it is

  • How to find internal table fields from which table.

    Hello Experts, I have to use a dynamic select inner join query. SELECT (lv_string)   FROM (from_tab)   INTO CORRESPONDING FIELDS OF TABLE <fs_itab1>   WHERE (where_tab). ELSEIF table_1 NE ''.   SELECT *   FROM (table_1)   INTO CORRESPONDING FIELDS OF

  • OSX Lion & Prod. Prem. CS5.5 Compatibility

    I'm one of those who Apple betrayed with their abandonment of their Pro Video customers, and along with masses of my fellow colleagues, have happily switched to Production Premium. I am the owner of a small production company for 11 years, with sever