File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Tag translation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tag translation error" Watch "Tag translation error" New topic
Author

Tag translation error

Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
I am using RAD6 and it seems like it can't determine that it's actually a JavaScript function call. Here is the code from my JSP.

<html:text size="2" maxlength="2" property="fromDateMM" whenDownKey="TabNext(this,'down',2);/>"

Here is the error: It's thinking it's a tag!
JSPG0123E: Unable to locate tag attribute info for tag attribute whenDownKey.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

I'm not sure I'm understanding your confusion.

It's saying that it can't find any info for an attribute named whenDownKey on the <html:text> tag, which is indeed a tag.

Is this the Struts <html:text> tag you are using?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Yes. I am using the struts html:text tag. Within that I am calling a javascript function then the key is pressed. But for some reason it's thinking that function call "onkeydown" is a tag attribute.

I called it whenkeydown because the board gave me an error when I posted the actual javascript function name.
[ March 02, 2007: Message edited by: Bosun Bello ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Originally posted by Bosun Bello:
But for some reason it's thinking that function call "onkeydown" is a tag attribute.


It is an attribute the way you have it coded. And apparently not one supported by the <html:text> tag.

What makes you think that it's not a tag attribute?
[ March 02, 2007: Message edited by: Bear Bibeault ]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Well there is a javascript function called "TabNext" that I want to call when the key is pressed. The goal is to autotab to the next field once the max length of the current field is reached. So, all I did was add the javascript call on the keydown event.

Actually someone posted a similar question in another forum(found it via google search), but no solution is posted yet.

So, Bear you are saying I coded it in correctly? The book I am using "struts in action" as similar examples. So, that's why I was thinking it's might be something else.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Originally posted by Bosun Bello:
So, Bear you are saying I coded it in correctly?


That depends on whether the <html:text> tag is defined to accept that attribute. I'm not a fan of Struts so I'm not intimately familiar with its tags. Remember, you can only use attibutes on a custom tag that it was defined to accept.

I'm going to remand this to the Struts forum at this point where those more familiar with its tag library can advise you on how to accomplish your mission.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Thanks for your help Bear. I have ressolved. I was not aware that case matters. So, I just changed the case to all lowercase. onkeydown, onkeyup, onsubmit, etc.
[ March 02, 2007: Message edited by: Bosun Bello ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

I was about to recommend that judging on the precedent set by the other attribute names.

If you are going to be using the Struts tags, learn how to read their TLDs to avoid such conflicts going forth.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tag translation error
 
Similar Threads
How to control JSF to stop prefix value with UI Component Identifer
custom tag SetProperty: Mandatory attribute property missing
c:when test = .....problem
Struts: No getter method for property name problem
Tag translation error