Cross column radio group solution using dynamically generated HTML
I am tasked with creating a screen in Apex matching look and feel of an existing application screen; tabular form, multiple column radio buttons to update a single column value (radio group needs to be row oriented, across multiple columns). I could not find a way to use HTMLDB_ITEM.RADIO_GROUP () function for this due to the radio group being column based, great as a row selector but not for use across columns (each button being a column).
My first thought was to comprise and use checkboxes via HTMLDB_ITEM.CHECKBOX () for the multiple choices (in each column) and HTMLDB_ITEM.HIDDEN() to hold the chosen value, a JavaScript function for “onClick” event to make the checkboxes in one row act like radio buttons in a radio group. I created a simple application to show the concepts of my solutions …
SQL looks like this:
select pk_id, -- f01
object_to_color, -- f02
HTMLDB_ITEM.CHECKBOX(11, color_choice,
'onClick="chkboxAction('||pk_id||', document.wwv_flow.f11, ''RED'')"', 'RED') red,
HTMLDB_ITEM.CHECKBOX(12, color_choice,
'onClick="chkboxAction('||pk_id||', document.wwv_flow.f12, ''BLUE'')"', 'BLUE') blue,
HTMLDB_ITEM.CHECKBOX(13, color_choice,
'onClick="chkboxAction('||pk_id||', document.wwv_flow.f13, ''GREEN'')"', 'GREEN') green,
color_choice -- f03
from objects_to_color
Columns pk_id and color_choice are set as Show off and Display As Hidden. Note that my HTMLDB_ITEM.CHECKBOX items start with id number 11 (f11 – f13) so as not to conflict with the item id’s Apex will generate on it’s own. I could have used HTMLDB_ITEM functions to create all items and had my own PL/Sql update process.
This creates a tabular presentation with a column for each color choice as a checkbox, shown checked if that color is initially set.
The JavaScript function chkboxAction() clears the other checkboxes if a color is selected and stores the color in the hidden item db column for use in Apex Submit processing. Sorry the identation get's lost in the post!
function chkboxAction (id, ckbx, color) {
// f01 is pk_id (hidden)
// f11 is RED checkbox
// f12 is BLUE checkbox
// f13 is GREEN checkbox
// f03 db column color_choice for update (hidden)
var idx;
// Find row index using pk_id passed in as id argument.
for (var i=0; i < document.wwv_flow.f01.length; i++) {
if (document.wwv_flow.f01.value == id) {
idx = i;
i = document.wwv_flow.f01.length;
if (ckbx(idx).checked == true) {
// Set hidden color_choice column value to be used in update.
document.wwv_flow.f03(idx).value = color;
// Uncheck them all, then reset the one chosen.
document.wwv_flow.f11(idx).checked = false;
document.wwv_flow.f12(idx).checked = false;
document.wwv_flow.f13(idx).checked = false;
ckbx(idx).checked = true;
} else {
// Unchecked so clear color_choice column value to be used in update.
document.wwv_flow.f03(idx).value = '';
This works well and, as an aside, has an added feature that the color can be “unchosen” by unchecking a checked checkbox and leaving all checkboxes unchecked. This cannot be done with radio buttons unless a radio button is added as “no color”.
But what if radio buttons must be used, as in my situation? Here is another solution using custom code to dynamically generate radio buttons for a row based radio group rather than using HTMLDB_ITEM.RADIO_GROUP ().
select pk_id, -- f01
object_to_color, -- f02
'<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_1" value="RED" '||
decode(color_choice, 'RED', 'CHECKED', '')||
' onClick="rbAction('||pk_id||', ''RED'')">' red,
'<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_2" value="BLUE" '||
decode(color_choice, 'BLUE', 'CHECKED', '')||
' onClick="rbAction('||pk_id||', ''BLUE'')">' blue,
'<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_3" value="GREEN" '||
decode(color_choice, 'GREEN', 'CHECKED', '')||
' onClick="rbAction('||pk_id||', ''GREEN'')">' green,
color_choice -- f03
from objects_to_color
The pk_id column is used here to ensure a unique name and unique id for the items. In practice a custom api should be used to generate items in this way.
The JavaScript function is actually simpler for radio buttons because the radio group handles the mutually exclusive logic for choosing a color.
function rbAction (id, color) {
// f01 is pk_id (hidden)
// f03 db column color_choice for update (hidden)
var idx;
// Find row index using evaluation_question_id.
for (var i=0; i < document.wwv_flow.f01.length; i++) {
if (document.wwv_flow.f01.value == id) {
idx = i;
i = document.wwv_flow.f01.length;
// Set hidden result column referenced in update.
document.wwv_flow.f03(idx).value = color;
Now the problem is that on update, Apex will be confused by the custom items and try to post updated values to it’s own internal items – which don’t exist. The result is the very frustrating HTTP 404 - File not found error when apex/wwv_flow.accept executes on Submit. So, the trick is to clear the custom items prior to the update with a simple JavaScript function, then the values show again when the page is rerendered, if you are not branching from the page. The Submit button is changed to call the following function:
function submit () {
var items = document.getElementsByTagName("INPUT");
for (i=0; i< items.length; i++) {
if (items(i).type == "radio") {
if (items(i).checked == true)
items(i).checked = false;
doSubmit('SUBMIT');
This technique might have general use when using custom items. Comments or improvements on this?
See Oracle Apex site: workspace SISK01, app OBJECTS_TO_COLOR
Just the code for formatting.
Checkboxes to behave like radio group ...
SQL ...
select pk_id, -- f01
object_to_color, -- f02
HTMLDB_ITEM.CHECKBOX(11, color_choice,
'onClick="chkboxAction('||pk_id||', document.wwv_flow.f11, ''RED'')"', 'RED') red,
HTMLDB_ITEM.CHECKBOX(12, color_choice,
'onClick="chkboxAction('||pk_id||', document.wwv_flow.f12, ''BLUE'')"', 'BLUE') blue,
HTMLDB_ITEM.CHECKBOX(13, color_choice,
'onClick="chkboxAction('||pk_id||', document.wwv_flow.f13, ''GREEN'')"', 'GREEN') green,
color_choice -- f03
from objects_to_colorJavaScript ...
function chkboxAction (id, ckbx, color) {
// f01 is pk_id (hidden)
// f11 is RED checkbox
// f12 is BLUE checkbox
// f13 is GREEN checkbox
// f03 db column color_choice for update (hidden)
var idx;
// Find row index using pk_id passed in as id argument.
for (var i=0; i < document.wwv_flow.f01.length; i++) {
if (document.wwv_flow.f01(i).value == id) {
idx = i;
i = document.wwv_flow.f01.length;
if (ckbx(idx).checked == true) {
// Set hidden color_choice column value to be used in update.
document.wwv_flow.f03(idx).value = color;
// Uncheck them all, then reset the one chosen.
document.wwv_flow.f11(idx).checked = false;
document.wwv_flow.f12(idx).checked = false;
document.wwv_flow.f13(idx).checked = false;
ckbx(idx).checked = true;
} else {
// Unchecked so clear color_choice column value to be used in update.
document.wwv_flow.f03(idx).value = '';
}Radio button solution ...
SQL ...
select pk_id, -- f01
object_to_color, -- f02
'<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_1" value="RED" '||
decode(color_choice, 'RED', 'CHECKED', '')||
' onClick="rbAction('||pk_id||', ''RED'')">' red,
'<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_2" value="BLUE" '||
decode(color_choice, 'BLUE', 'CHECKED', '')||
' onClick="rbAction('||pk_id||', ''BLUE'')">' blue,
'<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_3" value="GREEN" '||
decode(color_choice, 'GREEN', 'CHECKED', '')||
' onClick="rbAction('||pk_id||', ''GREEN'')">' green,
color_choice -- f03
from objects_to_colorJavaScript ...
function rbAction (id, color) {
// f01 is pk_id (hidden)
// f03 db column color_choice for update (hidden)
var idx;
// Find row index using evaluation_question_id.
for (var i=0; i < document.wwv_flow.f01.length; i++) {
if (document.wwv_flow.f01(i).value == id) {
idx = i;
i = document.wwv_flow.f01.length;
// Set hidden result column referenced in update.
document.wwv_flow.f03(idx).value = color;
function submit () {
// Clears radio buttons to prevent Apex trying to post and causing page error.
var items = document.getElementsByTagName("INPUT");
for (i=0; i< items.length; i++) {
if (items(i).type == "radio") {
if (items(i).checked == true)
items(i).checked = false;
doSubmit('SUBMIT');
}
Similar Messages
-
Displaying dynamically generated HTML
Hi!
Is it possible to display dynamically generated HTML-page by means of ITS?
I want to write report in ABAP and generate HTML-page with report data, then display it on client side.
Is it possible?
Thanks!Hello,
As long as it has a transaction code then probably yes. Just use the webgui service.
Edgar -
How to determine the fixed width I can use to generate html columns in java
I have a jsp where I dynamically generate menus for a web page.
Table's cells are generated with different width, making the menus look differently.
When clicking on menus, cells changing sizes.
What is the best way to implement that, so I have a fixed width for every column?
Thank youThat's what I do.
The code determines the width of the column now.
The only drawback is that I manually assign values to the width depending on the menu item length.
Is there any way how to do it dynamically, by determining how many px width will be by having the menu item lenght?
<TABLE cellspacing=0 cellpadding=0 border=0 width="100%">
<!--<TR>-->
<!--<td width="251"><img src="images/Menu1L.gif" width="8" height="25"></td>-->
<%
int gs = menu.getSelectedGroupNum();
MenuGroup menuGroup = menu.getMenuGroup(gs);
int is = menu.getSelectedItemNum();
int maxScr = 10; //10 screens buttons per line
int totScr = menuGroup.getSize(); //total number of screens for the selected menu
int rowsNum = 0;
rowsNum = (int)Math.ceil((double)totScr/maxScr);
System.out.println("Num of scr per line: " + maxScr +
" Num of scr/menu: " + totScr +
" Num of rows: " + rowsNum);
for(int screenRow = 0; screenRow < rowsNum; screenRow ++){
//for (int item = 0; item < menuGroup.getSize(); item++)%>
<tr><td>
<table border="0" cellspacing="0" cellpadding="0" height="20">
<tr>
<td width="251"><img src="images/Menu1L.gif" width="8" height="25">
<%
for(int item = screenRow*maxScr; item < (screenRow + 1)*maxScr && item < totScr; item ++)
MenuItem menuItem = menuGroup.getMenuItem(item);
String title = menuItem.getDisplay();
String link = null;
String cssClass = null;
System.out.println(title + ":" + title.length());
if(!menu.isDisabled())
link = "<A href=\"Menu.do?top=" + gs + "&side=" + item + "\">";
%>
<%
else{
link = "";
title = "<i>" + title + "</i>";
MenuItem subMenuItem = null;
boolean isSubMenu = menuItem.containsSubMenuItem();
String subText = null;
//determine the width of the column
int width = 0;
if(title.length() > 5 && title.length()<20)
width = 158;
if(title.length() > 20)
width = 193;
if(title.length() <=5)
width = 60;
if (is == item){
//link = "<A href=\"Menu.do?top=" + gs + "&side=" + item + "\">";
cssClass = "ScreenItemSel A";
else
cssClass = "ScreenItem";
%>
<TD align = "center" nowrap class = "<%= cssClass%>" background ="images/Menu1F.gif" width="<%=width%>"> <%=link%><%=title%></TD>
<TD class="Screen" nowrap><img src="images/Menu1Sep.gif" height=25 width=16></TD>
<%
}%>
<TD width="100%" valign=top align=right class="ScreenName" background="images/Menu1F.gif"><%--<%=mode%>--%></TD>
<TD><IMG src="images/Menu1R.gif" width="8" height="25"></TD>
</td>
</tr>
</table>
</td>
</tr>
<%}
%>
<!--</TR>-->
</TABLE> -
How to dynamically generate HTML in Servlet without all the out.println?
Since I am not sure whether this is a Java Servlet or JSP problem, so I will describe my situation. And hopefully someone can propose a good solution. I came from a PHP, so Java Servlet and JSP are still a little bit foreign for me.
My problem
My front end is a JSP page that essentially contains a form (lets call it form1). The reason it is a JSP not a HTML is because I will need to load form data from the backend and display them in the form. Once the user submits the form, it will go to a backend Java Servlet (lets call it servlet 1), which loads data from files according to user input. Then, I will need to dynamically create a new form (lets call it form2) based on the data loaded from files. Once the user inputs and submits form2, another Java Servlet (servlet 2) will do more processing. That is the end of line. Both form1 and form2 require Javascript.
My question is that since servlet 1 will need to dynamically create form2. I naturally will want a presentation control. Instead of doing out.println(html code), I want to use JSP and write direct HTML code. On the other hand, can JSP be used as a form action? So basically, in form 1, can I do <form action= /xxx.jsp> I think I saw something like this, but I lack the comprehensive JSP knowledge to know for sure. More importantly, if hypothetically JSP can be used, how do I handle functions such as doGet(HttpServletRequest request, HttpServletResponse response), which is used in servlet1.
Thank you,
Mno, servlets should not be used to generate a view, that is what a JSP is for. So let your backend servlet fetch the data, put it for example as attributes of the request scope (request.setAttribute()) and then forward control to a JSP that will generate the view, based on the information you stored in the request scope. That is the proper way of using servlets & JSPs; use servlets to invoke business logic classes, use JSPs combined with JSTL to generate the view. If you do it properly, you don't need ANY java code in your JSP.
-
Dynamically generate HTML at runtime
I've tried looking for an existing project that does this or something similar already, but the closest I got was an eclipse plug-in by IBM, which wont really help me since it wont work at runtime.
Basically I want to be able to generate a HTML form dynamically, based on the XML in a WSDL. Anyone got any ideas?Wow, no one? Damn, must be harder than I thought.No, it's really not hard at all. At least generating HTML isn't hard. What IS hard is answering your question. You have already rejected some alternatives, but you don't tell us what they were or why you rejected them. So I could suggest you use XSLT, but I might be wasting my time because you already rejected that. Or you might have had a completely bogus reason for rejecting it, but I can't tell.
So basically that's why you didn't get any answers. Not enough information to base an answer on, and enough information to decide not to answer. -
Use of WHERE clause to get 2 columns from dynamically generated html page.
I am using postgresql.I have to complete a java program , which is a forum like thing.User can login and submit question.....if anybody know the answer he can post the answer........Now the problem is that if more than one questions are entered it all should be displayed when we click on a "faq" button.........i created that one......these questions have the hyperlink.........When we click on a single question a text box will come........we have to write the answer there and answer should lie on the column corresponding the question clicked..............
Here i need the querry to write in servlet so that the answer is stored in the corresponding column only.................
Pleaseeeeeeeeeeeee help me as soon as possible..................
Regards
Shine..Sir,
Other than you are using postgres and a servlet I have absolutley no idea what you are on about.
Please try explaining in a less distressing manner.
Sincerely,
Slappy -
Column alias for spatial column within cursor loop using dynamic SQL
The following PL/SQL is trying to generate an error report for records or objects which are 3 dimensional or above. I have no issue execute one statement in SQLPLUS but I need to use the column alias for the spatial column. But, it is a different story using PL/SQL and dynamic SQL Any help will be great because I've been working on this for than 8 hours but with no luck! Thanks.
Here is the error I'm getting,
stmt := 'select p.column_name.get_gtype(), id from '|| table_name p ' where p.column_name.get_gtype() > 2 ';
ERROR at line 15:
ORA-06550: line 15, column 79:
PLS-00103: Encountered the symbol "P" when expecting one of the following:
. ( * @ % & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || member SUBMULTISET_
The symbol "* was inserted before "P" to continue.
and my PL/SQL is,
set serveroutput on size 100000 feedback off
declare
rs integer;
rs1 integer;
cur integer;
rp integer;
trs integer;
n integer;
un varchar2(30);
stmt varchar2(200);
begin
dbms_output.put_line(rpad('Table Name',40)||' Dimension');
dbms_output.put_line(rpad('-',53,'-'));
cur:= dbms_sql.open_cursor;
for t in (select column_name,table_name from user_sdo_geom_metadata where regexp_like(table_name, '[^[A-B]_[AB]$'))
loop
stmt := 'select p.column_name.get_gtype(), id from '|| table_name p ' where p.column_name.get_gtype() > 2 ';
dbms_sql.parse(cur, stmt, dbms_sql.native);
dbms_sql.define_column(cur, 1, rs);
dbms_sql.define_column(cur, 2, rs1);
rp:= dbms_sql.execute(cur);
n:=dbms_sql.fetch_rows(cur);
dbms_sql.column_value(cur, 1, rs);
dbms_sql.column_value(cur, 2, rs1);
dbms_output.put_line(rpad(t.table_name,38,'.')||rpad(rs,15)||rpad(rs1,15));
end loop;
dbms_sql.close_cursor(cur);
dbms_output.put_line(rpad('-',53,'-'));
end;
set serveroutput off feedback on feedback 6The following PL/SQL is trying to generate an error report for records or objects which are 3 dimensional or above. I have no issue execute one statement in SQLPLUS but I need to use the column alias for the spatial column. But, it is a different story using PL/SQL and dynamic SQL Any help will be great because I've been working on this for than 8 hours but with no luck! Thanks.
Here is the error I'm getting,
stmt := 'select p.column_name.get_gtype(), id from '|| table_name p ' where p.column_name.get_gtype() > 2 ';
ERROR at line 15:
ORA-06550: line 15, column 79:
PLS-00103: Encountered the symbol "P" when expecting one of the following:
. ( * @ % & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || member SUBMULTISET_
The symbol "* was inserted before "P" to continue.
and my PL/SQL is,
set serveroutput on size 100000 feedback off
declare
rs integer;
rs1 integer;
cur integer;
rp integer;
trs integer;
n integer;
un varchar2(30);
stmt varchar2(200);
begin
dbms_output.put_line(rpad('Table Name',40)||' Dimension');
dbms_output.put_line(rpad('-',53,'-'));
cur:= dbms_sql.open_cursor;
for t in (select column_name,table_name from user_sdo_geom_metadata where regexp_like(table_name, '[^[A-B]_[AB]$'))
loop
stmt := 'select p.column_name.get_gtype(), id from '|| table_name p ' where p.column_name.get_gtype() > 2 ';
dbms_sql.parse(cur, stmt, dbms_sql.native);
dbms_sql.define_column(cur, 1, rs);
dbms_sql.define_column(cur, 2, rs1);
rp:= dbms_sql.execute(cur);
n:=dbms_sql.fetch_rows(cur);
dbms_sql.column_value(cur, 1, rs);
dbms_sql.column_value(cur, 2, rs1);
dbms_output.put_line(rpad(t.table_name,38,'.')||rpad(rs,15)||rpad(rs1,15));
end loop;
dbms_sql.close_cursor(cur);
dbms_output.put_line(rpad('-',53,'-'));
end;
set serveroutput off feedback on feedback 6 -
Dynamically Generated HTML/PDF/RTF?
Hi guys,
This is similar to something I asked recently, but I've got a better idea of what I need and how to ask. I'm still fairly novice at programming, espeically applets.
I'm working on an applet for an educational purpose that will generate an array of study items...probably 30-50, I haven't decided on the size yet. It's for foreign language study, and the items are foreign phonetic characters, no more than 3 per item. I'd like to output them in a print-ready format, probably essentially a grid, with some space for the student to write their answer next to or under it. I've seen some free libraries out there that can generate pdf, rtf, and HTML, most notably the iText libraries.
I really want to do this as an applet. So my question is, how would this, or another library that one of you knows that would be better, be implemented? Would the output be a file on the server? Is there a way to make it generate the file to the users local cache or something, or give them an option to download it without it going on a server, since it is randomly generated and not uniform for other users? (I assume that would require making it a signed applet?)
Any help you can give would be really appreciated.
Colincosmic_cow wrote:
Okay, but this would work very well as a web application.What's a good resource for learning to work with them as opposed to applets? (Told you I'm a novice! ) Well, if you're a novice it might be better to concentrate on the regular Java stuff and sure, applets too.
Then if you feel interested in Java EE and Web Applications and Databases and what not, you can check out this to see what Enterprise Java consists of. -
Need dynamically generated ( in PL/SQL) Month in column header.
Hello,
I need to dynamically display the month in a column header and have tried using PL/SQL . I can paste following in the "Column Atributes" PL/SQL heading type to show names in the column headings:
return 'RESOURCE_NAME:TEAM:PROJECT'
but I need to show a column heading that changes each month. I can get the month to show in a region this way: htp.p(TO_CHAR(SYSDATE,'Month'))
but when I try to combine the two like this:
return 'RESOURCE_NAME:TEAM:PROJECT:htp.p(TO_CHAR(SYSDATE,'Month'))'
and put it in the column header, I get a mess.
Please tell me what I am doing wrong. Thanks.
LindaHello Dimitri,
Your solution to dynamically generating the Month in a column header worked out great!
Well, now I am trying to do the same in a lable of a form page. I try going to the Edit Page Item page (Home>Application Builder>Application 135>Page 8>Edit Page Item) and paste the same code on the "Source" and select "PL/SQL Function Body" but do not have any luck.
Do you have any suggestions?
Thanks
Linda -
Read-only radio group losing value on validation error
It took quite a while to track this down, but I think I've got it narrowed down properly. I have an APEX form for updating a record in a databse table with a radio group which is conditionally read-only. If that radio group has a value AND is read-only, when the form is submitted and hits a validation error, the value of the radio group is lost.
For example, the radio group SUBMITTED_FOR_APPROVAL is set to Y and is read-only for a given user. That user then changes something else on the form and submits it. However, the form now hits a validation error for some field. When the form reloads with the validation error displayed, all the fields are restored except the read-only radio group which is now blank. If a select list is used with the identical read-only condition, it works fine. Likewise, if a radio group is used, but the read-only condition is removed, it works fine. It is only when it is a radio group and it is read-only, that the value does not appear to be submitted to the session with all the form values whent he form is submitted.
Is this a bug or am I simply missing something?
Apex 3.1.2
Rgds/Mark M.It's using a shared component LOV cleverly called LOV_YN which consists of a static LOV with
1 Display=Yes, Return=Y
2 Display=No, Return=N
The settings in the LOV section on the item iteself:
Named LOV: LOV_YN
Display Extra values: No Dynamic translation: Not translated
Number of columns: 2 Display null: No
Null display value is blank as is null return value
Item was setup as a radio group and was only converted over to a select list to work around this issue. Let me know what else you need and thanks again.
Rgds/Mark M. -
Hi,
I have three radio group items that are defined EXACTLY the same except for the label and associated database column. Each radio group item uses the same named LOV for "Yes" and "No". Each field contains either a "Y" or "N" value.
When the "read-only" condition is satisfied, two of the three radio group items incorrectly do not have either the "Yes" or "No" radio button checked. When I change all three fields from "radio group" to "select list" then all three fields display either a "Yes" or "No" value correctly.
Doesn't the radio group work when the read-only condition is satisfied? Is there a work-around to it?
Thanks, AndyWe are using APEX version 2.0.
Has this been fixed in version 2.2? -
Disable Radio button in a Radio Group
I have a radio group wiht four radio buttons. I would like to diable one of three radio buttons based on specific condtions. For rdisabling the radio group I use the syntax
SET_ITEM_PROPERTY('BLOCKNAME.RADIOGROUP',ENABLED,PROPERTY_FALSE);
Please help me with the syntax to disable only one button from the radio group
thanksBEGIN
SET_RADIO_BUTTON_PROPERTY('BLOCK3.RADIO','R1',ENABLED,PROPERTY_FALSE);
END;where BLOCK3.RADIO references your radio group and R1 references the radio button you want to disable :)
Regards
Carlos -
Spry Radio Group, sum of values
I have done this in actionScript, but am wondering if it is
possible using Spry radio groups.
I have an html page with 3 radio groups. Each unique radio
group has 3 available selections, each with respective numeric
values. I would like to be able to make a selection of any of the
radio group options, and cause a calculable field to display the
sum of the 3 radio group values.
To see the exact example of this, and how it looks in Flash,
go here:
Sample
of what I want, but in Flash
For my current purposes, I could just as easily use the
existing calculator that I've already created in Flash. But I want
to learn more about the Spry features in CS3, and this seems like a
good launching point.
If you can recommend a tutorial, that would be best.
Thank you!
rSbisa wrote:
> I have done this in actionScript, but am wondering if it
is possible using Spry
> radio groups.
>
> I have an html page with 3 radio groups. Each unique
radio group has 3
> available selections, each with respective numeric
values. I would like to be
> able to make a selection of any of the radio group
options, and cause a
> calculable field to display the sum of the 3 radio group
values.
>
> To see the exact example of this, and how it looks in
Flash, go here:
>
http://www.viewablebenefits.com/radnet/flash/calc.html
>
> For my current purposes, I could just as easily use the
existing calculator
> that I've already created in Flash. But I want to learn
more about the Spry
> features in CS3, and this seems like a good launching
point.
>
> If you can recommend a tutorial, that would be best.
>
> Thank you!
>
This can be done easily enough with client side js, no need
for Spry.
Mick -
Dynamic action on radio group in tabular form
Hi,
I'm very new to APEX and I've tried searching the web, but I can't seem to find a good answer for my problem. I have a page in APEX with a tabular form with 6 columns. The last column is supposed to show/hide a button for each row based on the value of a radio group (static LOV) with 2 options in column 5. I want to do this with a dynamic action on the radio group, but I'm having trouble figuring out how to do this. Since the radio group is in a tabular form it's not an item and so I can't just select it in the dynamic action wizard. I figure I have to use a JQuery selector here, but my knowledge of this is very limited.
I've created the button in the select statement for the tabular form like this:
select
"ROWID",
"DATA_COLLECTION_ID",
"ID",
"VARIABLE_NO",
"VARIABLE_NAME",
"DATA_TYPE",
'<a href="javascript:epf.dialog.open(''f?p=&APP_ID.:18:&SESSION.::::P18_ROWID,P18_ID:'||ROWID||','||ID||''',800,700);" id="Category" class="epf-button"><span class="epf-tooltip" data-epf-tooltip="Definer kategorier for denne variabelen"></span>Definer Kategori</a>' category
from "MATH_USER"."STA_VARIABLES"
where "DATA_COLLECTION_ID" = :P17_IDAny help would be greatly appreciated.
- Patrikpatrikfridberg wrote:
$('input[id="category"]')[currIndex].hide();;where does this category come from? and you are referencing id attribute which can only handle one row.
You must make the jquery selector based on column name (inspect your column using firebug/chrome and see the name attribute of the column form element, it will in format f0x).
Look at my original code below and i am controlling a column with name f01
>
It still doesn't work for me. From what I understood from the "Incorporating JavaScript into an application" page I should put the code in the JavaScript section. I tried that too, but nothing changed. So now I'm thinking there is something wrong with the code itself?
YES
this is my original code
function test(pThis) {
//get the curren row index on change
var currIndex = $('select[name="'+pThis.name+'"]').index(pThis);
if (pThis.value=='20') {
$('input[name="f01"]')[currIndex].style.display = 'block';
else {
$('input[name="f01"]')[currIndex].style.display = 'none';
} -
Dynamic action on "Change" of Radio group value
Hi,
I'm using Apex 4.1 on XE 11G.
If I create a simple dynamic action which shows/hides a field on the change of an item of type select list this works great.
So for example if the value of the select list is 1 then show another field and otherwise hide this other field.
If I change the type of the first field ( the select list ) to a radio group the dynamic action stops working. It looks like the value of the radio group does not get changed when I click another value in the radio group.
I'm somehow able to bypass this by using a dynamic action which fires when the radio group is clicked and then evaluatie it's value via JS, but that's not really the ideal solution.
Is there some basic difference in radio groups and select lists when it comes to storing values and/or dynamic actions which are based on the change event on that item ?
Regards
Bas
Edited by: Bas de Klerk on 31-mei-2012 6:42Take a look at the Radio group item in HTML DOM using FF/Firebug or IE/DevTools, and you will see the difference.
If you have neither of the 2 debug tools , time you get one.
Regards,
Maybe you are looking for
-
How do I use iTunes Store balance to buy an App on my iPhone?
I have a balance in my iTunes Store account and want to purchase an App on my iPhone. When I try to purchase an App it does not see my balance and wants to charge a credit card. How do I use those funds?
-
Each time I sync my iphone to my macbook all new appointments are transferred, but the times on the iphone are reset 4 hours earlier. The appointments and times stay are correct on the macbook. I have made new appointments on the iphone and they are
-
I now have my daughters iPad can you please tell me why I can't set up iCloud.in settings the iCloud is greyed out also how do I change her mail account to mine?
-
I am trying to reset my admin password because I forgot my original one.
I am trying to reset my admin password because I forgot my original one.
-
Dyanamically determining receivers
Hi experts, i had an requirement that i have to send the IDOC to multiple receiving system based on certain conditions. Receiver determination should happend dynamically(logical routing) based on mapping content we have send the data either file syst