?
Solved

How can I display a checkmark as data in a row, coming from Oracle and displaying on JSP page

Posted on 2011-04-21
13
Medium Priority
?
586 Views
Last Modified: 2012-08-14
I have a simple table display on a JSP page, it has columns Sunday through Saturday, with rows for various sources of data that load to a data warehouse.

I currently display "Y" for yes, the load is supposed to load on this day, and "-" for not supposed to load on this day.

I'd like to display a nice checkmark, how can I do that ?
0
Comment
Question by:Alaska Cowboy
  • 7
  • 6
13 Comments
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 35444721
You should be able to use the following html entities

Check mark: &x2713;
'X' mark: &x2717;
0
 
LVL 14

Accepted Solution

by:
Designbyonyx earned 500 total points
ID: 35444759
DOH! sorry.  forgot the pound sign.  And there's more to choose from, if you so choose:


Check mark:
✓
✔

'X' mark:
✕
✖
✗
✘
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 35444966
Designbyonyx,

thanks ! I will try this out tomorrow.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 35447388
ok, first attempt didn't work, I tried to replace "Y" with ✓ but it didn't work.

I tried this: <td>${fn:replace(mondayFlag, "Y", "&#x2713;")}</td>

but it still displayed "Y"

0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 35447414
I consider myself fairly proficient with jQuery, but I am not familiar with that syntax.  This works:

$('#mySpan').html('&#x2713');

<span id="mySpan">Y</span>
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 35447453
Ok, I replaced in the oracle Sql, so that worked !

question: how did you know the HTML codes for checkmarks and X's ? I guess I could have googled it, huh ? but aside from googling everything, how does one put this kind of thing in their toolkit ?
0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 35447477
Oh, is that JSP syntax? If so, my bad.

It's important to note that the checkmark symbol I am giving you (ex: &#x2713;) is meant to be rendered on an HTML page.  You may be able to copy and paste the symbol directly from this: ¿

But I cannot tell you whether or not that will work across many devices due to character encoding and such.
0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 35447523
The number (2713) is the unicode representation of a checkmark.  Unicode can be represented in HTML by prefixing the number with &#x

Here is pretty complete list of unicode characters:

http://www.fileformat.info/info/unicode/category/So/list.htm

I usually just do a google search for something like "unicode check mark"...  and you either find something or you don't.  Hope that helps.
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 35447530
Design,

this is JSTL, and it worked on another page,  

<fmt:formatDate var="time"  value="${detail.loadDateTime}" pattern="h:mm a"/>

followed by

<td> ${fn:replace(time, "AM", "am")}</td>

I don't think there is <fmt:formatString ... /> so I just tried <td>${fn:replace(mondayFlag, "Y", "&#x2713;")}</td> which still rendered "Y"

but it's working great when I did the replace in the Sql . . .

question on your suggestion
>>$('#mySpan').html('&#x2713');
>><span id="mySpan">Y</span>

what is that ? is it CSS or what ?
0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 35447863
That's jQuery syntax.  jQuery is a javascript library which allows you to traverse the DOM using the same syntax you use with CSS.  

For example, lets take the following DOM node:
<span id="mySpan">Text inside of my span</span>

If you wanted to modify this DOM object with javascript you would have to do something like this:
var mySpan = document.getElementById('mySpan');
mySpan.innerHTML = "&#x2713;";

Open in new window


If you wanted to style this object with CSS, you would use the following syntax in your style sheet:
#mySpan {
    color: #FF0000;
}

Open in new window


jQuery lets you manipulate the DOM with CSS selectors by using the following syntax... which is the jQuery equivalent  of the above javascript:
var mySpan = $('#mySpan');
mySpan.html('&#x2713;');

Open in new window


Hope that helps.  If you work with HTML, you should definitely check out jQuery.
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 35447899
yes, I'm somewhat familiar with jQuery.

but why do you say that's jQuery syntax ? I thought it was JSTL ? (this --> <fmt:formatDate var="time"  value="${detail.loadDateTime}" pattern="h:mm a"/> )

thanks for the expln.
0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 35448034
I'm sorry... slight misunderstanding.  I am not really familiar with JSP, so when you posted this code snippet:

<td>${fn:replace(mondayFlag, "Y", "&#x2713;")}</td>

I thought you were doing something funky with jQuery that I had never see before... so I responded with a jQuery solution.  Then I realized that your code snippet was not jQuery. I assume that it's JSP??  Still not really sure.  I guess the important thing is you got the solution you were looking for.
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 35448283
yes, JSP supplemented with JSTL, but I do use JQuery in this application.

All is good (for this, anyway) . . .
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question