Best practice needed: how to dynamicly change rowset for a dataTableModel

Hello creator folk,
I need an advice on the following problem.
I start from the insertUpdateDelete tutorial, and I stick to the very first part - creation of the first page with a dropdown and at table.
Now I add a second dropdown to add another control level on my table, on tripType for example - simple, it work without problem.
My problem: my dropdowns have a "off" value - that is a value indicating that the filtering according to this value should be disabled. For example, i want to filter displayed data according to person, tripType, or both.
As a result, we now have 3 different request, one with personId = ?, one with tripTypeId = ? and the last one with both. But the displayed table is the same.
I already done such a page, by using the "rendered" option: my JSP contains 3 time the same page, each with a dedicated rowset, but only one is rendered at a time. But I don't like this solution, it is a hell to maintain, and I don't want to imagine if my client ask for a third dropdow!!!
Another possibility: create a separate page for each possibility. Well, quite the same than the previous one.
Is it possible at runtime level to change the command associated to a rowset, and then to the linked RowSetDataModel? I tried the following way:
In the constructor of the page:
            if (isPersonAndTripType()) {
                myRowSet.setCommand(REQUEST_PERSON_TRIPTYPE);
                myDataTableModel.setObject(1, this.getSessionBean1().getPersonId());
                myDataTableModel.setObject(2, this.getSessionBean1().getTripTypeId());
            } else if (isTripTypeOnly()) {
                ewslive_lasteventIlotRowSet.setCommand(REQUEST_TRIPTYPE);
                myDataTableModel.setObject(1, this.getSessionBean1().getTriptypeId());
            } else {
     // the default rowset, no change.
                myDataTableModel.setObject(1,
this.getSessionBean1().getPersontId());
            myDataTableModel.execute();And in each dropdown_processValueChange, after updating tripId or personId:
            if (isPersonAndTripType()) {
                myRowSet.setCommand(REQUEST_PERSON_TRIPTYPE);
                myDataTableModel.setObject(1, this.getSessionBean1().getPersonId());
                myDataTableModel.setObject(2, this.getSessionBean1().getTripTypeId());
            } else if (isTripTypeOnly()) {
                ewslive_lasteventIlotRowSet.setCommand(REQUEST_TRIPTYPE);
                myDataTableModel.setObject(1, this.getSessionBean1().getTriptypeId());
            } else {
          myRowSet.setCommand(REQUEST_PERSON);
                myDataTableModel.setObject(1,
this.getSessionBean1().getPersontId());
            myDataTableModel.execute();First run (one person selected by default), everything is OK. But when I change a dropdown I got an exception: the page constructor is called, all ok. The dropdown_processValueChange is called, the correct request is linked to the dataTableModel, and the function return normally, then the exception occures:
Exception Details:  javax.faces.el.EvaluationException
  javax.faces.FacesException: java.sql.SQLException: [OraDriver] Not on a valid row.
Possible Source of Error:
   Class Name: com.sun.faces.el.ValueBindingImpl
   File Name: ValueBindingImpl.java
   Method Name: getValue
   Line Number: 206 Help needed!!!

I've done something similar in my current app, the only difference I see being that I retrieve the value from the dropdown directly rather than going through the sessionbean as I don't need to save the selection.
I've managed to iron out all the bugs and it works well now. Not near my development machine or I'd post the code. I do have a couple of questions:
Why do you have the if/else setup in the constructor? If the page is being called for the first time I don't see why you need it.
Why do you useewslive_lasteventIlotRowSet.setCommand(REQUEST_TRIPTYPE);instead ofmyRowSet.setCommand(REQUEST_TRIPTYPE);?
I think this is causing your problem as you haven't shown where you set the datacache for myDataTableModel
to ewslive_lasteventIlotRowSet instead of myRowSet.
You can also set all of your dropdowns to use the same event handler, cuts down on the duplicate code :)

Similar Messages

  • Best Practices Question: How to send error message to SSHR web page.

    Best Practices Question: How to send error message to SSHR web page from custom PL\SQL procedure called by SSHR workflow.
    For the Manager Self-Service application we’ve copied various workflows which were modified to meet business needs. Part of this exercise was creating custom PL\SQL Package Procedures that would gather details on the WF using them on custom notification sent by the WF.
    What I’m looking for is if/when the PL\SQL procedure errors, how does one send an failure message back and display it on the SS Page?
    Writing information into a log or table at the database level works for trouble-shooting, but we’re looking for something that will provide the end-user with an intelligent message that the workflow has failed.
    Thanks ahead of time for your responses.
    Rich

    We have implemented the same kind of requirement long back.
    We have defined our PL/SQL procedures with two OUT parameters
    1) Result Type (S:Success, E:Error)
    2) Result Message
    In the PL/SQL procedure we always use below construct when we want to raise any message
    hr_utility.set_message(APPL_NO, 'FND_MESSAGE_NAME');
    hr_utility.raise_error;
    In Exception block we write below( in successful case we just set the p_result_flag := 'S';)
    EXCEPTION
    WHEN APP_EXCEPTION.APPLICATION_EXCEPTION THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    WHEN OTHERS THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    fnd_message.set_name('PER','FFU10_GENERAL_ORACLE_ERROR');
    fnd_message.set_token('2',substr(sqlerrm,1,200));
    fnd_msg_pub.add;
    p_result_message := fnd_msg_pub.get_detail;
    After executing the PL/SQL in java
    We have written some thing similar to
    orclStmt.execute();
    OAExceptionUtils.checkErrors (txn);
    String resultFlag = orclStmt.getString(provide the resultflag bind no);
    if ("E".equalsIgnoreCase(resultFlag)){
    String resultMessage = orclStmt.getString(provide the resultMessage bind no);
    orclStmt.close();
    throw new OAException(resultMessage, OAException.ERROR);
    It safely shows the message to the user with all the data in the page.
    We have been using this construct for a long time for all our projects. They are all working as expected.
    Regards,
    Peddi.

  • Best practices on how to implement logging in custom application

    In the Enterprise Manager it is possible to display/browse the content of different log files generated by the application server modules.
    I have some custom web applications which currently use the log4j framework to write to log files. Is it possible to make these log files accesible for the Enterprise Manager ?
    Or what is the best practice on how to implement logging in custom applications which can be browsed in the Enterprise Manager (I do not want to use system.out)

    I thought that this could be done. An ex- colleague did this - but he didn't tell me how to solve this.
    But as it just took 10 minutes to solve this I believe it's fairly easy.
    cu
    Andreas

  • How to dynamically changes items properties

    How to dynamically changes items properties likes position order in tabular view, width, prompt

    Many object properties can be set programmatically at runtime. For example, each window object has a Visible property that can be set to either Yes or No to show and hide the window. At runtime, you can call the built-in procedure SET_WINDOW_PROPERTY to show or hide the window dynamically, as shown here:
    Set_Window_Property('my_window',VISIBLE, PROPERTY_ON);
    The following built-in procedures are available for setting object properties at runtime:
    -     SET_BLOCK_PROPERTY
    -     SET_CANVAS_PROPERTY
    -     SET_FORM_PROPERTY
    -     SET_ITEM_PROPERTY
    -     SET_LOV_PROPERTY
    -     SET_MENU_ITEM_PROPERTY
    -     SET_PARAMETER_ATTR
    -     SET_RADIO_BUTTON_PROPERTY
    -     SET_RECORD_PROPERTY
    -     SET_RELATION_PROPERTY
    -     SET_VIEW_PROPERTY
    -     SET_WINDOW_PROPERTY
    The built-in procedure SET_ITEM_PROPERTY can be used to set the properties of any type of item, including buttons, text items, check boxes, radio groups, etc.
    Note: Radio group items include individual radio buttons; use SET_ITEM_PROPERTY to set the properties of the radio group, and SET_RADIO_BUTTON_PROPERTY to set the properties of the individual buttons in the group.
    Each built-in SET procedure has a corresponding GET function that allows you to programmatically determine the current setting of an object's properties. The following example uses GET_WINDOW_PROPERTY to determine if a window is currently hidden (VISIBLE = FALSE). If the window is hidden, SET_WINDOW_PROPERTY is called to show the window.
    If Get_Window_Property('my_window',VISIBLE) = 'FALSE' THEN
    Set_Window_Property('my_window',VISIBLE,PROPERTY_ON);
    To determine if a particular property can be set programmatically, refer to the property descriptions in online Help.

  • How do the change management for the configuration of the adapters

    Hi all.
    How do the change management for the configuration of the adapters, when i transport the software version component from an development system to production system.
    For example, for to change the url parameters of adapters soap inside the production system. I will need type, the news values in this system?
    Thanks
    Best Regards.

    There is an option to pass all the paramters except those who changes from
    system to system.
    for example,
    if you are reading from a file from the directory: <SYS>\CREMAS_<TS>.XML
    when <SYS> is DEV or QAS or PROD, and <TS> is time stamp,
    you can create channel template that read file with file pattern CREMAS_*.XML,
    this can save you a lot of work, however, parameters that are diffrent in every system, (in this case the directory DEV,QAS,PROD) you must enter manually in every system.

  • How do I change platform for downloading and installing Photoshop Elements from Windows to Mac?

    How do I change platform for downloading and installing Photoshop Elements from Windows to Mac?

    As long as your license supports both platforms you should only have to download the Mac version and install/activate using your serial number.  If you need help finding a link to download the file, please indicate the PSE version you need.

  • How to get change log for z-fields in VBAk(Sales order)

    Hi All,
    Please help me in this.
    My requirement is get the change log for z-fields in sales order.
    In the sales order header level we have one tab Additioanl data.
    In this we have z-fields, if we change any of the field value, it is accepting the same and updating in data base as well.
    But it is not appearing in change log<. I.e. Environment->changes.
    How to get the change log for the z-fields.
    In data element level enable the check box of change document.
    Please help me in this.
    Thanks in advance
    Jaya,G

    Hi Jaya,
    For this you need to do some coding. Here is a link which tells you, step by step procedure how to activate Change log for the Z tables.
    THe Object that you need to use for Sales Document   is VERKBELEG
    [https://wiki.sdn.sap.com/wiki/display/ABAP/Maintaining%20Change%20Log%20for%20Database%20Tables]
    Hope this helps..
    This is Primarily a Technical Consultant Job. Take his help before you make any changes.
    Thnks
    Srini

  • How to implement Change pointers for Purchase order - ME22N - Custom Fields

    Hi Experts,
    Can you please tell me how to implement - Change Pointer for Custom fields in IDOC.
    I am working on IDOC - For purchase order - acknowledgements - in custom screen/tab in ME22N.
    Everything is working fine according to my requirement.
    All i need to know is the process of - Creating/Change - Change pointers for Custom fields.
    1.How to implement change pointers for custom fields.
    2.Can we maintain - Change Document - for custom fields at data element level?
    P.S. - I have browsed many previous - forums before posting a new discussion.
    please share your inputs...
    explaining how to create/implement - change pointers for custom fields will help me .
    Regards,
    Karthik Rali.

    Hi,
    To maintain Change Document for custom field:
    1. Check if "Change document" checkbox is set in data element.
    2. Find Change Document Object for transaction.
       You can use SQL trace - ST05.
       Look there for line with table CDHDR and statement insert values
       (for example for transaction KA02 Change Document Object is KSTAR)
    3. Regenerate update program for this Change Document Object in transaction SCDO
    Change documents for z-fields schould be generated.
    I am not sure about change pointers but they are configured somehow in BD61 and BD50.

  • Need to create a Change document for tracking Purpose on standard table

    Hi Experts,
    I am updating a field in standard table so need to create a change document for tracking the changes being done on the field.
    I created the change Document with transaction SCDO but I am stuck at point - How to call that in the report program to enable the change document.
    Please advice.
    Thanks!!

    Hi
    U can assign your transaction to Z-report like this:
    PARAMETERS: TAB1 RADIOBUTTON GROUP R1 DEFAULT 'X',
                TAB2 RADIOBUTTON GROUP R1,
                TAB3 RADIOBUTTON GROUP R1.
    DATA: TABNAME TYPE TABNAME.
    START-OF-SELECTION.
      CASE 'X'.
        WHEN TAB1. TABNAME = 'BSID'.
        WHEN TAB2. TABNAME = 'BSAD'.
        WHEN TAB3. TABNAME = 'BKPF'.
      ENDCASE.
      CALL FUNCTION 'RS_TABLE_LIST_CREATE'
        EXPORTING
          TABLE_NAME               = TABNAME
    *   ACTION                   = 'ANZE'
    *   WITHOUT_SUBMIT           = ' '
    *   GENERATION_FORCED        =
    *   NEW_SEL                  =
    *   NO_STRUCTURE_CHECK       = ' '
    *   DATA_EXIT                = ' '
    * IMPORTING
    *   PROGNAME                 =
    * TABLES
    *   SELTAB                   =
       EXCEPTIONS
         TABLE_IS_STRUCTURE       = 1
         TABLE_NOT_EXISTS         = 2
         DB_NOT_EXISTS            = 3
         NO_PERMISSION            = 4
         NO_CHANGE_ALLOWED        = 5
         OTHERS                   = 6
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • How config dynamic arp inspection for 300 or 500 series ?

    Hi Cisco Expert ,
    How config dynamic arp inspection for 300 or 500 series ? Do you have clearly document for this solution ? Could you please to share ?
    i find in admin guide it's no simple to do
    Thank you for kindly support.

    Hi Siriphan, using the command line is the easiest way to deal with this.
    You need to understand the difference between trusted  and untrusted interfaces. The untrusted interfaces are the ports that  will be inspected and if not specified within the arp entry list then  will get dropped.
    Any port you do not want arp inspection to be a part of, you need to trust that port.
    Below is how to make a port trusted.
    configure terminal
    interface fe1
    ip arp inspection trust
    Once you establish the trusted ports, you can build your arp list.
    configure terminal
    ip ap inspection list create ARP_INSPECTION  (the word after the create can be anything you want)
    ip 192.168.100.3 mac-address 64:31:50:1c:50:a1
    This  is the example of adding 1 entry to your arp list. You can add128 of  these entries. These IP/mac binds are the devices that are "safe" from  being dropped.
    Lastly, you need to enable the arp  inspection globally. You DO NOT want to toggle the arp inspection  without establishing your interfaces or bind list. If you do not  establish your trust interfaces and list first, you will lock down any  connection through the switch and essentially brick it.
    To toggle the global arp inspection
    configure terminal
    ip arp inspection
    Once you're done, save your running config to the start up config.
    -Tom
    Please mark answered for helpful posts

  • Picture Book theme - why has my book printed with text box outlines showing? and how do I change this for any future purchases? This did not occur with previous books.

    Why have borders appeared around the text boxes in the Picture Book theme and how do I change them for the future.  My latest book looks dreadful!

    Have you checked, if your book is really set to the "Photos" Theme? This looks like you may have used one of the "Travel" themes. These themes create borders around the text boxes. When you select a theme, the book title will say "Photos", even if the theme is a different one.
    For example, frames text boxes with the "travel" theme.
    Have you previewed your book, before printing it? Did the framed boxes already show in the preview?
    See: Previewing an order in iPhoto or Aperture
    Regards
    Léonie

  • How do I change installer for Elements 12 to 64bit ?

    How do i change installer for Photoshop Elements 12 to 64 bit (I mistakenly selected the other bit option because there was NO ADVICE On WHAT TO SELECT).  Now I try to complete installation of a purchased product, and just keep getting stonewalled with same error message with no advice on how to fix!

    Hi Gordon
    You should not have to make any selection. The program automatically installs the appropriate version. On Windows 64 bit it will install in Program Files and on 32 bit systems in Program files (X86).
    http://www.adobe.com/uk/products/photoshop-elements/tech-specs.html

  • How to dynamically change the text of a TextObject with embedded DataField?

    Hi
    I'm trying to dynamically change the text of a TextObject at runtime, by using the .NET library. My problem is that if one or more DatabaseFieldDefinition is embedded inside my text, I'm unable to change the "static text" only, by keeping the field, e.g. I have :
    Text1 => "Contact Name: {Contact.Name}"
    and I'd like to change it to anything else like:
    Text1 => "Nom du Contact: {Contact.Name}"
    Half of my TextObject is static text while second part comes from the dataset.
    (of course the translation is dynamic - it is called at run-time and the new value to be set depends on the calling application language)
    If I simply modify the Text property of my TextObject, the {Contact.Name} embedded field is not evaluated anymore by the Crystal Engine, but considered as a single text.
    Using formulas or parameters looks quite difficult, because it means having many ones just for translation needs - I cannot control the way my users will create their reports and "force them" to use complex methods just in order to put a text and a value together...
    Anyone knows how to deal with that ?

    Only way I can think of doing this:
    1) Create a formula (call it lang) and enter the string "Contact Name" in it
    2) Place the  {Contact.Name} field next to the string
    3) So now you have:
    ContactName:  {Contact.Name}
    4) Check what localization you are after. If you need "Nom du Contact", change the lang formula so it shows "Nom du Contact" using the code below:
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim Report As New CrystalReport1()
    Dim FormulaFields As FormulaFieldDefinitions
    Dim FormulaField As FormulaFieldDefinition
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FormulaFields = Report.DataDefinition.FormulaFields
    FormulaField = FormulaFields.Item(0)
    FormulaField.Text = "[formula text]"
    CrystalReportViewer1.ReportSource = Report
    End Sub
    I realize this may not give you consistent spacing as the translations may have strings of differnt length. Perhaps someone has other idea(s)...

  • How To dynamically change values in custom form

    Hi,
    Requirement is to change values in custom form dynamically that are passed by Global variables through standard form .
    I have used forms personalization to call custom form and passing some parameters to custom form using global variables.
    Now i have to change values displayed in custom form(already opened) when user moves from one record to another record.
    I cannot change the standard form.Only i have write logic in custom form that dynamically changes values as user moves from one record to another in standard form.
    Global variables values will be different for each record.
    Pls let me know how i can achieve this.
    Regards
    Udit

    Udit,
    Your question should be posted to the Enterprise Business Suite (EBS) forum. This forum is dedicated to non-EBS forms development.
    Craig...

  • Best Practice Needed: Global Application Properties...

    Hi All,
    When developing a web-based application that reads certain configurable parameters from .properties files, I usually put the appropriate code in a static block in the appropriate Java class, storing the property in a static final constant. For example, a DBConnection class might have a static block that reads the driver, username, and password from a properties file.
    My question is, what are some "best practice" techniques for accessing and storing such parameters for use in an application? Are all global properties initialized in one class? at the same time? only when first needed?

    over all, I would say that your approach is fine. Personally, I load properties through a single class, some thing like PropertyReader, and have the different classes initialize their static fields via a get method on that class, like getProperty("db.user"). I prefer to load them via a single class because I can place all of my IO trapping in one location, it is easier to implement new security measures and, if necessary, easier to support internationalization.
    I initialize all properties once, at startup, into a Wrapper Object, typically ResourceBundle or Properties (although Hashtable or any some thing else would be suitable). I believe that it is best to initialize all properties at the same time, at startup because the costs of storing properties that may not be used is going to be less then the cost of making multiple IO calls to load properties on a need-by-need basis. In other words, you are almost always going to take a bigger performance hit by loading properties only when a request for that key is received, rather then just loading them all at once.

Maybe you are looking for

  • Print-Settings @ SAP

    Hi  all. How to Set <b>Print-Settings @ SAP</b>. if any tranaction available. for eg. if i want to set my print-settings like locl, mll @ SAP. how to set.

  • General questions 2

    hi 1. which of the following regarding I/p tax r correct? a.u can use i/p and o/p tax code in invoice verification b.u can use different tax code in a invoice c.the i/p tax can't be calculated by the system always it is entered manually d.if taxcodes

  • Can I copy an entire page without having to format it all over again?

    Can I copy an entire page without having format it all over again? Can I basically do a copy and paste onto a new page?

  • Getting Older Flash Player Reinstalled

    I need to get Adobe 11.7 reinstalled. I've had nothing but problems with Chrome-based Pepper Flash Player. I installed your other 11.8 version and am having problems with it as well. Please advise as to how I can get the 11.7 version back.

  • Expert system in Java

    i learned about Jess , a Java-based tool used to develop expert systems through this forum...it's quite useful though coz i'm on the verge of developing my own system, which contains NLP(natural language processing) features as well...any comments? o