I want to add radio button selected value in shopping cart

hi
i am new to java
and i am doing shopping cart project
and i want to aad radio button selected value in cart but only one value.
i am doing that in jsp.
when iam adding that value the name of radio button is printed.
and in remove page nothing displyed
pls help me
Thanks in advance.
my code is-
index.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<html>
<head>
<title>Shopping cart</title>
<style>
* { font-size: 12px; font-family: Verdana }
input { border: 1px solid #ccc }
</style>
</head>
<body>
<jsp:declaration>
java.util.Enumeration parms;
java.util.Enumeration values;
</jsp:declaration>
<jsp:scriptlet>
parms = request.getParameterNames();
values = request.getParameterNames();
while(parms.hasMoreElements()) {
String name = (String) parms.nextElement();
String value = (String) values.nextElement();
session.setAttribute(name, value);
</jsp:scriptlet>
<img src="images/add.png" onclick="document.location='index.jsp'">
<img src="images/remove.png" onclick="document.location='remove.jsp'">
<img src="images/cart.png" onclick="document.location='cart.jsp'">
<h2>Add to shopping cart</h2>
<form method="POST" action="index.jsp">
<table>
<tr>
<td><input type="radio" name="radio" value="$10.00" checked></td>
<td>$10.00</td>
</tr>
<tr>
<td><input type="radio" name="radio" value="$15.00"></td>
<td>$15.00</td>
</tr>
<tr>
<td><input type="radio" name="radio" value="$20.00"></td>
<td>$20.00</td>
</tr>
<tr>
<td><input type="radio" name="radio" value="$25.00"></td>
<td>$25.00</td>
</tr>
<tr>
<td><input type="radio" name="radio" value="$30.00"></td>
<td>$30.00</td>
</tr>
<tr>
<td><input type="radio" name="radio" value="$35.00"></td>
<td>$35.00</td>
</tr>
</table>
<br><br>
<input type="submit" value="submit">
</form>
</body>
</html>
cart.jsp
<html>
<head>
<title>Shopping cart</title>
<style>
* { font-size: 12px; font-family: Verdana }
</style>
</head>
<body>
<jsp:declaration>
java.util.Enumeration parms;
</jsp:declaration>
<img src="images/add.png" onclick="document.location='index.jsp'">
<img src="images/remove.png" onclick="document.location='remove.jsp'">
<img src="images/cart.png" onclick="document.location='cart.jsp'">
<h2>The shopping cart</h2>
<jsp:scriptlet><![CDATA[
java.util.Enumeration content = session.getAttributeNames();
while (content.hasMoreElements()) {
    out.println(content.nextElement());
    out.println("<br>");
]]></jsp:scriptlet>
</body>
</html>
remove.jsp
<html>
<head>
<title>Shopping cart</title>
<style>
* { font-size: 12px; font-family: Verdana }
input { border: 1px solid #ccc }
</style>
</head>
<body>
<jsp:declaration>
java.util.Enumeration parms;
</jsp:declaration>
<jsp:scriptlet>
parms = request.getParameterNames();
while(parms.hasMoreElements()) {
String name = (String) parms.nextElement();
session.removeAttribute(name);
</jsp:scriptlet>
<img src="images/add.png" onclick="document.location='index.jsp'">
<img src="images/remove.png" onclick="document.location='remove.jsp'">
<img src="images/cart.png" onclick="document.location='cart.jsp'">
<h2>Remove items from cart</h2>
<form method="get" action="remove.jsp">
<table>
<% if (session.getAttribute("$10.00") != null) { %>
<tr>
<td><input type="radio" name="radio"></td><td>$10.00</td>
</tr>
<% } %>
<% if (session.getAttribute("$15.00") != null) { %>
<tr>
<td><input type="radio" name="radio"></td><td>$15.00</td>
</tr>
<% } %>
<% if (session.getAttribute("$20.00") != null) { %>
<tr>
<td><input type="radio" name="radio"></td><td>$20.00</td>
</tr>
<% } %>
<% if (session.getAttribute("$25.00") != null) { %>
<tr>
<td><input type="radio" name="radio"></td><td>$25.00</td>
</tr>
<% } %>
<% if (session.getAttribute("$30.00") != null) { %>
<tr>
<td><input type="radio" name="radio"></td><td>$30.00</td>
</tr>
<% } %>
<% if (session.getAttribute("$35.00") != null) { %>
<tr>
<td><input type="radio" name="radio"></td><td>$35.00</td>
</tr>
<% } %>
</table>
<br><br>
<input type="submit" value="submit">
</form>
</body>
</html>

i used this where park .visits is the java class for
visit object that contains getResort() method
now error has gone but nothing is stored in the
actionform class I would take that to mean the List
1. does not contain a collection of Visit. You can check that by printing some debug statements inside the loop
2. contains collection of visit objects. However the visit objects return null for getResort().
Why dont you debug by printing out the objects from wherever you sit it in request/session scop (i.e in your servlet/web-handler)
ram.

Similar Messages

  • Add Approver button disabled in SRM Shopping cart

    Hello,
    We have activated 2 level PC workflow. However we are facing issue that Add Approver button is not enabled.
    Could anyone please advise.
    Thank you
    Ritesh

    Hi Ritesh,
    On the face of it,I have couple of points for you to check it out.
    1.
    Please check the agent assignment at the header level of the workflow.
    Go to transaction PFTC -> Select workflow template -> 14000133 (or   
    whichever workflow you are using) -> Display -> Additional data ->   
    Agent Assignment -> Maintain -> Attributes -> Select radio button    
    'General Task' .. or instead of everybody being able to make changes 
    you can set the agent assignment of the workflow at role level.      
    Please also review note 581191.
    2.Check if this button is not visible or not for all the roles.
    3.Check any portal enhancements or Metadata config to make it display.
    Thanks
    Balaji

  • Using radio button selection in multiple tables

    Hello All,
    I've got a bit of a design issue and it being a Friday my brain is a bit foggy and I can't seem to figure out a solution.
    what I want to do is have 3 tables. The user should only be able to select one line from any of the three tables.
    I can do this by having events that clear down selection on the two other tables on any selection of the third, but the select buttons of tables don't really give the UI impression that only one row can be selected. To do this I'd like to use the radio button element.
    so
    table A
    choice - name
    (o) - Anne
    (o) - Bob
    (o) - Charlie
    Table B
    choice - name
    (x) - David
    (o) - Ellen
    (o) - Fran
    Table C
    choice - name
    (o) - George
    Here the entry in table B for David is selected. But any selection of any of the other options should deselected.
    My thoughts are to use a radio button ui element, bind the "selected" value to a unique id for each row/table (an attribute of the node element for each table) and the value to a common shared attribute (not table specific).
    Any better ideas - and certainly any which would mean I'm not going to have to maintain a lookup table of my unique ids and node elements to find out which one is selected?
    Cheers,
    Chris

    Ok - here's how I did it.
    I created another lookup table which had a guid and reference to the element.
    in the each elements I had a guid which I bound to the key for selection property of the radio button in the table.
    I then bound the selected key property to an attribute that was common to all elements.
    in my "processing" logic I read the selected key, read the lookup table - and therefore got the reference to the selected element.
    Would have been an awful lot easier if I could have used a reference to the element itself as the "key" - but that was required to be a character field.
    [image showing radio button selection working across multiple tables|http://i51.tinypic.com/bi79dx.jpg]
    End result works quite nicely.
    Cheers,
    Chris

  • Keep Radio Button selected after action

    Hi All - This is a strange situation.
    I have 3 context node for Radio Buttons
    the 1st context node is for 2 radio buttons
    the 2nd context node is for 6 radio buttons
    the 3rd context node is for 4 radio buttons
    Scenario: 1st Context node has "DEFAULT VALUE" so is initially selected, the other two context node doesn't have DEFAULT VALUE.
    I select a radio button (that belongs to the second node) and also select a radio button (that belongs to the 3rd context node) now I click a custom button that will trigger an ACTION.
    1st & 3rd Radio buttons keep the RADIO BUTTON SELECTED but 2nd Radio Button now is like INITIAL, WHY??? if everything is designed the same way.
    I want to keep the selected value so the user can see which options they selected.
    A1          B2            C3      <----
    First time (after initialization)
    X
    A1         B2            C3      <----
    I selected values
    X            X              X
    A1         B2             C3     <----
    After Action is trigger
    X                             X
    thanks!
    Jason PV

    Hi,
    I dont see any reason other than selected value getting lost in wddomodify method or in action event handler.
    Check in WDDOMODIFYVIEW or in Action Handler method you are not playing modifying the context node bound to 2 group of radio buttons .
    Or you can fetch the selected value in your action handler store it in some view attribute and bind the node back again with same value on wddomodifyview.
    Regards
    Manas Dua

  • Clearing radio button selection

    Guys, iam stuck in a situation where iam not able to clear the radio button selection in the SINGLESELECT tableview. I am using MVC approach and my layout is similar to bookshop example in SAP  tutorial_4_mvc.
    I found that even in the SAP example the raio button is not cleared when a new search is used. The radio button remains selected and it has to be clicked again to refresh and retrieve new values. But I would like to clear the selection.
    Any help on how to clear previous radio button selection every time the page is reloaded?
    Thanks.

    hi,
    i tried this but for some reason the index of the prviously selected row still gets applied to the new selection and is checked.
    in my do_handle_event:
    IF htmlb_event IS BOUND  AND
         htmlb_event->name = 'tableView'.
        table_event ?= htmlb_event.
        selectedrowindex = table_event->selectedrowindex.
        READ TABLE i_result INDEX selectedrowindex INTO wa.
        IF sy-subrc EQ 0.
          CLEAR: imatfact1, iagrfact1, iagrhead1, iabgru1, v_part_detail,
    selectedrowindex.
    processing data
    ENDIF.
    In my DO_REQUEST:
    result_view->set_attribute( name = 'i_result' value = i_result ).
      result_view->set_attribute( name = 'iterator' value = me ).
    result_view->set_attribute( name = 'selectedrowindex' value =
    selectedrowindex ).
      call_view( result_view ).
    In my page:
    <htmlb:tableView id              = "result"
                     headerText      = "Header Text"
                     onNavigate      = "onMyNavigate"
                     selectionMode   = "<%= v_sel_mode %>"
                     emptyTableText  = "No data found matching your query!"
                     onRowSelection  = "<%= v_onrow_sel %>"
                     table           = "<%= i_result %>"
                     iterator        = "<%= iterator %>"
                     visibleRowCount = "10"
                     selectedRowIndex = "<%= selectedrowindex %>">
      <htmlb:tableViewColumns>
        <htmlb:tableViewColumn columnName          = "MATNR"
                               width               = "100"
                               horizontalAlignment = "left"
                               title               = "PART" >
        </htmlb:tableViewColumn>
        <htmlb:tableViewColumn columnName          = "ZFLAG"
                               width               = "100"
                               horizontalAlignment = "left"
                               title               = "DISCOUNT" >
        </htmlb:tableViewColumn>
      </htmlb:tableViewColumns>
    </htmlb:tableView>
    I am also using the interface methods u tthere is no code inside:
    IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
    Please suggest what could be wrong.
    I have debugged this and saw the selected rowindex as '0' also but it gets applied somewhere again.
    Thanks.

  • How to get Radio button select event in my co

    Hi,
    I want to get the radio button selection event in my co,how can i get the event?

    Hi,
    841475 wrote:
    I want to get the radio button selection event in my co,how can i get the event?---There is no event for radio button.
    ---U need to explicitily set the event for the radio button.
    Action:FirePaatialAction
    Event:RadioEvent---Get the event in co by below code:
    if("RadioEvent".equals(pageContext.getParameter(EVENT_PARAM)))
    ---In radio button event..:)
    Regards
    Meher Irk

  • HIdidng input field depeding on radio button selected

    Hello Experts,
    Can any let me know  or point to a tutorial ?
    how I can hide a input field another input field depending on the selected radio button.
    The radio button I have are fax and email.
    If Fax is selected I want to dispaly input field for fax and vice versa.
    Thanks,
    Raj

    Hi raj,
    (1)Create two context attribute of type "Visibility".
        (a) faxVisible
        (b) emailVisible
    (2)And bind the "visible" property of inputfields to these attributes.
    (3)On radio button selection in the action handler do following thing  for fax selection and vice versa.
    wdContext.currentContextElement().setFaxVisible(WDVisibility.VISIBLE);
    wdContext.currentContextElement().setEmailVisible(WDVisibility.NONE);
    Regards,
    Praveen

  • How can I add radio buttons dynamically?

    Hi,
    I need to add radio buttons dynamically. I will be having a set of options which will be coming form a web service call and I need to convert those options into radio buttons and show it to the user. How can I do it?
    Thanks,
    Hali George

    Yep .... I too would  rather have seen more time put into that kind of stuff than parallax scrolling.

  • Radio Buttons selection

    Hi to all,
    I am using 5 radio buttons.
    i did some fire partial action for radio buttons.(means call some procedures).
    My problem is
    i select the first radio button,suppose it throws some exception then radio button selection is goes to last radio button.
    but in my requirement when ever exception is raiise,that time first radio button is selected or all radio buttons are deselected.
    please give the suggestion.

    You have to do the following things:
    1. Attach a radio group to all these radio buttons.
    2. Give them all different names.
    3. And when one of the radio button is clicked, u need to set that VO attribute attachhed to radio button as "Y" and rest as N... then it works..
    CO -> PR
    OAMessageRadioButtonBean periodicRadioButton = (OAMessageRadioButtonBean)webBean.findChildRecursive("PeriodicallyItem");
    periodicRadioButton.setName("FREQUENCY_GROUP");
    periodicRadioButton.setValue("PERIODIC");
    OAMessageRadioButtonBean specDaysRadioButton = (OAMessageRadioButtonBean)webBean.findChildRecursive("SpecDaysItem");
    specDaysRadioButton.setName("FREQUENCY_GROUP");
    specDaysRadioButton.setValue("SPECIFIC_DAYS");
    OAMessageRadioButtonBean specWorkRadioButton = (OAMessageRadioButtonBean)webBean.findChildRecursive("SpecWorkDaysItem");
    specWorkRadioButton.setName("FREQUENCY_GROUP");
    specWorkRadioButton.setValue("SPECIFIC_WORK");
    OAMessageRadioButtonBean specWeekRadioButton = (OAMessageRadioButtonBean)webBean.findChildRecursive("SpecWeekDaysItem");
    specWeekRadioButton.setName("FREQUENCY_GROUP");
    specWeekRadioButton.setValue("SPECIFIC_WEEK");
    CO -> PFR
    String radioGroupValue = pageContext.getParameter("FREQUENCY_GROUP");
    if(eventName.equals("frequency"))
    am.invokeMethod("handleFreqSchEvent",paramList);
    AM
    if("PERIODIC".equals(freqValue))
    schFreqRow.setPeriodically("Y");
    schFreqRow.setSpecDays("N");
    schFreqRow.setSpecWorkDays("N");
    schFreqRow.setSpecWeekDays("N");
    else if("SPECIFIC_DAYS".equals(freqValue))
    schFreqRow.setPeriodically("N");
    schFreqRow.setSpecDays("Y");
    schFreqRow.setSpecWorkDays("N");
    schFreqRow.setSpecWeekDays("N");
    else if("SPECIFIC_WORK".equals(freqValue))
    schFreqRow.setPeriodically("N");
    schFreqRow.setSpecDays("N");
    schFreqRow.setSpecWorkDays("Y");
    schFreqRow.setSpecWeekDays("N");
    else if("SPECIFIC_WEEK".equals(freqValue))
    schFreqRow.setPeriodically("N");
    schFreqRow.setSpecDays("N");
    schFreqRow.setSpecWorkDays("N");
    schFreqRow.setSpecWeekDays("Y");
    Hope this helps..

  • How can i do with labview program,when i have 20 different values,and 1 want to add it with constant value.and how to get the results?

    how can i do with labview program,when i have   20 different values,and 1 want to add it with constant value.and how to get the results?

    Why do the 20 values have to be different? The same code should work even if some are equal.
    What do you mean by "get the result"? The result is available at the output terminal and all you need is a wire to get it where you need it. That could be an indicator, another operation, or even a hardware device.
    What is the data type of the 20 values? An array? A cluster? A bunch of scalars? A waveform? Dynamic data?
    LabVIEW Champion . Do more with less code and in less time .

  • Compulsory radio button selection

    I have a radio button field with the 'Required' checkbox enabled. When the form is previewed, the '*' is shown on a separate line.
    I have tried setting the width but it does not seem to solve the problem.

    Yea, it gets hard to deliver good GUI in IdM sometimes :)
    If that is really a turn-off, you could write your own <Validation> for the radio button null value and provide a red Text Field with "noNewRow"=true...
    Adi

  • Max order value pr shopping cart

    Hello,
    Running ECS 5.0
    The business needs to set a value limit for a shopping cart pr user or role. If the total value for a shopping cart exceeds this value, we need an error message and not beeing able to proceed with the cart.
    How could this be set up?
    rgds
    GAR

    Hi
    Yes possible to do it through bbp_doc_check badi for bus2121.
    You can use the 1 step Spending limit approval Workflow.
    For more info,refer the foll link:
    http://help.sap.com/saphelp_srm40/helpdata/en/79/ca013a0c88bc7ce10000000a114084/content.htm
    <b>Also, Please go through the links below -></b>
    You have to use the BADi "BBP_DOC_CHECK_BADI" for this.For sample code,refer the foll links:
    Re: Budget analysis
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/srm/bbp_doc_check_badi-CheckPurchasingDocument&
    Re: Disabling Fields in Carry out Sourcing
    Re: Indentifying 'amount' based approvers in an N-step dollar approval process
    http://help.sap.com/saphelp_srm50/helpdata/en/17/40a86c773d6c41801d78af1a34b90f/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/2c/e68d406b305537e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/6b/eca441eea7ef0be10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/f7/a6a3415e34b05fe10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/8b/4fa9585db211d2b404006094b92d37/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/8b/4fa9585db211d2b404006094b92d37/frameset.htm
    Assigning authorization role to position in PP02 (SRM 5.0) not working
    Limit minimum value of the shopping cart
    Re: How to validating total value in shopping cart
    Do let me know.
    Regards
    - Atul

  • Requisioner is not getting change button in fully approved shopping cart

    Hi Experts,
    I have problem in getting the change button in fully approved shopping cart which was not created purchase order in the backend due to faulty account assignment.It needs to be changed the account information by the requisitioner .
    Requisioner is having LOW in settings of BBP_WFL_SECURITY in personalisation tab.
    Thanks in advance.
    koushik

    Hi CK,
    Thanks for the reply but as per our client business requirement, requisitioner should get the change option to correct his shopping cart as the follow on document (purchase order)  was not creating due to incorrect acccounting structure in the shopping cart.How should requisitioner get change button in fully approved shopping cart to correct his accounting structure.
    Thanks,
    Koushik.

  • Add radio button when a radio button is selected (pop up)

    How do you Add a 2 radio buttons when (pop up when d1 is
    selected)
    For example d1a and d1b
    When d1 is selected.
    <cfoutput>
    <cfif isdefined("url.msg")>
    #urldecode(url.msg)# <BR />
    </cfif>
    </cfoutput>
    <table border="0" cellpadding="5">
    <form id="form1" name="form1" method="post"
    action="index.cfm?action=actSearch">
    <tr>
    <td>please enter id no: </td>
    <td><input type="text" name="nbr" /></td>
    </tr>
    <tr>
    <td>B1: </td>
    <td><input type="Radio" name="bd" value="b1"
    checked="checked"></td>
    </tr>
    <tr>
    <td>D1: </td>
    <td><input type="Radio" name="bd"
    value="d1r"></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="submit" name="Submit"
    value="Submit" /></td>
    </tr>
    </form>
    </table>

    As you may already know, ColdFusion code runs on the server.
    It's not sent out to the web browser. It sends out HTML to the
    browser. And what you want to do here is regonize a change that
    occurs in the web browser without submitting the form. The way you
    can do this is AJAX. If you haven't already done so, check out the
    ColdFusion / AJAX library here :
    http://ajaxcfc.riaforge.org/.
    This will give you a good framework of code to use to do this so
    you won't have to reinvent the wheel.

  • Looping thru instance manager and checking radio button selected

    I need to loop thru my instances and toggle visible/hidden if a particular radio button in each instance is selected.
    My code right now does not work but I feel I am on the right track (minus the else statement it will need to toggle on/off).
    Can anyone help? thanks in advance!
    var rowCount = BugGroup_f.instanceManager.count;
    for (i=0; i<rowCount; i++) {
    var str = xfa.resolveNode("BugGroup_f.detail3.bugInfo.BugItem.status.RadioButtonList[" + i + "]").rawValue;
        if (str.indexOf("Fixed") > -1) {
        xfa.resolveNode("BugGroup_f["+rowCount+"]").presence = "hidden"

    So we've got a set of Rows, each with a subitem called RadioToggle, and you want to go through and set them all, then click a separate button and hide the ones with "on" radio buttons?
    function ToggleRows(reset){
         var Rows = Form.subform....BugGroup_f.all;
         var curRow;
         for (var i=0; i<Rows.length; i++){
              curRow = Rows.item(i);
              if ((curRow.RadioButton.rawValue == "WhatevermeansHidden") && !reset){
                   curRow.presense = "hidden";}
              else{
                   curRow.presense = "visible";}
    ^ in a script object, and put
    scriptObjectName.ToggleRows(reset);
    in the click event of your button, and you should be golden.
    If you do want them to hide the moment you click the toggle, you could put this, right?
    if (xfa.event.newText == "whatevermeansoff"){
         parent....presense = "hidden";}
    The .all method seems like a much easier way to handle collections of objects, and specificaly collections of instances. It also means you can do relative referencing, i.e. to create a function that will operate on all the rows of a table, without knowing which table it is operating on, so a button in each table can pass it's parent table to the function.
    var GroupVariable = Object.all
    for(var i=0; i < GroupVariable.length; i++)
    EDIT:
    add a reset value, and pass it in to your function like above (added).
    make a separate button, or control, that will call the function with reset = 1.

Maybe you are looking for