Solved

html:select of struts

Posted on 2007-03-28
13
1,268 Views
Last Modified: 2013-11-24
Hi experts ..

How can I change the aligment of values inside <html:select> of struts?? I want it right aligmnet!! but it doesn't have align or dir property!!
0
Comment
Question by:DrAske
  • 6
  • 5
  • 2
13 Comments
 
LVL 10

Expert Comment

by:ECollin
ID: 18809135
hi,

u can use a css style like this :

<html:select style="text-align:right">
...


Emmanuel
0
 
LVL 9

Author Comment

by:DrAske
ID: 18809220
It didn't work!!
       <html:select  size="5"  property="Dim" style="text-align:right">
            <html:optionsCollection  label="prompt" value="index" property="Dim.displayData"/>
        </html:select>
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18809301
Try putting it in a <td> of a table

<td align = "right"><html:select>....</html:select></td>
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 9

Author Comment

by:DrAske
ID: 18809345
It didn't work too!!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18809361
How did you do it with the table?
0
 
LVL 9

Author Comment

by:DrAske
ID: 18809409
<table cellspacing="2" cellpadding="3" border="1" width="100%">
        <tr>
          <td align="right">
            <html:select size="5" property="Dim">
              <html:optionsCollection label="prompt" value="index" property="Dim.displayData"/>
            </html:select>
          </td>
          <td>
            <html:image src="anim_down.jpg" property="nomembers" value="nomembers" onclick="event.value=this.value;btn1.value=this.value;"/>
            <html:image src="build_down.jpg" property="nobuildings" value="nobuildings" onclick="event.value='nomembers';btn1.value=this.value; "/>&nbsp;
          </td>
          <td>&nbsp;</td>
        </tr>
      </table>
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18809437
You have a td after that one too, so how would this be right aligned?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18809445
<table cellspacing="2" cellpadding="3" border="1" width="100%">
        <tr>
          <td width = "50%">
            <html:image src="anim_down.jpg" property="nomembers" value="nomembers" onclick="event.value=this.value;btn1.value=this.value;"/>
            <html:image src="build_down.jpg" property="nobuildings" value="nobuildings" onclick="event.value='nomembers';btn1.value=this.value; "/>&nbsp;
          </td>
          <td>&nbsp;</td>
          <td width = "50%" align="right">
            <html:select size="5" property="Dim">
              <html:optionsCollection label="prompt" value="index" property="Dim.displayData"/>
            </html:select>
          </td>
        </tr>
      </table>

   

0
 
LVL 9

Author Comment

by:DrAske
ID: 18809496
okay !! it seems that you did not read my quesion carefully :o) ..

I want the text values in the select list to be right aligment not the list it self!!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18809515
Oops, in that case the td will not work
0
 
LVL 10

Accepted Solution

by:
ECollin earned 500 total points
ID: 18815017
hi,

i'm a bit surprised that my code doesn't work. I tested it with success.

You can also try to embed css styles in your page like this :
select {
text-align:right;
}


0
 
LVL 9

Author Comment

by:DrAske
ID: 18831274
Really don't know why it doesn't work !!
I'm using JDeveloper, I have a view object with set of attributes, in the data control palette I've selected the *Dim* attribute -as you can see in the *property* attribute in html:select- and specify it to be * List of Values* from the combobox and drag/drop it inside the jsp page???

 <html:select size="11" property="Dim" style="text-align:right;;width:250px;">
          <html:optionsCollection style="text-align:right;" label="prompt" value="index" property="Dim.displayData"/>
        </html:select>
0
 
LVL 9

Author Comment

by:DrAske
ID: 18831282
May be it doesn't work because it is *Struts html*??
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
json example 39 172
firstChar challenge 13 133
servlet example 17 59
hibernate example issues from command prompt 10 65
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question