How to filter data in JSP?

Hi All,
I have to filter data before I can display a drop down in my JSP. The scenario is as follows
There are 2 buttons on screen A. Button B1 and button B2.
Clicking on any one of these will result in screen B being displayed.
But if B1 is clicked then option 'ABC' should not be displayed in my dropdown.
If B2 is pressed only ABC should be displayed in the same field. (this is not a drop down now).
The current code snippet to fetch the data from the DB and display in the dropdown is:
<tr>
<td align="right" class="label" scope="row">
<span class="red"><html:label name="*" fieldId="<sectionId>.reasonId"/></span> 
<html:label name="Reason:" fieldId= "<sectionId>.reasonId" />
</td>
<td colspan="2">
<html:select name= "VoidPaymentForm" property = "paymentHeader.reasonId"
fieldId = "<sectionId>.paymentHeader.reasonId" onchange="voidPaymentNSF();">
<refdata:load id="listReason" source="<%=RefDataConstants.REASON %>"
name = "VoidPaymentForm" property="paymentHeader.reasonId"
parentSource="<%=RefDataConstants.ACCOUNTING_TRANSACTION_TYPE%>"
parentCodeValue="reasonCodeRef" />
<html:option value=""> </html:option>
<refdata:options collection="listReason" labelProperty="label" property="value"/>
</html:select>
</td>
</tr>
Appreciate your help.
Thanks and Regards,
Ashley

first, your screen A needs to send the information which button has been clicked. Then screen B needs to retrieve this value, if I'm not mistaken (it has been a view years ago, that I've written JSPs), you can put the html code within an if-statement. So, only when the condition is true, it will use the html code within.

