Saturday, June 30, 2012

Absent line number in Eclipse , Debugging disabled !

This is usually due to the compiler settings in Eclipse IDE , Windows -> preferences -> Java -> Compiler  -> "Add line number .. " should be checked . 


Another problem can be because JRE source is not mapped to the IDE . 



To ensure, you have the correct src.zip, do this:
Window->Preferences->Java->Installed JREs
Select your JRE and click “Edit”.
On the “Edit JRE” screen select the entry for rt.jar and click “Source Attachment” 

For me I used as JRE C:\Program Files\Java\jdk1.6.0_04\jre and with that my source attachment was in C:\Program Files\Java\jdk1.6.0_04\src.zip.

Hope this helps .. 

Tuesday, March 20, 2012

jQuery to get value of a Span element , using .html()

If a span element like below has to be read in jquery then .html() function comes to the rescue .

//in the jsf code 
 <h:outputText value="100.12"  styleClass="resOutputMaxTeor">

// in html
<span class="resOutputMaxTeor">100.12</span>

in the script read the span value using .html() function .

var max =  jQuery(".resOutputMaxTeor").html();

If it is a DOM element it can be read using .get() function

var max = jQuery(".resOutputMaxTeor").get(0) ;