Radiogroup problem

I'm having an issue with a sql query function that returns rows for the user based on search criteria ( a name ). The user is then only allowed to select one row from that result.
The row data is then to be processed etc etc.
this is the query to return rows. The user should only select one row to process. So i've implemented radiogroup.
What is returned is a userid ( ug_rebate.id ) the status, plus name,address,city etc etc.
SELECT      htmldb_item.hidden(1,ug_rebate.id ) hide,
     htmldb_item.radiogroup(2,ug_rebate.id) ug_id,
     ug_rebate.status, blah blah blah ...
The issue is that the global array is either not set properly or i'm not using the API correctly. There is no default selected value for the radio group, since the values are dynamic.
Here is how i process the chosen row - kicked off with a submit button on the region area ( not the item ):
begin
for x in 1 .. htmldb_application.g_f01.count loop
if ( htmldb_application.g_f02(x) = htmldb_application.g_f01(x) ) then
select contact_id into :P30_CONTACT_ID
from ug_rebate
where id = htmldb_application.g_f02(x) ;
else null;
end loop;
exception
when NO_DATA_FOUND then
begin
FOR i IN 1 .. HTMLDB_APPLICATION.G_F01.COUNT LOOP
insert into contacts (
id,
company_id,
firstname,
lastname,
addr1,
city,
state,
zip,
updateuserid,
updateuserdt,
country_id ) values (
CONTACTSSEQ1.NEXTVAL,
:P1_COMPID,
substr(htmldb_application.g_f03(i), 1, (instr(htmldb_application.g_f03(i),' ' ) ) ),
SUBSTR(htmldb_application.g_f03(i), instr(htmldb_application.g_f03(i), ' ', -1) + 1 ),
htmldb_application.g_f04(i),
htmldb_application.g_f05(i),
htmldb_application.g_f06(i),
htmldb_application.g_f07(i),
:P1_USERID,
sysdate,
1 ) returning id into :P30_CONTACT_ID ;
update ug_rebate set contact_id = :P30_CONTACT_ID where id = htmldb_application.g_f01(i) ;
end loop;
end;
end;
so when the page is submitted, the submit process checks to see if the customer( contact ) is already in the table, and if not, create a new record.
the page is then redirected to another page which displays the unique contact info.
Any help is most appreciated -

The problem was that the selected row from the radiogroup was not being processed properly.
I found the problem, and most of it was with my code/logic.
Here is the fix that works:
declare
l_c int ;
l_id int ;
l_nextval int ;
type ug_rebate_tp is table of ug_rebate%ROWTYPE index by BINARY_INTEGER ;
v_ug_rebate ug_rebate_tp ;
begin
for i in 1..htmldb_application.g_f01.count loop
select i into :P30_COUNTER from dual ;
select contact_id into :P30_CONTACT_ID
from ug_rebate
where id = htmldb_application.g_f01(i) ;
select htmldb_application.g_f01(i) into :P30_UGID from dual;
if ( :P30_CONTACT_ID IS NULL ) then
select 'blah' into :P30_COUNTER from dual;
select id, client_code,offer_code,status,name,address_1, address_2,
city,state,zip_code,country,amount, reject_reason_1, reject_reason_2,
reject_reason_3,contact_id, firstname,lastname into v_ug_rebate(1)
from ug_rebate where id = :P30_UGID ;
insert into contacts (
company_id,
firstname,
lastname,
addr1,
addr2,
city,
state,
zip,
updateuserid,
updateuserdt,
country_id ) values(
:P1_COMPID,
v_ug_rebate(1).firstname,
v_ug_rebate(1).lastname,
v_ug_rebate(1).address_1,
v_ug_rebate(1).address_2,
v_ug_rebate(1).city,
v_ug_rebate(1).state,
v_ug_rebate(1).zip_code,
:P1_USERID,
sysdate,
1 ) returning id into l_nextval ;
update ug_rebate set contact_id = l_nextval where id = :P30_UGID ;
select l_nextval into :P30_CONTACT_ID from dual ;
else null;
end if;
end loop;
end;

