Highlight records in jsp

Hi all
In would like to highlight some records in my jsp page based on some condition checking.
please assist me how to highlight some particular records in jsp.
thanks in advance.

Have 2 different CSS classes, one that represents the normal record and one that represents the highlighted one. Something like:
.normal {
     background-color: White;
.highlight {
     background-color: Yellow;
     font-weight: bold;
}Now when you construct your records, apply your logic to see which css class should be applied. For example to set every alternate row as a highlighted row you can do something like this:
<c:forEach items="records" var="record" varStatus="vs">
<tr class="${((vs.index % 2 == 0)?"normal":"highlight")}">
      <td>${record}</td>
</tr>
</c:forEach>

Similar Messages

  • How to scroll datagrid to highlight records?

    I have used
    styleFunction(data:Object,col:AdvancedDataGridColumn) to highlight
    one record in a datagrid. My question is how to scroll to this
    highlighted record using action script?
    Thanks

    For now you can enable scroll bars so that they are always visible, and thus able to grabbed using your pen. Check this under System Preferences > Personal > General > Show Scroll Bars > Always.
    The default setting is "Automatically based on Input Device" which makes me think that perhaps Wacom needs to do something in order for OS X Lion to recognize that if you are using a pen, the scrollbars will appear automatically. That's my hope at least!

  • Inserting multiple records in JSP and setting date format

    Hi,
    I'm looking at the possibilities for using JSP's as a web application.
    I've got a few questions about it:
    1) Is it possible to insert multiple records in the detail block of my JSP. Normally when I click the 'insert button', an insert JSP comes up, which is a html form with the possiblity of inserting only one record.
    2) Is it possible to change the format of a date field. Now a date field is displayed as 'YYYY-MM-DD'. My nls_date_format is something else.
    3) I can't get the static combo box working for the class EditCurrentRecord. The normal use combo box is no problem. Probably, I don't have the syntax correct. Could anyone provide an example for this.

    2) Just use the Calendar object. You can format the date any way you want. I am assuming that you are talking about how the date appears after a .toString() call.
    Here is how I do it (this code will probably look very bad I am trying to type into a very small space so bear with me):
    public static String traceDate(java.sql.Timestamp dt)
    try
    if (dt == null)
    return " ";
    else
    Calendar clFmt = Calendar.getInstance();
    clFmt.setTime(dt);
    return
    String.valueOf(clFmt.get(Calendar.MONTH) + 1) + "/" +
    String.valueOf(clFmt.get(Calendar.DAY_OF_MONTH)) + "/" +
    String.valueOf(clFmt.get(Calendar.YEAR)) + " " +
    String.valueOf( (clFmt.get(Calendar.HOUR) == 0) ? 12 : clFmt.get(Calendar.HOUR) ) + ":" +
    padLt(String.valueOf(clFmt.get(Calendar.MINUTE)),2) + ":" +
    padLt(String.valueOf(clFmt.get(Calendar.SECOND)),2) + " " +
    (clFmt.get(Calendar.AM_PM) == Calendar.AM ? "AM" : "PM");
    catch (Exception e)
    throw new RuntimeException(e.getMessage());
    (padLt is a custom function that just pads 0s to the left of the number)

  • Display records in JSP

    I am completely stuck at this point and need urgent help.
    here is what i have done till now:
    i have one jsp page called first.jsp which displays records in RowsetBrowser from View Object A.
    The attributes are ID,name,Location.
    in View Object A i have added a transient attribute to which i have given an expression
    as: ''&#0124; &#0124;ID&#0124; &#0124;'', i want to make the id as a link to the edit page,
    i do not want an additional column to show up as link,hence i am not using addTextUrlColumn method.
    now on clicking on this id,edit.jsp page is called and the parameter p which is the id is passed to
    edit.jsp page.
    The edit.jsp page is based on another View Object B.
    the code is as follows:
    String param=request.getParameter("p");
    oracle.jbo.html.databeans.RowsetNavigator rsn;
    rsn=(oracle.jbo.html.databeans.RowsetNavigator) new oracle.jbo.html.databeans.RowsetNavigator();
    rsn.initialize(application,session,request,response,out,"NTS_NTS_NTSModule.LogPanelView");
    rsn.getRowSet().getViewObject().setWhereClause("ncc_log_id="+param);
    rsn.getRowSet().getViewObject().executeQuery();
    The results of above query is only one record,which is right.
    my job is now to display all the attributes of the above record,in text fields or
    combo boxes.

    Hi Monali,
    If I understand your attribute Number1 (and Number 2) is one string value (varchar2 type, long type etc. in Entity) which include in self more different values (other strings or numbers). Right? You can do this if you parse string with an method which analyse that string and give you all the values in an array. Then you can display all the values just like you display other attributes. Off course between the values within attributes value must exist an sign (;, |, ^ etc.) which separate one value from another.
    Format is:
    SignValue(1)SignValue(2)SignValue(3)SignSignValue(maxData)Sign
    (e. g.)
    Format 1:
    |Ad45gt63e4|34f5t55B4|3d563H6a2|5G67sE3h7||d45fgh5|
    First sign (|) in the string is separator between the values
    Format 2:
    ;Friday;September 07;2001;Baker Street 21b;LONDON;Europe;;JSP;12345678;EJB;
    First sign (;) in the string is separator between the values
    I write one demo application (Parse) which you can see in listing 1: Parse.java (see below). Maybe isnt the best solution for this problem but working :-)(compile and run from java console)
    In your case code maybe look like in listing 2: BrowserBean.java (see below)
    I hope this help you...
    Veso
    Note: Sample code in listing 2 I write from my head (without testing), so maybe has errors.
    Parse.java
    public class Parse {
    public static String CheckValue(String strValue){
    int strEnd;
    char strSign = strValue.charAt(0);
    strEnd = strValue.indexOf(strSign,1);
    strValue = strValue.substring(1, strEnd);
    return strValue;
    public static void main(String[] args) {
    final int maxData = 100;
    int sAllValues;
    String sEmpty = "";
    String[] sAllValuesNumber1 = new String[maxData];
    String sValueNumber1 = ";Friday;September 07;2001;Baker Street 21b;LONDON;Europe;";
    try {
    sAllValues = 0;
    while (sValueNumber1 != null && !sValueNumber1.equalsIgnoreCase(sEmpty) && !sValueNumber1.equalsIgnoreCase(sValueNumber1.substring(0,1))) {
    sAllValues++;
    sAllValuesNumber1[sAllValues-1] = CheckValue(sValueNumber1);
    System.out.println(sAllValuesNumber1[sAllValues-1] + "\n");
    sValueNumber1 = sValueNumber1.substring(sAllValuesNumber1[sAllValues-1].length() + 1);
    } catch(Exception ex) {
    throw new RuntimeException(ex.getMessage());
    BrowserBean.java
    package demobeans;
    import java.io.PrintWriter;
    import java.io.OutputStream;
    import oracle.jbo.*;
    import oracle.jbo.html.databeans.*;
    public class BrowserBean extends oracle.jdeveloper.html.DataWebBeanImpl {
    public static String CheckValue(String strValue){
    int strEnd;
    char strSign = strValue.charAt(0);
    strEnd = strValue.indexOf(strSign,1);
    strValue = strValue.substring(1, strEnd);
    return strValue;
    public void render() throws Exception {
    final int maxData = 100; // number of values for attributes (Number1 or Number2)
    int sAllValues1;
    int sAllValues2;
    String sData = null;
    String sEmpty = "";
    String sQuery = request.getParameter("id");
    String sValueID = null; // if is ID column1 in ViewObject
    String sValueName = null; // if is name column2 in ViewObject
    String sValueNumber1 = null; // if is name column3 in ViewObject
    String sValueNumber2 = null; // if is name column4 in ViewObject
    String[] sAllValuesNumber1 = new String[maxValues];
    String[] sAllValuesNumber2 = new String[maxValues];
    Row[] drows = qView.getAllRowsInRange();
    AttributeDef[] dattrs = getDisplayAttributeDefs();
    for (int rowno = 0; rowno < drows.length; rowno++) {
    for (int j = 0; j < dattrs.length; j++) {
    if (!shouldDisplayAttribute(dattrs[j]))
    continue;
    if (drows[rowno] != null) {
    Object attrObj = drows[rowno].getAttribute(dattrs[j].getIndex());
    if (attrObj != null) {
    sValue = attrObj.toString();
    switch (dattrs[j].getIndex()) {
    case 0 : sValueID = sValue; break;
    case 1 : sValueName = sValue; break;
    case 2 : sValueNumber1 = sValue; break;
    case 3 : sValueNumber2 = sValue; break;
    sAllValues1 = 0;
    while (sValueNumber1 != null && !sValueNumber1.equalsIgnoreCase(sEmpty) && !sValueNumb er1.equalsIgnoreCase(sValueNumber1.substring(0,1))) {
    sAllValues1++;
    sAllValuesNumber1[sAllValues1-1] = CheckValue(sValueNumber1); // put values from Number1 in an array
    sValueNumber1 = sValueNumber1.substring(sAllValuesNumber1[sAllValues1-1].length() + 1);
    sAllValues2 = 0;
    while (sValueNumber2 != null && !sValueNumber2.equalsIgnoreCase(sEmpty) && !sValueNumber2.equalsIgnoreCase(sValueNumber2.substring(0,1))) {
    sAllValues2++;
    sAllValuesNumber2[sAllValues2-1] = CheckValue(sValueNumber2);
    sValueNumber2 = sValueNumber2.substring(sAllValuesNumber2[sAllValues2-1].length() + 1);
    sData = "<!-- html -->Name:" + sValueName + "<!-- html code (table tags or other) -->";
    sData += "<!-- html -->Number1[1]:" + sAllValuesNumber1[0] + " Number1[2]:" + sAllValuesNumber1[1] + ... + " Number2[sAllValues1]:" + sAllValuesNumber1[sAllValues1-1] + "<!-- html code (table tags or other) -->";
    sData += "<!-- html -->Number2[1]:" + sAllValuesNumber2[0] + " Number2[2]:" + sAllValuesNumber2[1] + ... + " Number2[sAllValues2]:" + sAllValuesNumber2[sAllValues2-1] + "<!-- html code (table tags or other) -->";
    out.print("Other HTML code...") // other elements for your look and feel
    out.print(sData);
    out.print("Other HTML code...") // other elements for your look and feel
    releaseApplicationResources();
    null

  • How to display records in jsp

    i have 100 records can anybody tell me how i display records 10 at atime in jsp & by clicking the next button another 10 records displays in the same jsp. How i can do that thing.

    You have to implement a page breake yourself.
    Simple scenario would be to store a page number into a session:
    session.setAttribute("page", selectedPage)
    every time user clicks on a next page link
    When displaying the record read the page and display only those which should be on the page
    Integer selectedPage = session.getAttribute("page")
    if (selectedPage == null) selectedPage = 1;
    //display code goes here

  • RANGE_PAGING LAST RECORD IN JSP PAGE

    Hi.
    I'm working in JDeveloper 10g, and I would like to know what should be the behavior for the Last button on a jsp page when I use the method setAccessMode with RANGE_PAGING mode?, I mean, when I press that button in my jsp page it doesn't go to the last record result of the query.
    Thanks in advance.

    Thanks for your help.
    My range size is 10.
    But I have a question, vo.last does the same that the last button (navigation bar) on a jsp page?
    For example, if I have navigated through 50 records (with nextSet button) and I press last button, and I know that the query result in the view object is 1000 records, but I'm using RANGE_PAGING, how can I go to the last record?
    Because I tried with last button, but it goes to other record different to the last one.
    Thanks in advance.

  • Edit and update multiple records in JSP buisness components

    Hi everybody,
    I'm building BC4J components using entities and views and JSP buisness components.
    how can I edit and update multiple records
    at a time in the jsp file
    Note using the databean
    "oracle.jbo.html.databeans.EditCurrentRecord"
    one can view one record at a time
    thank you

    do you have a sample code? thanks
    Hi
    There are several options. One of them could be
    1) use <input name=rc[j] value="..."> instead of
    display a raw text
    2) parse parameters in doPost method of your servlet
    to update appropriate values.
    3) Make a empty row enable inserts
    Regards
    Jan

  • Paging/displaying and selecting records in jsp

    Hey,
    I needed some info on paging, displaying and selecting records in a jsp. Any direction in terms of which technique is the most efficient(which tags to to use etc). Any online resources which go into some detail would be great. Basically working with a list of objects.
    Thanks in advance for your assistance

    Here is at least one online resource:
    http://www.google.com/search?q=jsp+paging

  • Page through Records in JSP (URGENT)

    Hello Friends,
    If anyone can solve my problem, I am creating a sales report based on region. Now, here I have used paging for more records. The problem is:
    Say on Page 1 I have some calculation and the total of that page is 4000
    On Page 2 the total calculation of the page is 8000 and so on..........
    Now on the last page I want the grand total of all the pages.
    Can anyone let me know how to do this..........................Note: I am doing dynamic paging, i.e The query to fetch the record is executed page wize in the sense, for every page.

    I can give you a vague idea on this issue:
    Before i give my idea,i assume that when you are calling the next page or next button you are submitting the form, and in the form action you are calling the second jsp page.
    For example: Assume that i have 10 jsp pages to display
    i have 2 buttons called next and previous.
    now for every button click i do like this:
    if page 1 's next button is clicked then i will submit page1 and in the action of page 1 i will call page2.
    I hope you understood till now.
    And in the page2 jsp i will call whatever classes or do what ever i want to display page2.This is done in the scriplets in the beginning.
    I assume that you are doing in this way.If this is the case, then ur problem can be solved like this.
    For every page i will have 2 hidden variables called dbPageTotal,dbTotal.
    so let us see the senario:
    page1 : dbPageTotal=2000
    dbTotal=2000
    page2: dbPageTotal=4000
    dbTotal=4000+2000=6000
    page3 : dbpageTotal=1000
    dbTotal=6000+1000=7000
    (You need to write a little java script to assign the values to the variable)
    now suppose we are moving from page 1 to page2 :
    you can request that dbTotal with the help: request.getParameter("dbTotal") and you will have yoour value on that page.
    you also need to check what type of button he clicked.
    i hope u understood my point.
    If you are not doing in this way, and calling some servlet each time let me know, i will also think of in this issue.

  • Refreshing records in jsp uix jdev9i

    I have a project where when you first bring up my customer.jsp it diplays the first 4 records and lets me pick other records in groups of 4. If I do a specific search and bring up one customer and then move to other jsp pages to get the phone info, etc. When I return to my origional customer.jsp page, it still displays the last customer i searched on. How do I get the customer.jsp page to show my groups of 4 everytime I return to it??
    Any help or suggestions would be great, thanks

    The search changes the WHERE clause of the view object your are using to display your results. In order to clear out the search, you need to clear any search criteria you have setup. This should be the same as running the search page without any criteria.

  • How to handle more records in jsp page

    i have some 1000 records in an collection( arraylist or iterator or any collection object) , for examples query returns records to me with resultset.
    i want to display 50 records each time per page
    how to display them and how to control the flow.
    plz give me any codes if possible...
    thanks all
    Message was edited by:
    BURAK
    Message was edited by:
    BURAK

    sorry I can't understand you, can you please explain it or post here any codes about it?

  • Using field highlighter to highlight records with a certain date range

    I've been asked to highlight a field based on the fact that the "Submit" date is greater than a certain value. The problem is that there's no way to pre-determine what that value is. It changes.
    The user wants to be prompted for the value when he runs the report. That value would then be stored as a variable which would be used in the script to determine if the field should be highlighted.
    Does anyone know if there a way to do this?

    Thanks for your quick reply Raghavendra.
    How does that prompt the submitter for the Date value he wants to use and the date to compare the submit date against?
    Here's the scenario.
    A user wants to highlight all "new" tickets submitted since last time he ran the report. It's not like he runs the report every friday which would make it easy because then you'd compare the submit date to "today-7" so-to-speak. He runs the report randomly. He wants to be prompted for a date before the report runs to replace "today-7".
    Could you help explain how to prompt the use for that date.

  • I need help with paginating my Oracle database records in JSP

    Please can someone help with a script that allows me to split my resultsets from an Oracle database in JSP...really urgent..any help would be really appreciated. I'm using the Oracle Apache http server and JSP environment that comes with the database...thanks

    First thing you have to do is decide on a platform and
    database. Check to see what your server supports. Whether it is ASP
    and MSSQL, PHP and MySQL or less likely Cold Fusion.

  • Pagination of records in jsp

    i want to be able to paginate through the records of an oracle result set. Is it possible to do this with post and get methods only?

    River_Plate wrote:
    i want to be able to paginate through the records of an oracle result set. Is it possible to do this with post and get methods only?Those 2 things have nothing at all to do with each other...

  • Displaying DB records in JSP, same as a Search Result page

    Dear All,
    I need to design a JSP page with data from my database, similar to a search result page. Once selected, I need to pass a parameter value to call the detail page, same as a search result page.
    What is the proper way doing this in JSP please?

    I got answer fot this.
    1 pagination can give Display solution
    2 parameter passing (or variable), using sendReDirect()

Maybe you are looking for