Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners struts2 how can we add an radio button to form using a class(doa)
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


neelufurkhan
struts2 how can we add an radio button to form using a class(doa)
1 Answer(s)      3 years and 5 months ago
Posted in : Java Beginners


Hi

I had created an class of subscription,and iam trying to add an radio button on the registration form how to do plz help me out here is my code

model class:
import java.util.*;

/**
 * State generated by hbm2java
 */
public class Subscription  implements java.io.Serializable {

    // Fields    

     private Integer subscriptionId;
     private String subscriptionType;
     private Integer isEnabled;
     private String prefix;
     private Set userDtlses;
     private Set itemListings;


    // Constructors

    /** default constructor */
    public Subscription() {
    }

    /** constructor with id */
    public Subscription(Integer subscriptionId) {
        this.subscriptionId = subscriptionId;
    }




    // Property accessors

    /**
     * 
     */
    public Integer getSubscriptionId() {
        return this.subscriptionId;
    }

    public void setSubscriptionId(Integer subscriptionId) {
        this.subscriptionId = subscriptionId;
    }


    /**
     * 
     */
    public String getSubscriptionType() {
        return this.subscriptionType;
    }

    public void setSubscriptionType(String subscriptionType) {
        this.subscriptionType = subscriptionType;
    }

    /**
     * 
     */
    public Integer getIsEnabled() {
        return this.isEnabled;
    }

    public void setIsEnabled(Integer isEnabled) {
        this.isEnabled = isEnabled;
    }

    /**
     * 
     */
    public Set getUserDtlses() {
        return this.userDtlses;
    }

    public void setUserDtlses(Set userDtlses) {
        this.userDtlses = userDtlses;
    }

    /**
     * 
     */
    public Set getItemListings() {
        return this.itemListings;
    }

    public void setItemListings(Set itemListings) {
        this.itemListings = itemListings;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }



} 

My user class:

import java.util.*;

/**
 * UserDtls generated by hbm2java
 */
public class UserDtls  implements java.io.Serializable {

    // Fields    

     private Integer userId;
     private State state;
     private RemoveRemarks removeRemarks;
     private Country country;
     private UserStatusDtls userStatusDtls;
     private String firstName;
     private String lastName;
     private String addrs1;
     private String addrs2;
     private String city;
     private String zip;
     private String email;
     private String auctionId;
     private String paswd;
     private Date activationDate;
     private Date rcreTime;
     private Date lchgTime;
     private Integer rcreId;
     private Integer lchgId;
     private String adminRemarks;
     private String companyName;
     private String companyAddress;
     private String companyAddress2;
     private String homePhone;
     private String workPhone;
     private String mobilePhone;
     private String fax;
     private String reinsateRemarks;
     private Set itemListings;
     private Set itemBidderMaps;
     private Set itemSecretBidses;
     private Subscription subscription;
     private Set documentHistories;
     private String userRole;
     private String license;
     private String companyCity;
     private String companyZip;

    // Constructors

    /** default constructor */
    public UserDtls() {
    }

    /** constructor with id */
    public UserDtls(Integer userId) {
        this.userId = userId;
    }




    // Property accessors

    /**
     * 
     */
    public String getLicense() {
        return this.license;
    }

    public void setLicense(String license) {
        this.license = license;
    }
    /**
     * 
     */
    public String getCompanyCity() {
        return this.companyCity;
    }

    public void setCompanyCity(String companyCity) {
        this.companyCity = companyCity;
    }
    /**
     * 
     */
    public String getCompanyZip() {
        return this.companyZip;
    }

    public void setCompanyZip(String companyZip) {
        this.companyZip = companyZip;
    }
    /**
     * 
     */
    public Integer getUserId() {
        return this.userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    /**
     * 
     */
    public String getCompanyAddress() {
        return this.companyAddress;
    }

    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }
    /**
     * 
     */
    public String getCompanyAddress2() {
        return this.companyAddress2;
    }

    public void setCompanyAddress2(String companyAddress2) {
        this.companyAddress2 = companyAddress2;
    }
    /**
     * 
     */
    public State getState() {
        return this.state;
    }

    public void setState(State state) {
        this.state = state;
    }

    /**
     * 
     */
    public Subscription getSubscription() {
        return this.subscription;
    }

    public void setSubscription(Subscription subscription) {
        this.subscription = subscription;
    }
    /**
     * 
     */
    public String getUserRole() {
        return this.userRole;
    }