Similar Messages

  • Passing values between two forms

    hi all,
    In form1, i have details of a particular contract driven from clicking the edit button of the report.
    In form1 all the fields are text box and displayed as : disable save states.
    From form1 when i click the edit button it goes to the form2 for editing that particular record.
    In form2 some of the fields are replaced by select list and radiogroups.
    problem is:
    the data's from form1 (which is in text box disabled) is not getting displayed in the form2 in form of radio groups
    Please, could any one give a solution for this?
    whether it can be done?
    thanks in advance.

    You can try to pass the parameters (go to url region of the page).
    Leo

  • Problem with populating a radiogroup using javascript

    I have a rediogroup in a form and am using javascript and process to fill the value of that radiogroup. However, i always got error message with the javascript. Could somebody help me check what is wrong. here is the scrpits:
    if(l_Opt_Xml1.firstChild) {
    if l_Opt_Xml1.firstChild.nodeValue == 'F'
    html_GetElement('P59_SEX')[0].checked = true;
    if l_Opt_Xml1.firstChild.nodeValue == 'M'
    html_GetElement('P59_SEX')[1].checked = true;
    Thanks.
    Jen

    I have a rediogroup in a form and am using javascript and process to fill the value of that radiogroup. However, i always got error message with the javascript. Could somebody help me check what is wrong. here is the scrpits:
    if(l_Opt_Xml1.firstChild) {
    if l_Opt_Xml1.firstChild.nodeValue == 'F'
    html_GetElement('P59_SEX')[0].checked = true;
    if l_Opt_Xml1.firstChild.nodeValue == 'M'
    html_GetElement('P59_SEX')[1].checked = true;
    Thanks.
    Jen

  • Re: radiogroup keep set: more problem

    Thanks Raj
    Now, I tell you a details like follow (let's use checkbox)
    I have a table name testcase (o as a checkbox)
    ID Component Pass Fail (defaut)
    1 install1 o o
    2 Email o o
    In the region SQL Query I create the table as follow
    select htmldb_item.hidden(1,ID)ID, component,
    htmldb_item.checkbox(2,Pass)Pass
    htmldb_item.checkbox(3,fail)fail
    from testcase
    This table 1 make of page1
    I create a button "doit" on page1 check checkbox on tabel and click "doit" the sum of component pass and fail will appear on report page which is in the page2
    Ex.
    ID Component Pass Faill
    1 Install check o
    2 Email o check
    Click doit
    Report table on page 2 show
    Total Pass Fail
    2 1 1
    I doing oK with the function of calculation for the report table in page2 but at the page 1, I received a defaut table. Therefore, QA guy does not know which commponent pass or fail. My point is try to make the check stay at the checked possition. Therefore in PL/SQL Region I write the following with the hope it check is stay back
    begin
    for i in 1..htmldb_application.g_f01.count
    loop
    --(I mimic the htmldb_item.text)
    update testcase
    set
    pass = htmldb_application.g_f02(i),
    fail = htmldb_application.g_f03(i)
    where id = htmldb_application.g_f01(i);
    end loop;
    end;
    Run it it flag the error. How can I keep the check check box at its possition
    To learn about collection cut and paste the example in reading about validation using collection into an application (follow exact the steps indicates) I receive a blank page due to error "SQL query do not found data" Please recheck this example also.
    thanks a million

    we're starting to go in circles, here, but i'll say this again: you will find no values in those htmldb_application.g_fNN arrays when your page is rendering. for this reason, it does you NO GOOD to check it in your pl/sql region as you're trying to do. that's why you're getting that error: those arrays are empty at the time you're trying to check them. they're ONLY POPULATED with your checked values while the page is being processed. given this, you have to TRAP THOSE SUBMITTED VALUES RIGHT AFTER THE "DOIT" button is clicked. storing them in an htmldb item from a process that fires after the page is submitted, is an easy way to do this (the howto doc i suggested shows how to "trap" those values to a collection. it's your choice how you trap the vals, but you have to do it somehow). once you have those checked values stored somewhere you can reference them, you can use them in your page 2 report or pl/sql region. please make sure you understand this concept before posting another question on this topic. if you don't get it, please explain what needs more clarification.
    thanks,
    raj

  • Read-only radiogroup with default doesn't save state in 2.0

    Hi,
    I upgraded to HTMLDB 2.0 and noticed a change in behavior. Namely, when I have a read-only radio group with a default value and a not-null validation, the validation claims fails although a radio button is selected from the disabled radio group.
    Here's a small app I generated to demonstrate the issue:
    http://htmldb.oracle.com/pls/otn/f?p=34464
    Go there and try to create a new EMP.
    The only things added after the generation are:
    1. Not-null validations on several of the fields
    2. Changed MGR to a "Select List"
    3. Changed DEPTNO to a radio group with these properties:
    a) default value type: static; default value: 20
    b) read-only when: P2_EMPNO is Null
    This used to work fine in 1.6 - namely, the default value got it to the session state and consequently the validation succeeded and the new record was created with the default value.
    It also works fine if the Radio Group is not read-only.
    I was able to fix the problem by adding a calculation to the P2_DEPTNO item to set the default value there. This of course does not show the default on the form for the new record, so I had to keep the default on the item level as well - which is a potential source of bugs when those two defaults somehow get different values (e.g., when I change only one of them and forget about the other) - the user will see one thing displayed while another will be saved. So any solutions involving keeping the default value on only one place AND visible to the end user when creating new records are welcome.
    I haven't had time yet to test with other item types - maybe next week...
    Have a nice weekend!
    Flado

    Scott,
    Yes, in 1.6 this used to work fine - the radiogroup was displayed as disabled, and the default value was selected, and the not-null validation succeeded, and all I did was set the default value of the radiogroup. I have no 1.6 environment anymore to test it, but I'm sure it was working, because after I upgraded to 2.0, it stopped working and I got a bug report from a user very, very quickly :-(.
    By "adding a calculation to the P2_DEPTNO item" I mean "adding a computation of the P2_DEPTNO item to the page". Sorry about me being lazy here. It was (still is, in my production application) a conditional after-submit computation (if <primary key item> is null, set <radiogroup item> to <default value>)
    Thank you for the suggestion. I implemented it in the demo app. What I did was:
    1. remove the default value from P2_DEPTNO
    2. Add an unconditional after-header computation that assigns P2_DEPTNO with the static value 20
    I am able to create new EMPs now, but nothing is selected in the disabled radiogroup on the create page, although the value 20 is saved in the session state before the items are rendered, according to the debug info (you can try it out and see).
    To recap, I still need to keep the default value in two places: default of the radiogroup (to get it displayed on the create form), and in a computation (to set the session state).
    Cheers,
    Flado

  • Who can help me :)--a problem with java program(reset problem in java )

    I do not know how to make the button reset,my program only could reset diagram but button.If any one who could help me to solve this problem.The problem is When the reset button is pressed, the image should immediately revert to the black square, and the 4 widgets listed above should show values that
    correspond to the black square.The code like this,first one is shapes:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class shapes extends JFrame {
         private JPanel buttonPanel; // panel for buttons
         private DrawPanel myPanel;  // panel for shapes
         private JButton resetButton;
        private JComboBox colorComboBox;
         private JRadioButton circleButton, squareButton;
         private ButtonGroup radioGroup;
         private JCheckBox filledButton;
        private JSlider sizeSlider;
         private boolean isShow;
         private int shape;
         private boolean isFill=true;
        private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
                                   "green", "lightgray", "magenta", "orange",
                                   "pink", "red", "white", "yellow"};   // color names list in ComboBox
        private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public shapes() {
             super("Draw Shapes");
             // creat custom drawing panel
            myPanel = new DrawPanel(); // instantiate a DrawPanel object
            myPanel.setBackground(Color.white);
             // set up resetButton
            // register an event handler for resetButton's ActionEvent
            resetButton = new JButton ("reset");
             resetButton.addActionListener(
              // anonymous inner class to handle resetButton events
                 new ActionListener() {
                       // draw a black filled square shape after clicking resetButton
                     public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
                          // to decide if show the shape
                         myPanel.setShowStatus(true);
                             isShow = myPanel.getShowStatus();
                             shape = DrawPanel.SQUARE;
                         // call DrawPanel method setShape to indicate shape to draw
                             myPanel.setShape(shape);
                         // call DrawPanel method setFill to indicate to draw a filled shape
                             myPanel.setFill(true);
                         // call DrawPanel method draw
                             myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
             );// end call to addActionListener
            // set up colorComboBox
            // register event handlers for colorComboBox's ItemEvent
            colorComboBox = new JComboBox(colorNames);
            colorComboBox.setMaximumRowCount(5);
            colorComboBox.addItemListener(
                 // anonymous inner class to handle colorComboBox events
                 new ItemListener() {
                     // select shape's color
                     public void itemStateChanged(ItemEvent event) {
                         if(event.getStateChange() == ItemEvent.SELECTED)
                             // call DrawPanel method setForeground
                             // and pass an element value of colors array
                             myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
                        myPanel.draw();
                }// end anonymous inner class
            ); // end call to addItemListener
            // set up a pair of RadioButtons
            // register an event handler for RadioButtons' ItemEvent
             squareButton = new JRadioButton ("Square", true);
             circleButton = new JRadioButton ("Circle", false);
             radioGroup = new ButtonGroup();
             radioGroup.add(squareButton);
             radioGroup.add(circleButton);
            squareButton.addItemListener(
                // anonymous inner class to handle squareButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                           if (isShow==true) {
                                 shape = DrawPanel.SQUARE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                   }// end anonymous inner class
             );// end call to addItemListener
             circleButton.addItemListener(
                   // anonymous inner class to handle circleButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                             if (isShow==true) {
                                 shape = DrawPanel.CIRCLE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                             else
                                 System.out.println("Please click Reset button first");
                   }// end anonymous inner class
             );// end call to addItemListener
             // set up filledButton
            // register an event handler for filledButton's ItemEvent
            filledButton = new JCheckBox("Filled", true);
             filledButton.addItemListener(
              // anonymous inner class to handle filledButton events
            new ItemListener() {
                  public void itemStateChanged (ItemEvent event) {
                    if (isShow==true) {
                            if (event.getStateChange() == ItemEvent.SELECTED) {
                                  isFill=true;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                            else {
                                isFill=false;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                    else
                        System.out.println("Please click Reset button first");
              }// end anonymous inner class
             );// end call to addItemListener
            // set up sizeSlider
            // register an event handler for sizeSlider's ChangeEvent
            sizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 300, 100);
            sizeSlider.setMajorTickSpacing(10);
            sizeSlider.setPaintTicks(true);
            sizeSlider.addChangeListener(
                 // anonymous inner class to handle sizeSlider events
                 new ChangeListener() {
                      public void stateChanged(ChangeEvent event) {
                          myPanel.setShapeSize(sizeSlider.getValue());
                             myPanel.draw();
                 }// end anonymous inner class
             );// end call to addChangeListener
            // set up panel containing buttons
             buttonPanel = new JPanel();
            buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
             buttonPanel.add(resetButton);
             buttonPanel.add(filledButton);
            buttonPanel.add(colorComboBox);
            JPanel radioButtonPanel = new JPanel();
            radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
            radioButtonPanel.add(squareButton);
            radioButtonPanel.add(circleButton);
            buttonPanel.add(radioButtonPanel);
            // attach button panel & draw panel to content panel
            Container container = getContentPane();
            container.setLayout(new BorderLayout(10,10));
            container.add(myPanel, BorderLayout.CENTER);
             container.add(buttonPanel, BorderLayout.EAST);
            container.add(sizeSlider, BorderLayout.SOUTH);
            setSize(500, 400);
             setVisible(true);
         public static void main(String args[]) {
             shapes application = new shapes();
             application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }second one is drawpanel:
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
        private int shapeSize = 100;
        private Color foreground;
         // draw a specified shape
        public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
            int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
                 if (fill == true){
                     g.setColor(foreground);
                      g.fillOval(x, y, shapeSize, shapeSize);
                else{
                       g.setColor(foreground);
                    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
                 if (fill == true){
                     g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
                else{
                        g.setColor(foreground);
                    g.drawRect(x, y, shapeSize, shapeSize);
        // set showStatus value
        public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
        public boolean getShowStatus () {
              return showStatus;
         // set fill value
        public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
        public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
        // set shapeSize value
        public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
        // set foreground value
        public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
        public void draw (){
              if(showStatus == true)
              repaint();
    }If any kind people who can help me.
    many thanks to you!

    4 widgets???
    maybe this is what you mean.
    add this inside your actionPerformed method for the reset action
    squareButton.setSelected(true);
    colorComboBox.setSelectedIndex(0);
    if not be more clear in your post.

  • Impossible to change the Fontsize for a Radiogroup(with Submit).

    Impossible to change the Fontsize for a Radiogroup(with Submit).
    I have a Menue displayed from a Query like (select menue_title, id from lov_tabel)
    and displayed in a Report Region as a Radio group with Submit.
    The problem is, i've not been able to change the font size.
    What i' have tried.
    - Change the color works if i change "+Page Item"-> Element -> HTML Table Celle Attributes+ to
    style="font-size:1.2em; color:#CC00CC" I see the new color but NO change in font-size.
    - If change in Application-> Shared Components-> Templates
    copy the Template "Reports Region" to "MenueReport",
    then change on "MenueReport"->Template
    value to      <table class="t6ReportsRegion" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES# summary=""
         *style="font-size:1.2em; color:#CC00CC; font-family:Verdana"*>
         <tr><td class="t6Header">#TITLE#</td></tr>
         <tr><td class="t6ButtonHolder">#CLOSE#   #PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</td></tr>
         <tr><td class="t6Body">#BODY#</td></tr>
         </table>     option style="font-size:1.2em; color:#CC00CC; font-family:Verdana" inserted
         and then change in the template for the report region the Option
         Edit Region->User Interface -> Template to "MenueReport".
         I see a new color but NO font-size will be changed!
    - I have changed the query to     SELECT  ' <font size="4">' || rt_name as x, rt_nr  FROM report_types order by rt_nr     But there is NO change of font size, and the Tag <font size= .. is deprecated.
    Used Version is Apex apex_030200 with Firefox 3.5.5 Windows.
    After all this failed attempts, i have no idea how to change the font for page to a larger size.
    Can anyone help me and explain how to change the font size in Apex for a Radiogroupe?
    Thanks in advanced
    Dieter

    Assign a [static region ID|http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/ui.htm#sthref1438] to the region containing the radiogroup.
    Place the following code in the HTML Header page property, replacing static-region-id with the ID given to the region:
    <style type="text/css">
    #static-region-id label {
      font-size:1.2em;
    </style>after that how do we need to call this css
    and does it need to be called within the Region HTML table cell attributes of a region or in the HTML Form Element Attributes of the radio group items
    >
    CSS isn't "called". Learn how [themes, templates|http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/themes.htm#CJABAEIE] and CSS are used to control the appearance of APEX applications.

  • How to pass a value of the radiogroup to another page item

    Hi, I have a report with one column as a radiogroup. I have a process that execute the next code when I press a button:
    begin
    for i in 1..htmldb_application.g_f01.count
    loop
    update mesa_entrada set retomada = sysdate where id = htmldb_application.g_f01(i);
    end loop;
    end;
    I want to set the value of the item in another page with the value of the selected radiogroup, How i have to do?
    any suggestion will be welcome!
    Thanks!

    I have the same problem.
    On the new page the global variable HTMLDB_ITEM.G_F01 has 0 values.
    I created a process like this in the new page:
    :P300_FILENAME := HTMLDB_APPLICATION.G_F01.count;
    FOR I IN 1..HTMLDB_APPLICATION.G_F01.COUNT
    LOOP
    :P300_TEST := HTMLDB_APPLICATION.G_F01(I);
    END LOOP;
    and P300_FILENAME gets 0 and P300_TEST is empty. Any sugestions?

  • Apex_item.radiogroup using an LOV in a manual tabular form

    I'm on APEX 4.0.0.00.46 and I'm sure there must be an obvious solution that I'm missing here, but I'm having a problem setting up an apex_item.radiogroup on a manual tabular form. This is the basic query that I'm using:
    select apex_item.radiogroup(37,my_field) as my_field
    from my_table
    When I use the above query as my Region Source, it compiles fine. However, it seems as though the query won't pull in the value that currently exists in the table unless I set the Column Attribute called 'Display As' for the field to 'Standard Report Column'. When I do this, it seems to remove the capability to incorporate a LOV into the radio group. I'm attempting to incorporate a query like this into the radiogroup:
    select 'YES' d, 'Y' r
    from dual
    UNION ALL
    select 'NO' d, 'N' r
    from dual
    So, to recap, I can set up a Radio Group (query based LOV), but if I do, the query of the table will not pull in the current value from the table. If I change the 'Display As' Column Attribute to 'Standard Report Column', I can no longer incorporate the LOV. Please help if you have any ideas.

    I am not 100% sure what you are trying to do but I think I am close. Try using
    SELECT apex_item.radio_group_from_query
              (37,
               my_field,
               'SELECT ''YES'' d, ''Y'' r FROM dual
                UNION ALL
                SELECT  ''NO'' d, ''N'' r FROM dual'
              ) AS my_field
      FROM my_tableDenes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Problem regarding focusing elements after submit

    Hi all
    I have a bunch of radio groups with submit on my page . The requirement is to set focus on the next radiogroup with submit after any radiogroup with submit is clicked.
    But the problem is When user changes the value the focus is moving to the top of the page. Is there any way that we can keep the focus on the same item or other item at the same level ?
    I have written the following statement in HTML Form Element Attributes and Form Element Option Attributes of the first radiogroup with submit (called P4_X) : onClick = "document.getElementById('P4_E').focus();" (The last radiogroup with submit on the page is called P4_E).
    But alas it just doesnt work :-(
    If this is any help, I am pasting a sniplet of the 'view source' of my page
    <td colspan="2" valign="top" class="t3Body"><table class="formlayout" summary="" ><tr><td nowrap="nowrap" align="right"><a class="t3optionalwithhelp" href="javascript:popupFieldHelp('3886301842732082','12829541423701975766')" tabindex="999"></a></td>
    <td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="3886301842732082" /><fieldset id="P4_X"><input type="radio" name="p_v01" value="%null%" onclick="doSubmit('P4_X')" onClick = "document.getElementById('P4_E').focus();" /><span onClick = "document.getElementById('P4_E').focus();">%</span>
    <input type="radio" name="p_v01" value="choice1" checked="checked" onclick="doSubmit('P4_X')" onClick = "document.getElementById('P4_E').focus();" id="P4_X_1" />
    <span onClick = "document.getElementById('P4_E').focus();"><label for="P4_X_1">choice1</label></span>
    <input type="radio" name="p_v01" value="choice2" onclick="doSubmit('P4_X')" onClick = "document.getElementById('P4_E').focus();" id="P4_X_2" />
    <span onClick = "document.getElementById('P4_E').focus();"><label for="P4_X_2">choice2</label></span>
    <input type="radio" name="p_v01" value="choice3" onclick="doSubmit('P4_X')" onClick = "document.getElementById('P4_E').focus();" id="P4_X_3" />
    <span onClick = "document.getElementById('P4_E').focus();"><label for="P4_X_3">choice3</label></span></fieldset>
    <td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="3891304050742114" /><fieldset id="P4_E"><input type="radio" name="p_v08" value="choice1" onclick="doSubmit('P4_E')" id="P4_E_0" />
    <label for="P4_E_0">choice1</label>
    <input type="radio" name="p_v08" value="choice2" onclick="doSubmit('P4_E')" id="P4_E_1" />
    <label for="P4_E_1">choice2</label>
    <input type="radio" name="p_v08" value="choice3" onclick="doSubmit('P4_E')" id="P4_E_2" />
    <label for="P4_E_2">choice3</label></fieldset>
    <a class="eLink" title="Edit" href="javascript:popupURL('f?p=4000:371:14317056829894007819::::P371_ID,FB_FLOW_ID,FB_FLOW_PAGE_ID:3891304050742114,101,4');" tabindex="999"><img src="/i/e.gif" alt="Edit" class="eLink" /></a></td></tr>
    Please help me out !!
    Regards
    -Shantanu Dhanuka

    Hi,
    1 - Create a new HTML region on your page called "Scripts" and in the "Display Point" select "Before Footer" - this places the region at the bottom of the page.
    2 - Create a new Item and put in the new region. Call the item P1_FOCUS_FIELD. Set its Default Value to the name of the field that will receive the focus when the page is FIRST loaded (P_E_1?).
    3 - In the new region's Region Footer, add in the following:
    &lt;script type="text/javascript"&gt;
    var f = document.getElementById("P1_FOCUS_FIELD").value;
    document.getElementById(f).focus();
    &lt;/script&gt;
    4 - Update your submit process to set the value of P1_FOCUS_FIELD to the ID of the field that you want to receive the focus when the page is reloaded.
    Regards
    Andy

  • Radiogroup "onClick" function in ApEx?

    Hello,
    I have a radiogroup and a select list in a form. On click on the radiogroup the content of the select list should change.
    How is it possible in Apex. Is it just possible to do it with javascript and an "onclick" function?
    Thx in advance!
    Greetings, Hamburger

    I have a same problem, but I think that I resolved it with tis way
    1. Create a hidden static item (P?_CONT)
    2. Create a radiogroup with submit (P?_CHECK) with values (0,1)
    3. Create a selected list with redirect (P?_LIST:
    SELECT ... WHERE :P?_CHECK=..
    4. Create a report region : SELECT ... WHERE P?_LIST=...
    5. Create a branch (After submit) with clear cache option at this page
    and set items P?_CONT=&P?_CHECK., P?_CHECK=&P?CHECK.
    which are worked at condition P?_CONT != P?_CHECK
    It seems to me that it works well

  • A problem with java program(reset problem in java GUY)

    I do not know how to make the button reset,my program only could reset diagram but button.If any one who could help me to solve this problem.The problem is When the reset button is pressed, the image should immediately revert to the black square, and the 4 widgets listed above should show values that
    correspond to the black square.
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
        private int shapeSize = 100;
        private Color foreground;
         // draw a specified shape
        public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
            int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
                 if (fill == true){
                     g.setColor(foreground);
                      g.fillOval(x, y, shapeSize, shapeSize);
                else{
                       g.setColor(foreground);
                    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
                 if (fill == true){
                     g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
                else{
                        g.setColor(foreground);
                    g.drawRect(x, y, shapeSize, shapeSize);
        // set showStatus value
        public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
        public boolean getShowStatus () {
              return showStatus;
         // set fill value
        public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
        public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
        // set shapeSize value
        public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
        // set foreground value
        public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
        public void draw (){
              if(showStatus == true)
              repaint();
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class shapes extends JFrame {
         private JPanel buttonPanel; // panel for buttons
         private DrawPanel myPanel;  // panel for shapes
         private JButton resetButton;
        private JComboBox colorComboBox;
         private JRadioButton circleButton, squareButton;
         private ButtonGroup radioGroup;
         private JCheckBox filledButton;
        private JSlider sizeSlider;
         private boolean isShow;
         private int shape;
         private boolean isFill=true;
        private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
                                   "green", "lightgray", "magenta", "orange",
                                   "pink", "red", "white", "yellow"};   // color names list in ComboBox
        private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public shapes() {
             super("Draw Shapes");
             // creat custom drawing panel
            myPanel = new DrawPanel(); // instantiate a DrawPanel object
            myPanel.setBackground(Color.white);
             // set up resetButton
            // register an event handler for resetButton's ActionEvent
            resetButton = new JButton ("reset");
             resetButton.addActionListener(
              // anonymous inner class to handle resetButton events
                 new ActionListener() {
                       // draw a black filled square shape after clicking resetButton
                     public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
                          // to decide if show the shape
                         myPanel.setShowStatus(true);
                             isShow = myPanel.getShowStatus();
                             shape = DrawPanel.SQUARE;
                         // call DrawPanel method setShape to indicate shape to draw
                             myPanel.setShape(shape);
                         // call DrawPanel method setFill to indicate to draw a filled shape
                             myPanel.setFill(true);
                         // call DrawPanel method draw
                             myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
             );// end call to addActionListener
            // set up colorComboBox
            // register event handlers for colorComboBox's ItemEvent
            colorComboBox = new JComboBox(colorNames);
            colorComboBox.setMaximumRowCount(5);
            colorComboBox.addItemListener(
                 // anonymous inner class to handle colorComboBox events
                 new ItemListener() {
                     // select shape's color
                     public void itemStateChanged(ItemEvent event) {
                         if(event.getStateChange() == ItemEvent.SELECTED)
                             // call DrawPanel method setForeground
                             // and pass an element value of colors array
                             myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
                        myPanel.draw();
                }// end anonymous inner class
            ); // end call to addItemListener
            // set up a pair of RadioButtons
            // register an event handler for RadioButtons' ItemEvent
             squareButton = new JRadioButton ("Square", true);
             circleButton = new JRadioButton ("Circle", false);
             radioGroup = new ButtonGroup();
             radioGroup.add(squareButton);
             radioGroup.add(circleButton);
            squareButton.addItemListener(
                // anonymous inner class to handle squareButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                           if (isShow==true) {
                                 shape = DrawPanel.SQUARE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                   }// end anonymous inner class
             );// end call to addItemListener
             circleButton.addItemListener(
                   // anonymous inner class to handle circleButton events
                new ItemListener() {
                       public void itemStateChanged (ItemEvent event) {
                             if (isShow==true) {
                                 shape = DrawPanel.CIRCLE;
                                 myPanel.setShape(shape);
                                 myPanel.draw();
                             else
                                 System.out.println("Please click Reset button first");
                   }// end anonymous inner class
             );// end call to addItemListener
             // set up filledButton
            // register an event handler for filledButton's ItemEvent
            filledButton = new JCheckBox("Filled", true);
             filledButton.addItemListener(
              // anonymous inner class to handle filledButton events
            new ItemListener() {
                  public void itemStateChanged (ItemEvent event) {
                    if (isShow==true) {
                            if (event.getStateChange() == ItemEvent.SELECTED) {
                                  isFill=true;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                            else {
                                isFill=false;
                                  myPanel.setFill(isFill);
                                  myPanel.draw();
                    else
                        System.out.println("Please click Reset button first");
              }// end anonymous inner class
             );// end call to addItemListener
            // set up sizeSlider
            // register an event handler for sizeSlider's ChangeEvent
            sizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 300, 100);
            sizeSlider.setMajorTickSpacing(10);
            sizeSlider.setPaintTicks(true);
            sizeSlider.addChangeListener(
                 // anonymous inner class to handle sizeSlider events
                 new ChangeListener() {
                      public void stateChanged(ChangeEvent event) {
                          myPanel.setShapeSize(sizeSlider.getValue());
                             myPanel.draw();
                 }// end anonymous inner class
             );// end call to addChangeListener
            // set up panel containing buttons
             buttonPanel = new JPanel();
            buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
             buttonPanel.add(resetButton);
             buttonPanel.add(filledButton);
            buttonPanel.add(colorComboBox);
            JPanel radioButtonPanel = new JPanel();
            radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
            radioButtonPanel.add(squareButton);
            radioButtonPanel.add(circleButton);
            buttonPanel.add(radioButtonPanel);
            // attach button panel & draw panel to content panel
            Container container = getContentPane();
            container.setLayout(new BorderLayout(10,10));
            container.add(myPanel, BorderLayout.CENTER);
             container.add(buttonPanel, BorderLayout.EAST);
            container.add(sizeSlider, BorderLayout.SOUTH);
            setSize(500, 400);
             setVisible(true);
         public static void main(String args[]) {
             shapes application = new shapes();
             application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }Many thanks

    Who is this Java guy anyway?

  • How to create yes or no radiogroup dynamically for a set of questions

    hi,
    I am new to APEX.Depending upon my project requirement I need to create a set of questions with yes or no as radiogroup buttons,appended with a textarea for each question.For ex:
    1.Name o Y o N [ "text area"]
    The above line specifies the model I need.
    Here text area is used for writing comments.
    Now the question is how can I create them dynamically using apex_item.
    Its very urgent.Kindly reply me soon.
    Thanks in advance.

    Thanks for ur quick reply.
    But what actually I need is,I need to create the radiobuttons also dynamically.
    I have created them by the following syntax,
    select ename,apex_item.radiogroup(eno,'y' ) yes,apex_item.radiogroup(eno,'N')
    from emp;
    but the problem with this is ,
    when I inserted yes for the first one it is taking and if i am giving the second one also as YES then it is not accepting ..means it is checking the second item by clearing the first one.
    What I need is when I check the second one the first one should not get cleared.
    Thanks in advance.

  • RadioGroup and Textbox on the same page. (HTMLDB_APPLICATION.G_F0?)

    I am trying to test a case where a report based on a table has both
    a) radio groups
    b) checkboxes
    for each each record.
    The problem I see is that all the items have the standard HTMLDB_APPLICATION.G_F0X (which is limited to 50).
    Consider this table definition..that i created to explain this case..
    SQL> desc temp;
    Name              Null?    Type
    EMPNO             NOT NULL NUMBER(4)
    ENAME                      VARCHAR2(10)
    JOB                        VARCHAR2(9)
    RQR_IND                    NUMBER
    LOCK_IND                   VARCHAR2(1)The required_ind can have three options 0,1 and 2 and to implement it, say we use.. radio group function..
    The lock ind has two possible values (yes (or) No and to implement it, say we use.....checkbox function..
    Here are the two possible implementations and the problems that I see...
    1) Use an p_Id of 1 for the radio group and p_id of 2 for the checkbox...
    select empno,
           ename,
           job,
           htmldb_item.radiogroup(1,empno,
                                  'threeOptions??'
                                  ) rqr_ind,
           htmldb_item.checkbox(2,empno,
                                case when lock_ind = 'Y' then 'CHECKED'
                                     else ''
                                end
                                ) lock_ind
      from tempUI : http://www.flickr.com/photos/48119423@N06/4406620805/
    The problems with this case
    a) how do i display multiple radio buttons for each radio group.
    b) all the radio groups havethe same name (F01) so the radio group is actually vertical instead of horizantal (per row).
    2) The existing code has dynamically generated radio groups (from 1-50) .. one for each row...using code similar to this...and the update process has 50 individual updates .. one for each row...
    select empno,
           ename,
           htmldb_item.radiogroup( mod(rownum-1,50)+1,
                                  'Y',
                                  rqr_ind,
                                  'Required'
        || htmldb_item.radiogroup( mod(rownum-1,50)+1,
                                  'N',
                                  rqr_ind,
                                  'Optional'
        || htmldb_item.radiogroup( mod(rownum-1,50)+1,
                                  '3',
                                  rqr_ind,
                                  'Do Not Display'
                                  ) Required_Indicator,
         htmldb_item.checkbox(mod(rownum-1,50)+1,
                                empno,
                                case when lock_ind = 'Y' then 'CHECKED'
                                     else ''
                                end ) lock_ind
        from temp  The problem with this case is that the radio groups are rendered and the values without any problems..but when i add a different array, the values HTMLDB_APPLICATION.G_F01 refer to that of the radio group already.
    UI : http://www.flickr.com/photos/48119423@N06/4407457354/in/set-72157623555719072/.
    please advice as to how I can accommodate both of them in the same page and how I can refer to them in my process.
    Thanks,
    Rajesh.

    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
    http://java.sun.com/docs/books/tutorial/javabeans/index.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPBeans.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/
    http://java.sun.com/developer/onlineTraining/index.html
    http://java.sun.com/docs/books/tutorial/index.html
    http://developers.sun.com/events/techdays/codecamps/index.html

  • Capture label of a radiogroup-Please help.

    Hi Everyone,
    I created 4 radiogroups(page items) with static LOV. The labels of these radiogroups are dynamically populated using javascript.
    How can I retrieve these labels corresponding to the selected radiogroup. I tried different combinations as
    :CB_LABEL or &CB_LABEL. - None of them worked.
    Any help is appreciated. Thank you in advance,
    rgds,
    Suma.

    Hi Patrick,
    This is the javascript in the html header of my page:
    <script type="text/javascript">
    function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && document.all)? document.all :
    oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var j=0; j<arrElements.length; j++){
    oElement = arrElements[j];
    if(oRegExp.test(oElement.className)){
    arrReturnElements.push(oElement);
    return (arrReturnElements)
    function f_LabelSwitch(){
    var all_labels = html_GetElement('P5_questions').value;
    var aLabels = all_labels.split(":")
         var l_labels = getElementsByClassName(document,'a','t10OptionalLabelwithHelp');
         for(var i=0;i<l_labels.length;i++){
                   if(l_labels.getAttribute('cb:label')&&aLabels[i]){l_labels[i].innerHTML = aLabels[i]}
         return;
    }</script>
    And onload of my page I have a fn : onload=f_LabelSwitch();
    And on my page I created 4 page items (CB,CB1, CB2, CB3) whose display type is radio group with submit and source is STATIC LOV (YES, Y : NO ,N).
    An don submit, I want to create a collection to store the value of CB (:CB which will be Y or N depending on what the user chooses) and also I need label of CB (which would be the retrieved value from the databaseie p5_QUESTIONS-hidden item).
    So this is where my problem lies!! Thank you for your time.
    rgds,
    Suma.

Maybe you are looking for

  • Mirroring Issue - App not viewable

    I am using a mini-DVI to VGA connector to a LCD screen. When I first set up the duel screens I had no issues. I was using iMovie on the LCD screen and I switched to the mirror screen setting. Since then I have been unable to edit anything in iMovie.

  • How to update my 10.6.8 mac to yosemite?

    I recently decided I'd really like to update my mac, but when I clicked the "Get" button in the app store, it says "this version of OS X 10.10 cannot be installed on this computer." How can I download it? According to the requirements page, I should

  • File Sharing

    Well this has me baffled. We have installed SL on a desktop, a 17" macbook pro, and a 20" iMac. The iMac and/or the desktop have no problems sharing files with the other 2 machines. The macbook has no problem with the iMac and can accept files from t

  • Mailer Program Not Triggering Mail in ECC 6.0

    Hi Experts, We have upgarded  from 4.6b to ECC 6.0, In an program we are using function module SO_NEW_DOCUMENT_ATT_SEND_API1 It was working fine 4.6b but In ECC it is not triggering mail to an internet address mentioned. In SBWP I can see the mail in

  • BW Questions

    Hi, Can someone help me with the answers 4.     What is table partition? 5.     What are the options available in transfer rule and when ABAP code is required during transfer rule what important variables you can use? 6.     How would you optimize th