Re: Setting html:text readonly attribute

2004-05-04 Thread John Moore
At 16:08 03/05/2004, Jason Miller wrote:

Actually, you can't use a tag as the value of another tag's attribute.
Out of interest, does anyone know whether there are plans for this for a 
future JSP version? It seems quite an obvious requirement, and I can't see 
any technical reason why it should not be possible. It would surely be easy 
to establish an order of evaluation (the nested tags get evaluated first).

John

=
John Moore -Norwich, UK-[EMAIL PROTECTED]
=  

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.662 / Virus Database: 425 - Release Date: 20/04/2004

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

RE: Setting html:text readonly attribute

2004-05-03 Thread Paul McCulloch
You cannot use one jsp tag to supply another jsp tag with a value for an
attribute.

Some solutions are:

1) Use an html (rather than a jsp) tag:

 input type=text name=licenceCount value=c:out
value='${purchaseForm.licenceCount}'/ size=3 readonly=c:out
value='${purchaseForm.newPurchase}'/ maxlength=5/

2) Use a bean defintion and an rt expression:

bean:define id=readOnly name=purchaseForm property=newPurchase/

html:text property=licenceCount size=3 readonly=%=readOnly%
maxlength=5/

3) Use struts el tag:

html-el:text property=licenceCount size=3
readonly=${purchaseForm.licenceCount} maxlength=5/


Paul

 -Original Message-
 From: John Moore [mailto:[EMAIL PROTECTED]
 Sent: Monday, May 03, 2004 2:30 PM
 To: [EMAIL PROTECTED]
 Subject: Setting html:text readonly attribute


 I'm having a big problem trying to dynamically set a value
 for the readonly
 attribute of an html:text tag. I'm using a JSTL core tag to
 try to set it
 and whatever I do is ignored.

 In the example below, the newPurchase property is a boolean. If I use
 exactly this tag elsewhere on the page, it outputs true or false as
 expected. Here, though, it has no effect on the attribute, whether
 newPurchase is true or false - the input tag generated is missing the
 'readonly' attribute.

  html:text property=licenceCount size=3 readonly=c:out
 value='${purchaseForm.newPurchase}'/ maxlength=5/

 I've also tried the following (with as little effect), using
 an escaped
 double-quote instead of a single quote:

  html:text property=licenceCount size=3 readonly=c:out
 value=\${purchaseForm.newPurchase}\/ maxlength=5/

 The curious thing is that I can use a similar construct but
 with an integer
 property to dynamically set other attributes, such as size, as in the
 following example (ignore the logical nonsense of assigning a
 size on such
 a basis, it's just a test of technical feasibility):

  html:text property=licenceCount size=c:out
 value=\${purchaseForm.totalLicences}\/ maxlength=5/

 Is there something to do with assigning boolean attributes in
 these tags
 which I haven't got yet? Or is it just soemthing weird with
 the readonly one?

 John


 =
 John Moore -Norwich, UK-[EMAIL PROTECTED]
 = 
 

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



RE: Setting html:text readonly attribute

2004-05-03 Thread John Moore
At 16:09 03/05/2004, Paul McCulloch wrote:

You cannot use one jsp tag to supply another jsp tag with a value for an
attribute.
This certainly explains my problem. I could swear that I was doing so 
successfully with an integer attribute, though, as I mentioned in my 
original post. Trying it again, though, it fails (as it apparently should). 
Goodness knows what I did last time!

Thanks for your suggestions, which I'll try out.

John

=
John Moore -Norwich, UK-[EMAIL PROTECTED]
=  

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.662 / Virus Database: 425 - Release Date: 20/04/2004

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

RE: Setting html:text readonly attribute

2004-05-03 Thread John Moore
At 16:09 03/05/2004, Paul McCulloch wrote:

1) Use an html (rather than a jsp) tag:

 input type=text name=licenceCount value=c:out
value='${purchaseForm.licenceCount}'/ size=3 readonly=c:out
value='${purchaseForm.newPurchase}'/ maxlength=5/
I've found that this, unfortunately doesn't work, at least with my current 
browser of choice (Firefox), which insists on making the text field 
read-only as long as there is a 'readonly' attribute present. I'm exploring 
the other options next.

I have to say, completely off-topic, that it strikes me as pretty moronic 
behaviour for a browser if you have a boolean attribute, readonly, and it 
interprets readonly='false' as being an instruction to make the field 
read-only. But it does.

John

=
John Moore -Norwich, UK-[EMAIL PROTECTED]
=  

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.662 / Virus Database: 425 - Release Date: 20/04/2004

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

RE: Setting html:text readonly attribute

2004-05-03 Thread John Moore
At 21:07 03/05/2004, John Moore wrote:

At 16:09 03/05/2004, Paul McCulloch wrote:

1) Use an html (rather than a jsp) tag:

 input type=text name=licenceCount value=c:out
