Radio buttons and SQL

Hi,
I have a column in my database called buy_or_share. I have
the type set at ENUM ('buy', 'share') and default as: buy. I am
building a search page for users to search whether they want to buy
or share (in the form of a radio group) and then a search bar for
the user to type into freely what product, category, or store name
they are seeking.
I have tried to attach dynamic radio feature to the buttons
and I've also tried quite a few different ideas with the recordset,
but nothing has worked. When I search for a product, I am given
results of the product for both buy and share so obviously the
radio group isn't separating the results to either buy or share.
The trouble is that I don't know what I'm doing wrong, is it
something with the radio group? the recordset? the dynamic form
elements? my php code, should I have a conditional statement
surrounding the buttons so that if 'buy' is true then retrieve the
database for 'buy' else 'share' true then get that information,
else neither are true display 'no results'?... Thank you for the
help!
I have attached the relevant code...
Brad

Hi,
One way to achieve this would be to
Create an Item 'Radiogroup (with Submit)' called PXX_RADIO and enter 'STATIC:SQL 1;1,SQL 2;2,SQL 3;3' in the List of values definition
Create a region of type 'SQL Query (PL/SQL function body returning SQL query) and enter
begin
IF :PXX_RADIO = 1
THEN
return 'Select 1 from dual;';
ELSIF :PXX_RADIO = 2
THEN
return 'Select 2,2 from dual;';
ELSIF :PXX_RADIO = 3
THEN
return 'Select 3,3,3 from dual;';
end if;
end;
Set the region to use 'Use Generic Column Names (parse query at runtime only)
In the regions conditional display set condition type to 'Value of Item in Expression 1 is NOT NULL' and enter PXX_RADIO in Expression 1
So depending on the value of the radiogroup the relevant SQL is executed.
Hope this helps
Regards
Paul

