How to make  struts html:select tag readOnly....!!!!

Hi All,
In my below code I want to make <html:select> as readonly like I did for <html:text>
I don't want to make it disabled as it is graying out that field.
My requirement is that it should be visible and also it shouldn't be editable.
I am using Struts...!!!
<html:text property="paramName" size="20" maxlength="50" readonly="true"/>                                
<html:select property="paramTypeId" disabled="true"> // I dont want to use this--- disabled="true"
     <html:options collection="queryReturnType" property="value" labelProperty="label"/>
</html:select>Thanks in advance....!!

Can some one tell me in the below code
*1. what is test="${controlEnabled}"....wha is this controlEnabled variable*
*2. do I need to create an attribute for paramTypeId_Label in my form bean ??*
I just wanna to make my <html:select> readonly..pls see my first post in this thread....!!
<c:choose>
     <c:when test="${controlEnabled}">
       <html:select property="paramTypeId" >
            <html:options collection="queryReturnType" property="value" labelProperty="label"/>
       </html:select>
     </c:when>
     <c:otherwise
       <html:text property="paramTypeId_Label" value="${queryReturnType[paramTypeId].label}" readonly="true"/>
       <html:hidden property="paramTypeId"/>
     </c:otherwise>
</c:choose>--Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Struts html:select tag

    Hi All,
    I am using struts. I want a dropdown single select menu option on my Jsp page.
    Basically, the options would be a dropdown either US or CA (meaning USA or CANADA). Html selectoptions is easy. How to do it in struts ?
    Once page is displayed, US will be selected by default. Then user may select either of the value from dropdown.
    Then, I have a state option dropdown, which should get populated, depending upon the first selection. Meaning, if user selects US in first dropdown, then all USA states show up in this second single select options.
    If user selects CA in first dropdown, then CANADA states show up in this second dropdown. I have the states list with me for both US and Canada.
    Can anyone send me a snippet of code for first dropdown. and then how in struts can I populate the second single select states dropdown (depending on whether user selected US or CA in first dropdown)
    Any help highly appreciated.
    thanks,
    pp

    Thanks Shanu.
    Nope. I am populating states in both cases in the ActionForm constructor. in other words, they are not coming from database. Folowing is short snippet how I am populating. So, I am able to display those states on the Jsp page dropdown.
    Onlything, i am stuck at is "that determination switch" as I quoted in previous post like
    If (US) then showUsStates else show CanadaStates on the Jsp thinggy ......... I am stuck here.
    And it has to happen on client side, cause if I sybmit the form, its gonna complain about other mandatory textfields like city , zip , phone NOT found as a result of Submit to ActionForm validation -- Even when user has yet to input rest of values and submit the entire form. Thats the reason why I say "On selection of country dropdown, population of appropriate states has to happen on client side"
    Any idea ?
      public CreateServiceRequestForm() {
             countrybean = new CountryBean[2];
             for (int i = 0; i < 2; i++) {
                 countrybean[i] = new CountryBean();
                 countrybean.setCountry(i);
    countrybean[0].setCountryName("US");
    countrybean[1].setCountryName("CA");
    statebean = new StateBean[54];
    for (int i = 0; i < 54; i++) {
    statebean[i] = new StateBean();
    statebean[i].setStateId(i);
    statebean[0].setName("AK");
    statebean[1].setName("AL");
    statebean[2].setName("AR");
    statebean[3].setName("AZ");
    statebean[4].setName("CA");                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Html:select tag

    Hi all,
    In my jsp page i am using struts html:select tag,some contents are not fitting in the alloted size so i want to give horizontal scrolling for this select box,pls any body can tell me which property of select tag can be used,or any html tricks by which i can achive horizontal scrolling.examples will be help full.
    thanks,

    There aren't any tricks. This has nothing to do with Struts or JSP. It only has to to with HTML. The width is controlled by the size of the options or the size of the HTML area it has to display in. The latter if it's restricted otherwise by some table cell's width. I don't believe that I've ever seen a select box which has horizontol scrolling in any browser ever.

  • How to use form name in struts html:form tag

    Hi,
    I want to validate text box value, if it is ordinary html form I would have done like this <form name="myform" action="xxxx.jsp" onsubmit="return validate()">
    But am using struts html:form tags. In this case how can I use/specify name for a form.
    Can any one help me.
    Thanks

    The name of the form comes from the actionForm you have defined backing it.
    View source on the generated page to see what HTML it constructs.
    You are able to use the onsubmit event with the <html:form> tag just like the standard one, so if all you want to do is that:
    <html:form action="/saveUser" onsubmit="return validate()">
    ...You can also give it a styleId, which will generate an id in the HTML.
    See the tag documentation for details: http://struts.apache.org/1.2.x/userGuide/struts-html.html#form

  • Use of titleKey attribute in html:select tag

    Hi,
    There is one "titleKey" attribute to create mouse over pop-up texts taking key values from property files in case of i18n. It works for every struts specific tag like <html:text titleKey="help.rmc.name"/> or <html:checkbox titleKey="help.rmc.name"/> except for <html:select> tag which is used for creating combo box or list box. But this tag contains the titleKey attribute.
    Please give me some suggestions how to implement this mouse over pop-up texts in case of <html:select> tag

    Hi,
    There is one "titleKey" attribute to create mouse over pop-up texts taking key values from property files in case of i18n. It works for every struts specific tag like <html:text titleKey="help.rmc.name"/> or <html:checkbox titleKey="help.rmc.name"/> except for <html:select> tag which is used for creating combo box or list box. But this tag contains the titleKey attribute.
    Please give me some suggestions how to implement this mouse over pop-up texts in case of <html:select> tag

  • Query on struts html:optionsCollection tag !

    Hi,
    I've a query on struts <html:optionsCollection tag. I'm trying to render the values of an arraylist using the optionsCollection . The arraylist is stored as a part of form object. But the issue is that each row of arraylist contains a string data. The arraylist is returned by a remote process.Now, when I use the following struts code,
    <html:select property="userProxy" size="1" >
    <html:optionsCollection property="userProxy" value="" label=""/>
    </html:select>
    what shud be the value for value and label , as the arraylist contains only one string per row . The userProxy is the arraylist field defined in the form object.
    My question, will I be able to use the <html:optionsCollection tag in this scenerio ?
    I'll really appreciate if someone can get back to me on this.
    Thnx

    The html:optionsCollection tag is designed to work with a collection of beans, each with a "label" and "value" attribute.
    If you only have a list of strings, then you probably want to use the html:options tag.
    Note that your ActionForm should have two attributes
    // form bean"
    String userProxy;  //stores the currently selected userProxy
    List userProxyList;  //list of userProxies.
    // assume appropriate get/set methods
    // the jsp page:
    <html:select property="userProxy" size="1" >
      <html:options property="userProxyList"/>
    </html:select>Cheers,
    evnafets

  • Struts html:text tag background colour

    How to change the background colour of Struts <html:text> tag?

    styleClass and styleId, you can put css value on it

  • Struts html:iterate tag

    Hello all,
    Does anyone know if the struts html:iterate tag can be used to iterate through an ArrayList? Can you populate a html:radio tag with such an iterator?
    If anyone has code examples of these, they would be MOST appreciated!
    Thank you!

    I have an ArrayList object that contains a collection of Listing objects.
    The Listing object has two methods getID, getName
    In the ActionForm there is a variable listingData of List type. How can I use the logic:iterate tag to traverse the ArrayList object and display the id and name of the ListingObjects?
    What has to be added in the logic:iterate tag below?
    <table>
    <logic:iterate id="listingForm" name="listingForm" property="listingData">
    <tr>
    <td>
    // Here I want to output the value of ids
    </td>
    <td>
    // Here I want to output the value of names
    </tr>
    </logic:iterate>
    </table>Do I need a nested logic:iterate tag?
    Should the ArrayList be populated with a J2SE class rather than a business object, i.e. the Listing class?

  • How to make a JPanel selectable

    When extending a JPanel and overriding the paintComponent() method the custom JPanel can not be selected so that it gets for example KeyEvents.
    But if I make the new Class extend a JButton it gets of course selected and able to receive for example KeyEvents.
    My question is therefore; what does the JButton implement that a JPanel doesn&#8217;t so that a JButton gets selectable? Or in other words; how to make a JPanel selectable?
    Aleksander.

    Try this extended code. Only the first panel added can get the Focus.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Test extends JFrame
      public Test()
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel panel1 = new JPanel(new BorderLayout());
        JPanel panel2 = new JPanel(new BorderLayout());
        ImagePanel imgPanel = new ImagePanel();
        panel1.setFocusable(true);
        panel2.setFocusable(true);
        panel1.setPreferredSize(new Dimension(0, 50));
        panel2.setPreferredSize(new Dimension(0, 50));
        panel1.setBorder(BorderFactory.createLineBorder(Color.RED,     4));
        panel2.setBorder(BorderFactory.createLineBorder(Color.CYAN,    4));
        imgPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 4));
        panel1.add(new JLabel("Panel 1"), BorderLayout.CENTER);
        panel2.add(new JLabel("Panel 2"), BorderLayout.CENTER);
        getContentPane().add(panel1, BorderLayout.NORTH);
        getContentPane().add(panel2, BorderLayout.SOUTH);
        getContentPane().add(imgPanel, BorderLayout.CENTER);   
        pack();
        panel1.addKeyListener(new KeyAdapter(){
            public void keyPressed(KeyEvent ke){
                System.out.println("Panel1");}});
        panel2.addKeyListener(new KeyAdapter(){
            public void keyPressed(KeyEvent ke){
                System.out.println("Panel2");}});
      public static void main(String[] args){new Test().setVisible(true);}
    class ImagePanel extends JPanel
      Image img;
      public ImagePanel()
        setFocusable(true);
        setPreferredSize(new Dimension(400,300));
        try{img = javax.imageio.ImageIO.read(new java.net.URL(getClass().getResource("Test.gif"), "Test.gif"));}
        catch(Exception e){/*handled in paintComponent()*/}
        addKeyListener(new KeyAdapter(){
          public void keyPressed(KeyEvent ke){
            System.out.println("ImagePanel");}});
      public void paintComponent(Graphics g)
        if(img != null)
          g.drawImage(img, 0,0,this.getWidth(),this.getHeight(),this);
        else
          g.drawString("This space for rent",50,50);
    }

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

  • How can I see the selected tags in the tag bar clearly

    How can I see the selected tags in the tag bar clearly (they used to be in black, now they do not change color; a highlight or Bold would help)

    The History menu lets you revisit the page where you can drag any page element from it.
    How would you sort through thousands (tens of thousands) of files found in a cache?

  • How to make Label in selection screen?

    Hi friends.. can anybody explain how to make labels in selection screens and how to split the selection screen vertically? plz.. Thanks in advance

    Arun kumar,
    Check this program. you can put labels like this.
    REPORT  ZVENKAT_TEST1.
    SELECTION-SCREEN BEGIN OF BLOCK block.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(15) text1.
    SELECTION-SCREEN POSITION 17.
    PARAMETERS :p_pernr type pa0001-pernr.
    SELECTION-SCREEN POSITION 26.
    SELECTION-SCREEN COMMENT 27(30) text2.
    SELECTION-SCREEN end OF LINE.
    SELECTION-SCREEN end OF BLOCK block .
    at SELECTION-SCREEN OUTPUT.
      text1 = 'Personal number'.
      SELECT SINGLE ename FROM pa0001 INTO text2 WHERE pernr = p_pernr.
    Regards,
    Venkat.O

  • How to add my html title tag and html meta name and meta keywords

    how to add my html title tag and html meta name and meta keywords in iweb 09

    Like you will see on Roddy's page iWeb SEO Tool will do the job very easily:
    Click to view full size
    Click to view full size
    It remembers what tags went to which pages so they are easily reapplied when you have to republish.
    OT

  • Struts - HTML:link tag with dynamic page attribute?

    I am trying to use the html:link but the page value is dynamic (resulting from the bean within the iterate tag). The code below doesn't work - error. Is there a way to use all Struts tags and make this happen. Any ideas?
            <logic:iterate id="myMenuForm" property="menuItem" scope="session" name="menuForm" >          <html:link page="<bean:write name="myMenuForm" property="menuDisplayName"/>">                  <bean:write name="myMenuForm" property="menuDisplayName"/>          </html:link>        </logic:iterate> Thanks,
    mlv

    Thanks for all your help. Based on all you your comments, it is now working
    and I thought I would provide some details about how I got it working.
    There are not that many examples within the Struts documentation.
    id = unique name for the object that can be referenced within the iterate
    tag.
    name = is the Bean, in this case it's the ActionForm, that contains the List
    object that will be iterated. In my case, I have a ActionForm that contains
    a List property that contains all the menu item rows from the databse.
    property = is the property name within the ActionForm that is the List
    object. Links to the getter method
    Within the <bean:write> tag you use the id name to get a handle on the final
    object from the iterate tag and the property is one of the property values
    within the bean that is contained within the List.
    So in this case I have a ActionForm bean that contains a List property that
    contains a collection of beans.
    FormAction - bean
    property menuItems of type List contains:
    - row 1 = bean (with a property of menuDisplayName)
    - row 2 = bean (with a property of menuDisplayName)
    - row 3 = bean (with a property of menuDisplayName)
    Here's the JSP code for the tag.
            <logic:iterate id="myMenuForm" name="menuForm" property="menuItem" >
              <html:link page="www.yahoo.com"/>
                      <bean:write name="myMenuForm" property="menuDisplayName"/>
              </html:link>
            </logic:iterate>Now I would like to make the <html:link> page attribute value dynamic from
    the iterate bean. Therefore, you can make the url for the link dynamic If
    you know how to do that, please feel free to provide some help.

  • HTML select tag on irpt page - update database from options

    Hi all,
    I have an irpt page with two selects.  It is the traditional move stuff from one select to the other, then set the order of the options in the configured select.  (Admin page to specify an ordered list of items)
    After the user gets the list how they want it, I would like to send the options to an MII transaction (iCommand?) to update the database table that backs this admin data.
    I can do a comma delimited string to hold the select tag's option values, but would like to know if there is a more elegant way!
    Ideas?
    Thanks,
    --Amy Smith
    --Haworth

    It sounds elegant already - a pretty simple javascript loop to build your csv and Param.1 to your iCommand applet query should work like a charm.
    If you need to run it to a TRX, then the StringListToXML action makes turning your csv into linkable properties a simple effort.

Maybe you are looking for

  • Bursting a report with multiple queries

    Hi, I need to set-up bursting in BIP for a report with multiple queries. The output format is pdf and delivery is through e-mail. Since the queries need to be linked, I'm trying to do this using data template. I've set-up split and burst based on a f

  • Web Templates with Tabs

    Hi, We have quite a few reports we have developed for users that have around 5 or 6 tabs.  When we adding or remove any functionality we have to maintain each of these reports.   Does anyone else have/had this issue and what is a good strategy to mov

  • Trying to connect to Sybase with Java jdbc

    Hoping someone can help me to connect to Sybase database (version is Sybase Adaptive Server Enterprise 12.5.3). I am using a technique I read that worked with Access and adapting by some examples for Syabase I found on the web but keep getting errors

  • AUR Pkgbuild and Node.js

    If my package needs some nodejs packages to build/run, it's preferred to install them through AUR (when provided) or just add a line npm install -g name_of_the_package into build() function? Keep in mind that if the package has been already installed

  • Problem creating Po from Pr.

    Hello Experts, when I am trying to create a PO eith ref to PR .It is allowing me. For a single PR to multiple PO if quanity of PR is consumed totaly then in one client in same server it is giving the  SAP standard error 'Materials of requisition 1000