Product Info    
ORA-20001: get_dbms_sql_cursor error ORA-00904: "RATING": invalid identifier
Blog Post    
apex-star-rating-amazon-style
Explanation    
/i/themes/theme_1/1px_trans.gif You can toggle the Rating of a Product by clicking on the stars in the Interactive Report.
Requery to verify that the record is actually updated.
I added two columns to the DEMO_PRODUCT_INFO table : RATING and VOTES.


1. Download and install the jQuery Star Rating plug-in from http://code.google.com/p/jquery-star-rating-plugin/

2. Create a PL/SQL function to show the stars in your report:
create or replace function GET_STARS
( pID in NUMBER
, pRating in NUMBER
) return VARCHAR2
is
l_retval varchar2(2000) :='';
BEGIN
FOR i in 1..5 LOOP
IF i = pRating
THEN l_retval := l_retval ||'<input class="star" id="'||pID||'" name="star'||pID||'" type="radio" value="'||i||'" checked="checked" />';
ELSE l_retval := l_retval ||'<input class="star" id="'||pID||'" name="star'||pID||'" type="radio" value="'||i||'" />';
END IF;
END LOOP;
RETURN l_retval;
END;
and use that in your select.

3. Add a click event to the elements with a 'star' class
$(function(){
$('.star').click(function() {
saveRating( $(this).attr("id"), $(this).children().attr("title") );
votes = Number($(this).parent().parent().next().html()) + 1;
$(this).parent().parent().next().html( votes );
});
});

4. Create an Ajax OnDemand process to actually update the data
There is an example of that on the 'Updateable Interactive Report' showcase.
/i/themes/theme_1/1px_trans.gif
/i/themes/theme_1/1px_trans.gif /i/themes/theme_1/1px_trans.gif

nobody