Similar Messages

  • How to filter data

    Dear Friends
    How to filter data by entering data in the field then the data filtered according to the data that is enter the filed
    For example
    If I have a list of values in the field EMPNO , and If I enter ‘S’ at the field EMPNO before pressing F9
    it should display those employees only when I press F9 as the following :
    SMITH
    SCOTT
    And if enter ‘AL’ it should display those employees only when I press F9 as the following:
    ALLEN
    ALI
    But if don’t enter any value in EMPNO and press F9 Then It should display all the All the employee’s name as the following
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    ALI
    ABDULLAH
    Waiting for your valuable answer .
    Best regards
    Jamil Alshaibani

    Dear Rosario
    I have SET THE ITEM PROPERTY VALIDATE FROM LIST TO YES
    Of the field EMPNO ON WHICH I HAVE ASSIGN THE LOVE.
    And also I have written the script as the following:
    SELECT ENAME,EMPNO FROM EMP
    WHERE EMP.ENAME LIKE :EMPNO||'%'
    Then I type ‘S’ in the field EMPNO and I press F9 it is not responding for displaying the list of values it is displayed this message in the status bar ‘FRM-40502: ORACLE ERROR :UNABLE TO READ LIST OF VALUES .
    Waiting for valuable answer in details.
    Best regards
    Jamil Alshaibani

  • HOW TO FILTER DATA FROM MICROSOFT ACCESS

    HOW TO FILTER DATA FROM MICROSOFT ACCESS BASED ON DATE AND TIME AND GIVE THE RESULT TO A TABLE ?
    I need some example files , can anybody please help me ?
    Solved!
    Go to Solution.

    Just be sure to get examples specific to the Jet DBMS. It is rather "idiosyncratic" when dealing with time and date values.
    One question: the timestamp is being saved in a datetime field, right?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to export data in JSP to MS excel

    hi frens..
    anyone out there knows how to export data in JSP to Ms excel .. i already add this code inside my jsp..
    <%@ page contentType="application/vnd.ms-excel" %>i need to retrieve the data from the database to excel.. it's something like a report display in the excel.

    set the response type as....
    response.setContentType("application/vnd.ms-excel");
    U must be geting the data from the database...
    get the data ...
    rs=st.executeQuery(sql);
    where sql is ur query and use it as usual....

  • How to filter data from a source XML? Please help!

    Hi Experts,
       I have a source XML as shown below:
        <Inventory>
         <InventoryItem>
           <ItemCode>InTransit</ItemCode>
           <Quantity>1000</Quantity>
         </InventoryItem>
         <InventoryItem>
           <ItemCode>Available</ItemCode>
           <Quantity>1500</Quantity>
         </InventoryItem>
         <InventoryItem>
           <ItemCode>Restricted</ItemCode>
           <Quantity>2500</Quantity>
         </InventoryItem>
        </Inventory>
    My Target XML is as below
        <Inventory>
          <stock>1500</stock>
        </Inventory>
    The stock element contains Quantity value where ItemCode is 'Available'.
    But note that there are 3 InventoryItem nodes.
    So how to get the desired target XML in XI mapping? Basically I have to filter data from source XML based on value of an element. What is the best approach to handle this?
    Kindly help
    Thanks
    Gopal

    Hi venkat,
              Your solution does'nt work fine. But why are you using collapsecontext and splitbyvalue before putting the value into stock element?
               Kindly explain your concept.
    My target message is:
    <?xml version="1.0" encoding="UTF-8"?>
    <Inventory>
       <InventoryItem>
          <ItemCode>InTransit</ItemCode>
          <Quantity>1500</Quantity>
       </InventoryItem>
       <InventoryItem>
          <ItemCode>Available</ItemCode>
          <Quantity>1000</Quantity>
       </InventoryItem>
       <InventoryItem>
          <ItemCode>UnRestricted</ItemCode>
          <Quantity>2000</Quantity>
       </InventoryItem>
       <InventoryItem>
          <ItemCode>Available</ItemCode>
          <Quantity>2500</Quantity>
       </InventoryItem>
    </Inventory>
    I am getting the output even though stock is unbounded and I have used collapsecontext and splitbyvalue as:
    <InvStock>
      <Stock>1000</Stock>
    </InvStock>
    I should get:
    <InvStock>
      <Stock>1000</Stock>
      <Stock>2500</Stock>
    </InvStock>
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga

  • How to filter data in Graphs?

    Hi,
    i want to filter data in graph. can anyone provide me links or information how to put filters as well as sorting.
    Thanks,
    Lax

    Re,
    see attached files :
    1) the signal non filtered
    2) the signal filtered with a parameter 0.9999999
    3) the signal filtered with a parameter 0.9999
    I didn't understood what you wanted to remove from your signal : is it the peaks, or the noise ?
    let me know if it's good for you, and I will send you the VI in 8.5 (or in 8.0 if you want)
    Best regards,
    Vincent
    V-F
    Attachments:
    filtered 0,9999.JPG ‏186 KB
    non filtered.JPG ‏185 KB
    filtered 0,9999999.JPG ‏189 KB

  • ESH modeler - how to filter data

    Hi,
    I've setup indexing in TREX in Enterprise Search for activities data from CRM (in ESH_COCKPIT). But now I need to filter data available in this search. I want to index only some particular activities types in TREX. How I can do it?
    (BADI, esh_modeler, or else)?
    BR
    Radek

    Hi Radek,
    To achieve this You'll have to add an entry to the table WFCD_ES_BOL_QPAR (Assign parameters to BOL extraction query). For example:
    Let's say You've created a search connector for activities (BUS2000126) and You want to limit the index only to some specific BT types.
    Needed table entry:
    SAP_SW_COMP: software component name (tab: general in the esh_cockpit for you connector)
    TEMPALTE_ID: same tab as above - field: model
    BOL_QUERY: can be found in table WFCD_ES_BOL_Q using above two fields as the key
    SEQUENCE_NUM: 01 if there's no other entry with this key or just a next free number
    ATTR_NAME: PROCESS_TYPE
    SIGN: I
    OPERATOR: EQ
    LOW: ZXXX
    where ZXXX is Your BT type
    Please remeber to recreate the index after adding the entry(ies).
    BR,
    Z.

  • How to filter data by list item

    hi all,
    I create list item on block BLK1 ,
    name :emp_name
    item type: list item
    elements in list : list_elements : (null) list_item : (null)     
    data type : Char
    maximum length : 200
    and create PROCEDURE :
    PROCEDURE POPULATE_LIST_BY_QUERY(P_LIST_NAME VARCHAR2,P_QUERY VARCHAR2) IS
       RG_NAME  VARCHAR2(30) := 'RG_CODE_DESC' ;
       RG_ID    RecordGroup;
       errcode  NUMBER;
       LIST_ID  ITEM;
    BEGIN
         RG_ID := FIND_GROUP(RG_NAME);
         IF NOT ID_NULL (RG_ID)
            THEN DELETE_GROUP (RG_ID) ;
         END IF;
         RG_ID   := Create_Group_From_Query (RG_NAME, P_QUERY) ; 
         errcode := Populate_Group (RG_ID) ;  
         LIST_ID := FIND_ITEM (P_LIST_NAME) ;
         POPULATE_LIST (LIST_ID,RG_ID) ;
    END;and wrote in trigger WHEN_NEW_FORM_INSTANCE:
      POPULATE_LIST_BY_QUERY('BLK1.emp_name', 'SELECT emp_name,emp_id FROM employees');
    create table employees
    (emp_no number(10) primary key,
    emp_name varchar2(200))
    Insert into EMPLOYEES
       (EMP_NO, EMP_NAME)
    Values
       (1, 'hhh uuo');
    Insert into EMPLOYEES
       (EMP_NO, EMP_NAME)
    Values
       (2, 'hh ppp');
    Insert into EMPLOYEES
       (EMP_NO, EMP_NAME)
    Values
       (3, 'ph');
    Insert into EMPLOYEES
       (EMP_NO, EMP_NAME)
    Values
       (4, 'uuuuu');
    COMMIT;when Run my form list item give me all data, no problem ,ok
    My question is that can i want to filter data when write anythnig data is found im my list or part of data,
    show data only by my filter,
    for example:
    I wrote in my list : hh
    show data in list:
    hhh uuo
    hh ppp
    I wrote in my list : h
    show data in list:
    hhh uuo
    hh ppp
    ph
    I wrote in my list : uu
    show data in list:
    uuuuu
    if not wrote anything fetch me all data,
    Thanks a lot

    Hi,
    You can try,
    POPULATE_LIST_BY_QUERY('BLK1.EMP_NAME', 'SELECT EMP_NAME, EMP_ID FROM EMPLOYEES WHERE EMP_NAME LIKE ''' || <your_search_variable> || '%''');Hope this helps.
    Regards,
    Manu.

  • Oracle Apps Custom Form, How to Filter data in the LOV

    Detail Data Block I am Calling One LOV, Based on Master Block Item I want to filter data in the LOV.
    in the select statement
    SELECT * FROM MTL_SYSTEM_ITEMS WHERE
    ORGANIZATION_ID = :BLOCK_NAME.FIELD_NAME
    specified
    but it is showing no data found error.

    Do this:
    MESSAGE(:BLOCK_NAME.FIELD_NAME);
    MESSAGE(:BLOCK_NAME.FIELD_NAME);
    SELECT * FROM MTL_SYSTEM_ITEMS WHERE
    ORGANIZATION_ID = :BLOCK_NAME.FIELD_NAME
    This will tell you the value of BLOCK_NAME.FIELD_NAME
    Then use PLSQL and run the query using the value of BLOCK_NAME.FIELD_NAME
    and see if you get data. If you don't get data using PLSQL, then you won't get data using LOV.

  • How to filter data of itab retrived from infotype.

    Hi all,
      I am trying to filter data for one internal table (ex: IT_FINAL ) by comparing those values from standard table (ex: PA0000).First I had successfully uploaded all data from presentation server, Now I want to compare all field value (ex: PERNR)  from internal table (IT_FINAL-PERNR) and standard table (PA0000-PERNR).If there is no matching record. then move those records to  another internal table (ex: IT_ERROR).
      I had tried by keeping that comparing code in loop. But I am not getting what i want.
    I am sending my code here.. please suggest me to solve this issue.
    SOURCE CODE *****************
    ************************D E C L E R A T I O N********************
    TABLES: PERNR, PA0000.
    TYPES : BEGIN OF t_final,
             PERNR TYPE PERNR_D,
             BEGDA TYPE CHAR10,
             ENDDA TYPE CHAR10,
             SUBTY TYPE SUBTY,
             FANAM TYPE PAD_NACHN,
             FAVOR TYPE FAVOR,
             GESC2 TYPE GESC2,
             GESC1 TYPE GESC1,
             FGBDT TYPE CHAR10,
            END OF t_final,
            BEGIN OF t_raw,
             line TYPE char100,
            END OF t_raw.
    DATA : it_final TYPE STANDARD TABLE OF t_final,
           it_raw   TYPE STANDARD TABLE OF t_raw,
           it_error TYPE STANDARD TABLE OF bdcmsgcoll.
    DATA : wa_final TYPE t_final,
           wa_raw   TYPE t_raw,
           wa_error TYPE bdcmsgcoll.
    ********************S T A R T - O F - S E L E C T I O N********
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'E:\Suri_test\BDC_TEST\test02.txt'
       FILETYPE                      = 'ASC'
      TABLES
        DATA_TAB                      = IT_RAW.
    IF SY-SUBRC EQ 0.
    LOOP AT it_raw INTO wa_raw.
          SPLIT wa_raw
             AT '/'
           INTO WA_FINAL-PERNR
                WA_FINAL-SUBTY
                WA_FINAL-BEGDA
                WA_FINAL-ENDDA
                WA_FINAL-FANAM
                WA_FINAL-FAVOR
                WA_FINAL-GESC2
                WA_FINAL-GESC1
                WA_FINAL-FGBDT.
      WRITE:/   WA_FINAL-PERNR,
                WA_FINAL-SUBTY,
                WA_FINAL-BEGDA,
                WA_FINAL-ENDDA,
                WA_FINAL-FANAM,
                WA_FINAL-FAVOR,
                WA_FINAL-GESC2,
                WA_FINAL-GESC1,
                WA_FINAL-FGBDT.
    APPEND WA_FINAL TO IT_FINAL.
    CLEAR WA_FINAL.
    ENDLOOP.
    NOW I GOT RECORDS IN IT_FINAL.*******************
    LOOP AT PA0000 ??????????.
    IF PA0000-PERNR EQ WA_FINAL-PERNR.
    WRITE:/   WA_FINAL-PERNR,
                   WA_FINAL-SUBTY.
    ELSE.
    WRITE:/ 'HELLO NOT MATCHED DATA.'.
    move to IT_ERROR.??????????
    ENDIF.
    ENDLOOP.
    ENDIF.
    ****************************TEST DATA*********************************************
    5/2/21.04.2007/31.12.9999/BOY/BATLANKI//X/21.04.2007
    54099520/12/02.03.2005/31.12.9999/SANTHI/BATLANK/X//20.10.1954
    3453/12/02.03.2005/31.12.9999/SANTHI/BATLANK/X//20.10.1954
    54099520/13/02.03.2005/31.12.9999/JAGAN/PYDIPALLI//X/25.01.1981
      Thanks in advance,
      Surender. B.V.

    There shouldn't be anything wrong with what you've done. e.g.
    SQL> set serverout on
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure show_empnos(p_deptno in number) is
      2    cursor cur_emps is
      3      select empno
      4      from   emp
      5      where  deptno = p_deptno
      6      order by empno;
      7  begin
      8    for e in cur_emps
      9    loop
    10      dbms_output.put_line('EmpNo: '||to_char(e.empno,'fm99999'));
    11    end loop;
    12* end;
    SQL> /
    Procedure created.
    SQL> exec show_empnos(10);
    EmpNo: 7782
    EmpNo: 7839
    EmpNo: 7934
    PL/SQL procedure successfully completed.
    SQL> exec show_empnos(20);
    EmpNo: 7369
    EmpNo: 7566
    EmpNo: 7788
    EmpNo: 7876
    EmpNo: 7902
    PL/SQL procedure successfully completed.
    SQL>Show us more of what you are doing and what it's not doing.

  • How to filter date with time

    Hi, with ADF 11.2.0 , i'm having a date column in the table which displays the date and time in the format of "yyyy-MM-dd hh:mm:ss.FF ". But the filter allows me to give only the date and i'm expecting to filter the records at least based the on the given date. But it's not working so. The reason i got in this forum is ,
    "The typical af:table setup has it such that the filter for a date column allows you to specify dates, but not times. When the filter queries against the database, *it defaults the date's time component to midnight*. As such only records that match the date at midnight will be returned."
    Based on the above statement , i guess no way for my scenario to filter the records based on date. Is there any way to filter data with time stamp. Thanks .

    What if you define a transient attribute in your VO that basically uses Trunc(dateField) as its value?
    Then show this attribute in the table for filtering.

  • AWM Newbie Question: How to filter data loaded into cubes/dimensions?

    Hi,
    I am trying to filter the amount of data loaded into my dimensions in AWM (e.g., I only want to load like 1-2 years worth of data for development purposes). I can't seem to find a place in AWM where you can specify a WHERE clause...is there something else I must do to filter data?
    Thanks

    Hi there,
    Which release of Oracle OLAP are you using? 10g? 11g?
    You can use database views to filter your dimension and cube data and then map these in AWM
    Thanks,
    Stuart Bunby
    OLAP Blog: http://oracleOLAP.blogspot.com
    OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
    OLAP on OTN: http://www.oracle.com/technology/products/bi/olap/index.html
    DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html

  • How to filter data in OWB.

    I have moved data from customer_adress table to target table.there are duplicates values in the customer table. i need to filter out the records from the customer table on the basis of max value for last_update_date cloum in case there are duplicate for the same customer_id. any help how do solve this proble will be grt help.
    Thanks,
    Ashvin.

    Hi Ashvin,
    you can use analytic functions for doing this.
    In SQL this looks like (if you use Oracle DBMS 9i ant later)
    select customer_id,
      min(last_update_date) keep (dense_rank LAST order by last_update_date) LAST_DATE,
      min(city) keep (dense_rank LAST order by last_update_date) LAST_CITY,
      min(street) keep (dense_rank LAST order by last_update_date) LAST_STREET
    from your_table
    group by customer_id
    [PRE]
    OWB 10g R2 directly supports FIRST/LAST analytic functions.
    Regards,
    Oleg                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to filter data in custom ADF JClient lov panel

    hi
    I'm developing with JDev 10.1.2.
    i have a Panel that use custom ADF JClient lov panel and i want to filter the lov data.
    i used setWhereClause() method to do it in lov panel but didn't work.
    Any help will be greatly appreciated.

    This was a lot more involved than I would have estimated (than I actually did estimate with my boss on our project timeline).
    Anyway, here is the solution for those of you trying to do the same thing;
    http://blogs.oracle.com/michaellee/2009/09/pre_filtering_table_data.html
    My personal request, create a Criteria for a VO, then allow me to just drag that over to a jsp page and give me a table/tree option, not just a query/button/link, and then give me a pop up box allowing me to bind variables.
    Edited by: user10419690 on Sep 14, 2009 9:03 AM

  • How to filter datas  and display in java

    Hi guys.
    I'm kind of new to Java,
    I've have a database where values are stored ,i just have to take one column and i got to filter one value and display all .
    is there a command to filter
    I just want to do that if that Not wanted value is there to ignore and display the rest of the data in the html when search is called.
    i have to do this in the java , not in jsp.
    mysql,hibernate,ejb,jsp are being used at my environment.
    please help

    Simply put you want to 'selectively' navigate through the collection of data. Here, is an alternative using Iterator pattern given below;
    Create an interface
    * Iterator interface has method declarations for iterating through
    * data.
    public interface Iterator {
      public MyData next(int current);
      public MyData prev(int current);
    }// End of interfaceNow, create implementation classes for the above interface and you can aptly name them based upon your filtering criteria
    public MyFlter implements Iterator {
    * next � method which takes the current data number
    * and returns the next selected data.
      public MyData next (int current) {
        MyData data = null;
        while desired data not found: iterate --> implement your selection criteria here
        return data
      }              Similarly implement the previous method.
    Hope that helps.

Maybe you are looking for