    public void setUserRole(String userRole) {
        this.userRole = userRole;
    }
    public RemoveRemarks getRemoveRemarks() {
        return this.removeRemarks;
    }

    public void setRemoveRemarks(RemoveRemarks removeRemarks) {
        this.removeRemarks = removeRemarks;
    }

    /**
     * 
     */
    public Country getCountry() {
        return this.country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }

    /**
     * 
     */
    public UserStatusDtls getUserStatusDtls() {
        return this.userStatusDtls;
    }

    public void setUserStatusDtls(UserStatusDtls userStatusDtls) {
        this.userStatusDtls = userStatusDtls;
    }

    /**
     * 
     */
    public String getFirstName() {
        return this.firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     * 
     */
    public String getLastName() {
        return this.lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     * 
     */
    public String getAddrs1() {
        return this.addrs1;
    }

    public void setAddrs1(String addrs1) {
        this.addrs1 = addrs1;
    }

    /**
     * 
     */
    public String getAddrs2() {
        return this.addrs2;
    }

    public void setAddrs2(String addrs2) {
        this.addrs2 = addrs2;
    }

    /**
     * 
     */
    public String getCity() {
        return this.city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    /**
     * 
     */
    public String getZip() {
        return this.zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    /**
     * 
     */
    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * 
     */
    public String getAuctionId() {
        return this.auctionId;
    }

    public void setAuctionId(String auctionId) {
        this.auctionId = auctionId;
    }

    /**
     * 
     */
    public String getPaswd() {
        return this.paswd;
    }

    public void setPaswd(String paswd) {
        this.paswd = paswd;
    }

    /**
     * 
     */
    public Date getActivationDate() {
        return this.activationDate;
    }

    public void setActivationDate(Date activationDate) {
        this.activationDate = activationDate;
    }

    /**
     * 
     */
    public Date getRcreTime() {
        return this.rcreTime;
    }

    public void setRcreTime(Date rcreTime) {
        this.rcreTime = rcreTime;
    }

    /**
     * 
     */
    public Date getLchgTime() {
        return this.lchgTime;
    }

    public void setLchgTime(Date lchgTime) {
        this.lchgTime = lchgTime;
    }

    /**
     * 
     */
    public Integer getRcreId() {
        return this.rcreId;
    }

    public void setRcreId(Integer rcreId) {
        this.rcreId = rcreId;
    }

    /**
     * 
     */
    public Integer getLchgId() {
        return this.lchgId;
    }

    public void setLchgId(Integer lchgId) {
        this.lchgId = lchgId;
    }

    /**
     * 
     */
    public String getAdminRemarks() {
        return this.adminRemarks;
    }

    public void setAdminRemarks(String adminRemarks) {
        this.adminRemarks = adminRemarks;
    }

    /**
     * 
     */
    public String getCompanyName() {
        return this.companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    /**
     * 
     */
    public String getHomePhone() {
        return this.homePhone;
    }

    public void setHomePhone(String homePhone) {
        this.homePhone = homePhone;
    }

    /**
     * 
     */
    public String getWorkPhone() {
        return this.workPhone;
    }

    public void setWorkPhone(String workPhone) {
        this.workPhone = workPhone;
    }

    /**
     * 
     */
    public String getMobilePhone() {
        return this.mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    /**
     * 
     */
    public String getFax() {
        return this.fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    /**
     * 
     */
    public String getReinsateRemarks() {
        return this.reinsateRemarks;
    }

    public void setReinsateRemarks(String reinsateRemarks) {
        this.reinsateRemarks = reinsateRemarks;
    }

    /**
     * 
     */
    public Set getItemListings() {
        return this.itemListings;
    }

    public void setItemListings(Set itemListings) {
        this.itemListings = itemListings;
    }

    /**
     * 
     */
    public Set getItemBidderMaps() {
        return this.itemBidderMaps;
    }

    public void setItemBidderMaps(Set itemBidderMaps) {
        this.itemBidderMaps = itemBidderMaps;
    }

    public Set getItemSecretBidses() {
        return itemSecretBidses;
    }

    public void setItemSecretBidses(Set itemSecretBidses) {
        this.itemSecretBidses = itemSecretBidses;
    }

    /**
     * 
     */

    public Set getDocumentHistories() {
        return this.documentHistories;
    }

    public void setDocumentHistories(Set documentHistories) {
        this.documentHistories = documentHistories;
    }


}

And my form is :
 <table width="650" height="541" border="0" cellpadding="0" cellspacing="3" class="table_text">
        <tr>
          <td width="1" height="16">&nbsp;</td>
          <td colspan="2"><b><div style="border-bottom:1px solid #CCCCCC;">Contact Information</div></b></td>
        </tr>
        <tr>
          <td height="4" colspan="3"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td width="119">First Name<font color="red">&nbsp;*</font></td>
          <td width="518" ><s:textfield  name="firstName" maxlength="50" theme="simple" size="28"  />
                    <s:fielderror  theme="xhtml">
                        <s:param >firstName</s:param>
                    </s:fielderror></td>

        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>Last Name<font color="red">&nbsp;*</font></td>
          <td><s:textfield name="lastName" maxlength="50" theme="simple"  size="28" />
                    <s:fielderror theme="xhtml">
                        <s:param>lastName</s:param>
                    </s:fielderror></td>
        </tr>

        <tr>
          <td>&nbsp;</td>
          <td>Address1<font color="red">&nbsp;*</font></td>
          <td> <s:textfield name="addrs1" maxlength="50" theme="simple" size="28"/>
                    <s:fielderror theme="xhtml">
                        <s:param>addrs1</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>Address2</td>
          <td><s:textfield name="addrs2" size="28" theme="simple" maxlength="50" /></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>City<font color="red">&nbsp;*</font></td>
          <td>  <s:textfield name="city" theme="simple"  size="28" maxlength="50" />
                    <s:fielderror theme="xhtml">
                        <s:param>city</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>State<font color="red">&nbsp;*</font></td>
          <td>  <s:select name="stateName" list="#application.stateList" listKey="stateId" listValue="stateName" theme="simple"
                                 headerKey="" headerValue="[Select One]" cssStyle="width:173px;"
                                />
                    <s:fielderror theme="xhtml">
                        <s:param>stateName</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>Zip Code<font color="red">&nbsp;*</font></td>
          <td><s:textfield name="txtZip" theme="simple" maxlength="10" size="28" />
                    <s:fielderror theme="xhtml">
                        <s:param>txtZip</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>Country<font color="red">&nbsp;*</font></td>
          <td> <s:select name="cntryName" theme="simple" list="#application.countryList"
                                listKey="cntryId" listValue="cntryName" cssStyle="width:173px;" 
                                /></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>Home Phone<font color="red">&nbsp;</font></td>
          <td><s:textfield name="phoneNoHome" theme="simple" maxlength="12" size="16"/>
                    <s:fielderror theme="xhtml">
                        <s:param>phoneNoHome</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>Work Phone<font color="red">&nbsp;*</font></td>
          <td><s:textfield name="phoneNoWork" theme="simple" maxlength="12" size="16"/>
                    <s:fielderror theme="xhtml">
                        <s:param>phoneNoWork</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>Mobile</td>
          <td><s:textfield name="phoneNoMobile" theme="simple" maxlength="12" size="16"/>
                    <s:fielderror theme="xhtml">
                        <s:param>phoneNoMobile</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>Fax</td>
            <td><s:textfield name="txtFaxNum" maxlength="12" size="16"
                theme="simple" /> <s:fielderror theme="xhtml">
                <s:param>txtFaxNum</s:param>
            </s:fielderror></td>
        </tr>

         <tr>
          <td>&nbsp;</td>
          <td>Company Name</td>
          <td><s:textfield  name="companyName"  maxlength="12" size="16" theme="simple" />
                    <s:fielderror theme="xhtml">
                        <s:param>companyName</s:param>
                    </s:fielderror></td>
        </tr>
         <tr>
          <td>&nbsp;</td>
          <td>Company Address</td>
          <td><s:textfield  name="companyAddress" maxlength="12" size="16" theme="simple" />
                    <s:fielderror theme="xhtml">
                        <s:param>companyAddress</s:param>
                    </s:fielderror></td>
        </tr> 
        <tr>
          <td>&nbsp;</td>
          <td></td>
          <td><s:hidden name="userRole" value="Seller"></s:hidden>
                    </td>
        </tr>
        <tr>
          <td>&nbsp;            </td>
          <td>Email Address<font color="red">&nbsp;*</font></td>
          <td><s:textfield name="txtEmail" size="28" maxlength="50" theme="simple" />
                    <s:fielderror theme="xhtml">
                        <s:param>txtEmail</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;            </td>
          <td>Confirm Email<font color="red">&nbsp;*</font></td>
          <td> <s:textfield name="confirmEMail" maxlength="50" size="28" theme="simple" />
                    <s:fielderror theme="xhtml">
                        <s:param>confirmEMail</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;            </td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;            </td>
          <td ><div style="border-bottom:1px solid #CCCCCC; width: auto"><b>Login Information</b></div></td>
          </tr>
          <tr>
          <td>&nbsp;            </td>
          <td colspan="2"><div><b>Create your User Id and Password, must be 8 Characters</b></div></td>
        </tr>
        <tr>
          <td>&nbsp;                </td>
          <td>User Id<font color="red">&nbsp;*</font></td>
          <td> <s:textfield name="userId" maxlength="50" size="28" theme="simple" />
                    <s:fielderror theme="xhtml">
                        <s:param>userId</s:param>
                    </s:fielderror></td>
        </tr>


        <tr>
          <td>&nbsp;                </td>
          <td nowrap="nowrap">Password<font color="red">&nbsp;*</font></td>
          <td>  <s:password name="txtPaswd" maxlength="50" size="28" theme="simple" />
                    <s:fielderror theme="xhtml">
                        <s:param>txtPaswd</s:param>
                    </s:fielderror></td>
        <!--  <td nowrap="nowrap"><font color="red">Password should contain 8 characters</font></td>-->
        </tr>
        <tr>
          <td>&nbsp;                </td>
          <td>Confirm Password<font color="red">&nbsp;*</font></td>
          <td> <s:password name="confirmPassword" maxlength="50" size="28" theme="simple" />
                    <s:fielderror theme="xhtml">
                        <s:param>confirmPassword</s:param>
                    </s:fielderror></td>
        </tr><br/><br/>
        <tr>
          <td>&nbsp;    </td>
          <td colspan="2"><div style="padding-left:140px;"> <s:checkbox name="agreement" required="true" theme="simple" fieldValue="true" /><a href="#" onclick="viewTermsAndCondtions();">I Agree to Terms of Service</a></div>
                    <s:fielderror theme="xhtml">
                        <s:param>agreement</s:param>
                    </s:fielderror></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><s:submit name="submit" theme="simple" value="Register"/></td>
        </tr>
      </table>

    <div dojoType="dialog" id="errorMsgDlg" bgColor="white"
    bgOpacity="0.5" toggle="fade" toggleDuration="250"
    style="visibility: hidden;">

<div id="errorDlgDisplay"></div>
<table width="100%">
    <tr align="center">
        <td align="center"><input type="button" value="Close" onclick="loginValidateShow.hide();"/>
        </td>
    </tr>
</table>
</div>
    </s:form>
<div dojoType="dialog" id="termsAndConditionsDialog"  style="visibility: hidden;" title="Terms and Condtions Dialog">
    <div id="termsAndConditionsToDisplay" style="width:800px; height:500px; overflow-y: scroll; margin-left:auto; margin-right:auto; background:#eeeeee; color:#000000;">

    </div>  
<table width="100%" >
    <tr align="center">
        <td align="center">
        <input style="margin-left:485px;" type="button" value="Close" onclick="termsAndConditionsDialogShow.hide();"/>

        </td>
    </tr>
</table>

plz sugest me how to use the class means how should i refer it here


Advertisement
View Answers

June 2, 2011 at 4:00 PM


Please visit the following link:

Struts2 radio tag



Related Tutorials/Questions & Answers:
struts2 how can we add an radio button to form using a class(doa)
struts2 how can we add an radio button to form using a class(doa)  Hi I had created an class of subscription,and iam trying to add an radio button on the registration form how to do plz help me out here is my code model
struts2 how can we add an radio button to form using a class(doa)
struts2 how can we add an radio button to form using a class(doa)  Hi I had created an class of subscription,and iam trying to add an radio button on the registration form how to do plz help me out here is my code model
Advertisements
How can we submit a form without a submit button?
How can we submit a form without a submit button?  How can we submit a form without a submit button
How to add radio button value in a table for particular field?
How to add radio button value in a table for particular field?  Hi,I... dynamically from other table and two radio button one for present and the second... one radio button for text field then it insert only one value absent OR present
Using radio button in struts - Struts
, but the radio button has only just one value that i can pass.what can i do to solve it ? (The user can choose only one radio button - it's mean that we talking about...Using radio button in struts  Hello to all , I have a big problem
validate radio button using javascript
validate radio button using javascript  validate radio button using javascript
can we add primitive data to wrapper class object
can we add primitive data to wrapper class object  Hi, Here is my code: class Myclass{ public static void main(String args[]){ int i=2; Integer... Friend, Yes, you can. Thanks
How to add another option to the select tag using struts2 tag - Struts
How to add another option to the select tag using struts2 tag  Hi, How to add another option to select tag using tag. My scenario is : If the logged in user is admin then drop down should contain the normal list
Retrieve value of radio button from database to form
Retrieve value of radio button from database to form  var gn=document.getElementsByName("empg"); //empg is name of radio input type. for(var i=0;i
Radio Button in Java
; Radio Button is a circular button on web page that can be selected.... The Checkbox class is used by the AWT to create both Radio Button and Checkbox... a RadioButton,we need to create a Checkbox first, followed by adding Radio Button
how to check the radio button automatically depending up on the value of database when editing the form...
how to check the radio button automatically depending up on the value... to highlight the radio button from the database.......nd even list box also can any... button. When the user clicks the particular radio button, that data will get shown
Radio Button in HTML
Radio Button in HTML is a type of input form that allows a user to select one button from a group of button. When a user clicks on a radio button, it becomes... to remember while using Radio Button: All Radio Buttons within a group must share
Struts 2 Radio Button
radio buttons and I am using Struts2 tag.I want first rado button to be selected by default.But when i select the second radio button and hit on search button i want to retain the selection of that second radio button on search list
Radio button validation using jsp - JSP-Servlet
Radio button validation using jsp  I had one jsp Page and servlet. I did my validations in servlet for my jsp page which contains the radio... a value for radio Buttons) then it will return to same jsp page with the given
radio button
radio button  On selecting a radio button, it should open a aspx page
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers  how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
How can we create a database using PHP and mysql?
How can we create a database using PHP and mysql?  How can we create a database using PHP and mysql
How can we encrypt the username and password using PHP?
How can we encrypt the username and password using PHP?  How can we encrypt the username and password using PHP
How can we find the number of rows in a result set using PHP?
How can we find the number of rows in a result set using PHP?   How can we find the number of rows in a result set using PHP
How can we get second of the current time using date function?
How can we get second of the current time using date function?  How can we get second of the current time using date function
to get radio button value - Struts
to set the "value" attribute of radio button in the above code. Can u help...to get radio button value   hello friend, i have a problem regarding the struts2. i have code like this s:form > USERNAMESKILL
can we use scanner class,class , object and methods to get output without using constructor ????
can we use scanner class,class , object and methods to get output without using constructor ????  im getting error here..i hav used scanner class... am i getting error here... can we get output using scanner class , object
How to disable browser back and forward button after logout [in struts2 or jsp]
How to disable browser back and forward button after logout [in struts2 or jsp]  How to disable browser back and forward button after logout [in struts2 or jsp] I am using window.history.forward(); function
how to display default radio button in struts2.0 for first time login - Struts
how to display default radio button in struts2.0 for first time login  hi, this is suresh jampala, i have one question regarding struts2.0,how can i display default radio button in struts2.0 when ever i loggedin first time
Radio Button in J2ME
to demonstrate, how to create the radio button in J2ME using MIDlet. The radio button is use to choose only one option at a time. To create the radio button we... Radio Button in J2ME      
How to add new class in Pkg using the feature of existing class - Java Beginners
How to add new class in Pkg using the feature of existing class   Hi Friends, I want to know , is it possible to add new class in a user Defined... access Variables or methods. Can i use them in another Class in the Same Pkg
How to use struts2 grid with form submission
How to use struts2 grid with form submission  Hello, I've already searched on Stackoverflow with no luck; I want to make one filter form... functionality by providing form, and when user click on form submit button, i want
how to display the values of one list in other upon clicking a button in struts2
how to display the values of one list in other upon clicking a button in struts2  Hello friends..Am new to struts2..Please any one has to guide me... list upon clicking a button...Can any one provide me the sample code.. Hope
Dojo Radio Button
button do some action on press.  Try Online: Radio Button The RadioButton class...Dojo Radio Button          In this section, you will learn how to create radio buttons in dojo
What is the maximum size of a file that can be uploaded using PHP and how can we change this?
What is the maximum size of a file that can be uploaded using PHP and how can we change this?  What is the maximum size of a file that can be uploaded using PHP and how can we change
Using HeaderFooter class of iText API , Can we display multiple phrases in the footer section of PDF ,each with different alignment.
Using HeaderFooter class of iText API , Can we display multiple phrases... on the right and Third phrase in the middle. How can we acheive this? is it possible... a similar question related to HeaderFooter class, I want to display three Phrases
Advertisements
 

 

 

DMCA.com