value='${purchaseForm.licenceCount}'/ size=3 readonly=c:out
value='${purchaseForm.newPurchase}'/ maxlength=5/
I've found that this, unfortunately doesn't work, at least with my current 
browser of choice (Firefox), which insists on making the text field 
read-only as long as there is a 'readonly' attribute present. I'm 
exploring the other options next.
LATER...

Tweaking it so that it outputs only 'readonly' is, of course, the solution.

John

=
John Moore -Norwich, UK-[EMAIL PROTECTED]
=  

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.662 / Virus Database: 425 - Release Date: 20/04/2004

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

Re: Setting html:text readonly attribute

2004-05-03 Thread Craig McClanahan
Riyad Kalla wrote:

Whats the diff between readonly and disabled=true, I've been using the 
latter...

 

In the terminology of the HTML Specification [1], a disabled control 
disallows user input *and* the field will not be successful on a form 
submit.  In other words, there will be no corresponding request 
parameter.  A readonly field [2] also disallows user input, but the 
request parameter for this field will still be returned (sort of a 
visible version of an input type=hidden field).  There are also a 
few other minor differences that you can see in the spec language.

Craig

[1] http://www.w3.org/TR/html4/interact/forms.html#adef-disabled
[2] http://www.w3.org/TR/html4/interact/forms.html#adef-readonly
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Setting html:text readonly attribute

2004-05-03 Thread Riyad Kalla
Ohhh hell. Chris thanks for the info, I have some serious code updates to 
make ;)

Best,
Riyad

On Monday 03 May 2004 02:00 pm, Craig McClanahan wrote:
 Riyad Kalla wrote:
 Whats the diff between readonly and disabled=true, I've been using the
 latter...

 In the terminology of the HTML Specification [1], a disabled control
 disallows user input *and* the field will not be successful on a form
 submit.  In other words, there will be no corresponding request
 parameter.  A readonly field [2] also disallows user input, but the
 request parameter for this field will still be returned (sort of a
 visible version of an input type=hidden field).  There are also a
 few other minor differences that you can see in the spec language.

 Craig

 [1] http://www.w3.org/TR/html4/interact/forms.html#adef-disabled
 [2] http://www.w3.org/TR/html4/interact/forms.html#adef-readonly


 -
 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]



Re: Setting html:text readonly attribute

2004-05-03 Thread Riyad Kalla
Whats the diff between readonly and disabled=true, I've been using the 
latter...

On Monday 03 May 2004 01:25 pm, John Moore wrote:
 At 21:07 03/05/2004, John Moore wrote:
 At 16:09 03/05/2004, Paul McCulloch wrote:
 1) Use an html (rather than a jsp) tag:
 
   input type=text name=licenceCount value=c:out
 value='${purchaseForm.licenceCount}'/ size=3 readonly=c:out
 value='${purchaseForm.newPurchase}'/ maxlength=5/
 
 I've found that this, unfortunately doesn't work, at least with my current
 browser of choice (Firefox), which insists on making the text field
 read-only as long as there is a 'readonly' attribute present. I'm
 exploring the other options next.

 LATER...

 Tweaking it so that it outputs only 'readonly' is, of course, the solution.

 John


 =
 John Moore -Norwich, UK-[EMAIL PROTECTED]
 =

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