Similar Messages

  • How to create popup window with radio buttons and a input field

    Hi Guys,
    Can somebody give some directions to create a stand alone program to create a window popup with 2 radio button and an input field for getting text value. I need to update the text value in a custom table.
    I will call this stand alone program from an user exit. 
    Please give me the guidance how go about it or please give any tutorial you have.
    Thanks,
    Mini

    Hi,
    There are multiple aspects of your requirements. So let's take them one at a time.
    You can achieve it in the report program or you can use a combination of the both along.
    You can create a standalone report program using the ABAP Editor (SE38). In the report program you can call the SAP Module pool program by CALL Screen <screen number>. And then in the module pool program you an create a subscreen and can handle the window popup with 2 radio button and an input field for getting the text.
    For help - Module Pool programs you can search in ABAP Editor with DEMODYNPRO* and you will ge the entire demo code for all dialog related code.
    For Report and other Module pool help you can have a look at the following:
    http://help.sap.com/saphelp_nw70/helpdata/en/47/a1ff9b8d0c0986e10000000a42189c/frameset.htm
    Hope this helps. Let me know if you need any more details.
    Thanks,
    Samantak.

  • Radio button and associated functionality is not working!

    Hi Pros,
    I am facing the following problem:
    1.I have an interactive PDF created in Acrobat 9 Pro.
    2.PDF have few radio buttons, each radio buttons ahave assigned valus(eg: 1,2,3 etc)
    3.I have a text box in which the value of selected radio button is displayed.
    4.PDF is working fine on my machine.
    5.Client is having Internet Explorer version 7.0.5 and Adobe reader:8.2.6
    6.The radio buttons and associated functionality is not working on client's machine.
    7.The text box shows '0' even if we a radio button with value 2 or 1 is selected.
    What will be the problem? How can I fix this issue?
    Please help.

    Thanks alot for helping me on this.
    Thanks to u also ~graffiti

  • Radio button and group

    Hi All,
    Not quite follow what dev guide says about radio button and group implementation.
    I tried but always got strange behavior.
    I have a subtab with two radio buttons (rbt1 and rbt2)
    rbt1 property defined as:
    Initial Value: Y
    Checked Value: Y
    Unchecked Value: N
    rbt2 property defined as:
    Initial Value: Y
    Checked Value: N
    Unchecked Value: Y
    Also, In my subtab PR, I init these two bts as a group:
    OAMessageRadioButtonBean colButton1 =
    (OAMessageRadioButtonBean)webBean.findChildRecursive("rbt1");
    colButton1.setName("colGroup");
    colButton1.setSelectedValue("Y");
    OAMessageRadioButtonBean colButton2 =
    (OAMessageRadioButtonBean)webBean.findChildRecursive("rbt2");
    colButton2.setName("colGroup");
    colButton2.setSelectedValue("N");
    When the subtab render first time, rbt1 is checked and rbt2 is unchecked as expected. but when I go to other subtab then come back, the rbt1 is unchecked and rbt2 is checked (switch automatically).
    The subtab PR is the only place I set this radio button value and group as showing above. Somewhere wrong with my logic or setting?
    Regards,
    KJ

    Hi All,
    Got issue resolved. When I was replying Ranjit previous post, I mentioned both of buttons bind to same VO attribute. Since the first rbt1 has defined checked and unchecked values (Y & N) and both of buttons are defined in same group, so I took off second rbt2 attribute binding then it works (won't switch automatically anymore).
    I still defined init values for both of buttons and also removed setSelectedValue() method calls from PR.
    Thanks again for the great helping.
    KJ

  • Radio button and select option in one line

    Hi,
    I have an requirement in which i need to display the radio button and select option in one line in an report program.
    How can i do it? 
    Regards,
    Arun.

    Hi,
    Try this code.
    TABLES: bkpf.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: p_r1 RADIOBUTTON GROUP a.
    SELECTION-SCREEN COMMENT 4(20) text-001 FOR FIELD p_r1.
    SELECTION-SCREEN COMMENT 30(12) text-002 FOR FIELD p_date.
    SELECTION-SCREEN POSITION 39.
    SELECT-OPTIONS: p_date FOR bkpf-budat OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: p_r2 RADIOBUTTON GROUP a.
    text-001 = " Radio button"
    text-002 = "Posting date"

  • Please help! How can I validate Radio Buttons and List Menu with PHP.

    Hello everyone, I have been learning PHP step by step and
    making little projects.
    The point is I find it easy to learn by doing "practical
    projects."
    I have been reading the David Powers's Book on PHP Solutions
    and it's really great, however there is nothing mentioned regarding
    Validating Radio buttons. I know the book cannot cover every aspect
    of PHP and maybe someone in here can help.
    I have been learning how to process HTML forms with PHP.
    The problem is every book or tutorial I have read or
    encountered fall short on validation.
    I'm wondering how I can learn to validate Radio Buttons and
    Select List Menu.
    I have managed to create validation for all other fields but
    have no clue as to how I can get validation for Radio Buttons and
    List Menu.
    I would also like an error message echoed when the user does
    not click a button or make a selection and try to submit the form.
    I would appreciate any help.
    Patrick

    It's not that default value is "None." In fact it's not. It
    will only be
    "none" when the form is submitted.
    Also if your submit button is names 'send' then
    $_POST['send'] will only be
    set if the form was submitted.
    Make sure you didn't hit the refresh button on your browser
    which usually
    reposts the information. Also make sure you did not reach the
    form from
    another form with the same button names.
    Otherwise paste the snippet.
    Also you can check what fields are set in the post array by
    adding this to
    the top of (or anywhere on) your page:
    print_r($_POST);
    Cosmo
    "Webethics" <[email protected]> wrote in
    message
    news:[email protected]...
    >
    quote:
    Originally posted by:
    Newsgroup User
    > Off the top of my head this should be no different than
    your radio buttons
    > except that 'productSelection' will always fail the
    !isset check when the
    > form is submitted since the default value is "None", and
    therefore always
    > set. :-)
    >
    > So how about this..?
    > <?php
    > if (isset($_POST['send']) and
    ($_POST['productSelection'] == "None"))
    > {echo "Please select a product.";}
    > ?>
    >
    >
    >
    >
    > "Webethics" <[email protected]> wrote
    in message
    > news:[email protected]...
    > > Another question - how do i applied the code you
    just showed me to
    > > select
    > > menu
    > > or select list?
    > >
    > > This is the list:
    > >
    > > <div class="problemProduct">
    > > <label for="productSelection"><span
    class="product_label">Product
    > > Name.</span></label>
    > > <select name="productSelection" id="products"
    class="selection">
    > > <option value="None">-------------Select a
    product----------</option>
    > > <option value="Everex DVD Burner">Everex DVD
    Burner</option>
    > > <option value="Vidia DVD Burner">Vidia DVD
    Burner</option>
    > > <option value="Excerion Super Drive">Excerion
    Super Drive</option>
    > > <option value="Maxille Optical Multi
    Burner">Maxille Optical Multi
    > > Burner</option>
    > > <option value="Pavilion HD Drives">Pavilion
    HD Drives</option>
    > > </select>
    > > </div>
    > >
    > > I thought I could just change the name is the code
    from operatingSystem
    > > to
    > > productSelection.
    > >
    > > Something like this:
    > >
    > > From this:
    > >
    > > <?php
    > > if (isset($_POST[send]) and
    !isset($_POST['operatingSystem']))
    > > {echo "Please select an operating system.";}
    > > ?>
    > >
    > > To this:
    > >
    > > <?php
    > > if (isset($_POST[send]) and
    !isset($_POST['productSelection']))
    > > {echo "Please select an operating system.";}
    > > ?>
    > >
    > > But this does not work, any ideas?
    > >
    > > Patrick
    > >
    >
    >
    >
    >
    > Hey, I tried this about but as you mentioned, since the
    default product
    > value
    > is "None" an error message appears when the page loads.
    >
    > Is there a way to code this things so that even though
    the default value
    > is
    > "None" there ia no error message untle you hit the
    submit?
    >
    > When I applied the code, it messes up the previous code,
    now the operating
    > system is requiring an entry on page load.
    >
    > When I remove the code from the list menu everything
    goes back to normal.
    >
    > I know this is a little much but I have no other
    alternatives.
    >
    > Patrick
    >

  • Radio Buttons and Event Structures

    Guys, I am hoping for some help here on something I probably should know but cant figure out how to do.  I am using a set of radio buttons and an event structure to run a UI.  The radio buttons are acting as both a user input and indicator of current status selected by the user.  I have the event structure set to run on value change of the radio button.  All works great unless the operator decides that he wants to repeat the selection that the radio button is already set to.  The event structure does not recognize this as a change of value and will not execute.  Is there a way to set the event structure up to run even if the same selection of the radio button is made a second time?  I attached a crude example to this post.  Basically everytime I press the button, I want an entry made into the text box, regardless if the selected item was already pressed.  Any thoughts.
    Troy
    Attachments:
    Radio Button Test.vi ‏16 KB

    Instead of hacking around the inherent nature of radio buttons, why not just use a Cluster?  Its behavior in the UI is more customizable.  Check this out:
    I just replaced your radio buttons with a cluster, and added a little logic to the event structure to get it to behave the way you describe.  I've attached the VI below, saved in 8.2, if you want to try it out.
    Hope this helps,
    -D
    Message Edited by Darren on 11-07-2006 10:45 AM
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    cluster_buttons.png ‏7 KB
    Cluster Test.vi ‏17 KB

  • How can i get Radio buttons  and parameters  in a Single Straight Line

    Hi Experts,
    How can i get Radio buttons  and parameters  in a Single Straight Line...
    Example:
       r1 r2 p1 p2.....
    Cheers,
    Priya
    Points granted.

    Write the following code for the selection screen:
    DECLARATION OF PARAMETERS.
    SELECTION-SCREEN: BEGIN OF BLOCK select WITH FRAME TITLE text-001,
                      BEGIN OF LINE.
                      SELECTION-SCREEN COMMENT 1(10) FOR FIELD p_detail.
                      PARAMETERS p_detail RADIOBUTTON GROUP r1 DEFAULT 'X'.
                      SELECTION-SCREEN COMMENT 25(10)  FOR FIELD p_summry.
                      PARAMETERS p_summry RADIOBUTTON GROUP r1.
    SELECTION-SCREEN: END OF LINE,
                      END OF BLOCK select.
    this will solve your poblem surly. reward the points if you find helpful
    Regards,
    Siddarth

  • Reg: radio button and parameters usage

    Hi,
       If there are 3 radio buttons and 1 parameter, and if i click one radio button then the parameter must be a mandatory, if i click the remaining radio button the parameter must be a normal one( Not mandatory).
    give me clear picture to solve it, as soon as possible,
    thanks in advance

    Hi,
    Wanna try this...??
    PARAMETERS: p_exp RADIOBUTTON GROUP radi,
                p_imp RADIOBUTTON GROUP radi,
                p_clear RADIOBUTTON GROUP radi.
    PARAMETERS: path(30)    TYPE c .
    at selection-screen.
                if p_exp = 'X'.
                 if path is initial.
                  message 'Enter clear' type 'E'.
                endif.
                endif.
    Solves ur problem!!
    Have Fun!!
    Ira!!

  • Check boxes, Radio Buttons, and XML Field Order

    I am working with Adobe Designer Version 7.0. Hopefully this forum can still address my issues.
    I am creating a registration form that will often be submitted via email to us for processing. To help make the data both easy to transfer for us into our excel file  and to minimize the errors made by the people using the form, I need the form to be able to do a couple of things that I am having a hard time figuring out. My questions are the following:
    I have a list of 7 check boxes that each insert a dollar value into a seperate numeric field on the form. Each check box has a unique dollar value associated with it. Is there any way to design the form so the user can only choose one of the check boxes? I tried using radio buttons in a group, but if a user mistakenly chose the wrong radio button and then selected another button from that group, it would add to the total in the Application Fee field and not subtract out the previous amount. Below is the code i used for one of the check boxes.
    I have two numeric fields that the user must choose one or the other. Can I design those two fields (numHomes and numBuildings) so that if the you enter a value for one field, you cannot enter a value for the other field? Both fields are then calcuated in a seperate numeric field. Below is the code i used for the numeric field.
    I want to be able to take the data emailed to us as an XML file  when a user submits the results via email and directly paste it into our Excel file. To keep the cut and paste process simple, I want to make sure the order of the XML fields matches the order of the database fields so it can be done in one shot. Do you know how to organize the XML fields? They do not seem to correspond to the ordering found under the Hierarchy tab. Any thoughts on this?
    Thanks
    if (this.rawValue == 1) then
           numAppFee.rawValue = numAppFee.rawValue + 350;
    else
           numAppFee.rawValue = numAppFee.rawValue - 350;
    endif
    numHomes * 50 + numBuildings * 100 + numDups * 10

    Create an XML Schema (XSD) and define that as the default form schema. The form data will conforms to the order of fields defined in the XML schema.
    Hope that helps.
    Nith

  • Captivate 8, knowledge check radio buttons and check boxes not diplaying correctly in HTML5

    Hello. I am working in Cp 8 on a pc (Win 7, 64-bit) and publishing in HTML5, SCORM 2004, 3rd ed. My issue is with knowledge checks. In preview they look fine, but when published, the radio buttons and check boxes are oversized and do not appear as they should. Additionally, the rollover highlight that covers the distracters is skewed and does not cover all the text in cases of long answer choices. When published as a SWF, there are no issues but project requirements are for HTML5 output only. Help?

    Create an XML Schema (XSD) and define that as the default form schema. The form data will conforms to the order of fields defined in the XML schema.
    Hope that helps.
    Nith

  • Adobe Captivate - Multiple Choice Quiz Question - Radio Button and Text Alignment

    I have created a quiz with multiple choice questions.
    No matter what I do I cannot align the radio button and the text for the choices (see below).
    I would like to align the center of the radio button with the center of the letter A) and B).
    I have tried every option that I can think of in the Properties options.
    Please let me know if anyone has a solution for this.
    Thank you

    Thanks for the reply.
    Previously I tried several different combinations of fonts and font sizes, but didn't see any change.
    Does anyone else know of anything else that could effect this situation?

  • Creating radio button and make it ennable

    Hello All ,
    Please help me out in creating radio button and make it ennable in web dynpro in java application .
    If Possible please send the sample code as well.
    Thanks
    jyothi.

    Hi Venkat,
    The default value needs to be set manually as John has suggested. To be more precise, if the context node is "RadioButtonValues" and the context attribute is 'RadioBtnVal', then in wdDoInit() method, include the following:
    wdContext.currentRadioButtonValuesElement.setRadioBtnVal("Male");
    Regards,
    Pavithra

  • Creating dynamic Radio Buttons and Buttons

    Hello All,
    Presetly I am working on below functionality:
    I have an ArrayCollection which is like
    var sampleCollection:ArrayCollection = new ArrayCollection( [ {"filterID:1", filterName:"Occupied" },  {"filterID:2", filterName:"Unccupied" }] );
    Now my requirement is to create a RadioButton  and a Normal Button for every element in the ArrayCollection.
    So basically the UI will be "RadioButton, Occupied, Button, Button".
    Can someone help me in this respect.
    Thanks in advance,
    Nirmal Kumar Bhogadi.

    HI Nirmal,
    If u want to create the radiobuton and abutton according to the arraycollection data then u follow the following principle.
    Take a vbox. this is contains all the rasio button.
    then do a loop to the arraycolection upto it's length.
    and create the the radio button and add into vbox;
    ex
    <mx:Vbox id ="container"/>
    script:-
    privare var aa:arrayCollection =  ur arraycollection;
    private function addChild():void
         for(var i:int=0; i<aa.length; i++)
              container.addchild(new radioButton());
    I think this hint will help u. if u get ur answer please give me points
    Thanks
    Niranjan Swain

  • Dynamic radio button and group

    Hi, we have create dynamic radio button and group on “application creation complete” event , but which I am try to get number of radio button its show zero, see below code
    import flash.utils.setTimeout;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import spark.components.RadioButton;
    import spark.components.RadioButtonGroup;
    private var  rbg:RadioButtonGroup;
    private var  rb1:RadioButton;
    private var  rb2:RadioButton;
    private var dcount:int = 0;
    protected function application1_creationCompleteHandler(event:FlexEvent):void
         // TODO Auto-generated method stub
         // TODO Auto-generated method stub
         rb1 = new RadioButton();
         rb2 = new RadioButton();
         rbg = new RadioButtonGroup();
         rb1.label = "Radio1";
         rb2.label = "Radio2";
         rb1.group = rbg;
         rb2.group = rbg;
         vbox1.addChild(rb1);
         vbox1.addChild(rb2);
         checkRadioButton (); 
    protected function checkRadioButton ():void
         Alert.show("In checkRadioButton function : " +  rb1.group.numRadioButtons.toString());
    If I put some Time interval to call  checkRadioButton function its working fine,
    //checkRadioButton (); 
    setTimeout(checkRadioButton,1000);
    but this is not best practice.
    why this happen ….can anybody  clear  this or any other way to do this.
    Thanks in advance

    @manjeet.patel,
    Just write the below line of code
    vbox1.validateNow();
    You need not use setTimeout() function
    vbox1.addChild(rb1);
    vbox1.addChild(rb2);
    vbox1.validateNow();
    Thanks,
    Bhasker

Maybe you are looking for

  • Deleting Purchase Order Line items

    Is it possible when you delete a purchase order line item using ME22n to have the corresponding purchase requisition line item marked as closed or deleted?  Currently when we delete the PO line item we get the message that the "Requisition quantity X

  • Print problem in LR

    Could someone help please! I am trying to print an A4 photo in LR, with no margins. The photo prints with a white margin on one long side & one short side. Any ideas how I get rid of these margins?

  • Config willy agent

    hello expert, i have need help urgent. We can not see the data of server node for perform introscope agent setup. url smd ---> diagnostics setup ---> managed system ---> introscope agent the setupwizard is done with warning message in java "  Step E2

  • My picture on outgoing e-mails

    How do I stop my picture from automatically attaching to the top right of all of my e-mails? Thanks!!!

  • Can't enable FIPS after 34.0.5 update

    When Firefox updated to the latest version all of my saved passwords disappeared. After a lot of trial and error I found the only way to recover my passwords was to restore Firefox from a backup and disable FIPS before updating. However, now I have u