Hi Adrian,

Yeah, that's like I am looking for. Thanks a lot!

Hubert

-----Ursprüngliche Nachricht-----
Von: Rios, Adrian [mailto:[EMAIL PROTECTED] 
Gesendet: Sonntag, 8. Juli 2007 19:42
An: Struts Users Mailing List
Betreff: RE: How suppress the HTML INPUT from Struts2 Combobox?

Hubert, 

Not sure if this is what you are looking for but you can try this.

In the combobox, you can do something simple like the disabled option.

<select class="name" name="name" style="" tabindex="" disabled="disabled">
        <option value="" >--Select--</option>
                <c:forEach items="${}" var="currentitem" varStatus="count">
                        <option>
                                stuff goes in here.....
                        </option>
                </c:forEach>
</select>

In the text field, you could do something simple like....maybe the readonly
option....or you could use a function where capture the keystrokes of the
user.   

I included some JavaScript functions.  The function whichButtonN captures
all key strokes by users....now you could change the function to capture all
key strokes.  The function cleanNum is a safety net....just in case the user
copies values into the text field.

<input type="text" value="" name="" class="maintextInput"
onchange='cleanNum(this)' onkeypress="return(whichButtonN(event))"
maxlength="" readonly=readonly />


function whichButtonN(event)
{
        //if (event.keyCode == 32) return false;
        if (event.keyCode > 47 && event.keyCode < 58) return true;
        else return false;
        
}

function cleanNum (w){

        var inptString = w.value;
        var valid="1234567890" ;
    var output='';
                for (var i=0; i<inptString.length; i++){
                if (valid.indexOf(inptString.charAt(i)) != -1){
                        output += inptString.charAt(i)
                }
        }
        w.value=output;
   return output;
}

I hope this helps....

Adrian
__________________________________________________

Senior Programmer Analyst, Tax Distributed Systems Development

Tax & Compliance Development, ADP IT

Phone: (909) 592-6411 Ext. 3863

e-mail: [EMAIL PROTECTED]



-----Original Message-----
From: Hubert Hers [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 08, 2007 9:30 AM
To: 'Struts Users Mailing List'
Subject: AW: How suppress the HTML INPUT from Struts2 Combobox?


By a 'normal' combobox I mean a combobox like in javax.swing.JComboBox or as
the HTML select.

Hubert

-----Ursprüngliche Nachricht-----
Von: Dave Newton [mailto:[EMAIL PROTECTED] 
Gesendet: Sonntag, 8. Juli 2007 17:27
An: Struts Users Mailing List
Betreff: Re: How suppress the HTML INPUT from Struts2 Combobox?

--- Hubert Hers <[EMAIL PROTECTED]> wrote:
> According to the Struts2 (2.0.8) documentation a
> combo box is an HTML INPUT of type text and HTML 
> SELECT grouped together to give you a combo box
> functionality. Does anyone know if it is possible to

> suppress the HTML INPUT? And if so, how?
> 
> Or if not, any advice how to implement in Struts2 a
> 'normal' combobox without a text field?

I thought a "normal" combobox *was* a text field with
a select. If you don't want the text field isn't it
just a select box?

d.


       
____________________________________________________________________________
________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-----------------------------------------
This message and any attachments are intended only for the use of
the addressee and may contain information that is privileged and
confidential. If the reader of the message is not the intended
recipient or an authorized representative of the intended
recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this
communication in error, notify the sender immediately by return
email and delete the message and any attachments from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to