S
Sébastien de Mapias
Hi,
I'm using Struts 1.1. I'm displaying in a list in a JSP, with 4
columns
(an ID, a date, a type1 and a type2). A click on the 4rth element
in one row of this list triggers the appearance of a small pop-up
(just a div that I make visible), with 3 fields To, Cc, Bcc and a
hidden 'id' field, and 2 buttons: 'Send' or 'Cancel'.
I'd like to call the 'sendMail' defined in my struts-config.xml, with
one argument: the ID of the row clicked. I can't seem to be able
to have it working.
1/ in the 1rst case I do the following in the definition of my 'Send'
button:
~ <a href="#" onClick="sendMail.do?docId=document.getElementById
('id').value;">
~ <bean:message key="button.send" />
~ </a>
I get error "missing: in conditional expression" with
"sendMail.do?docId=document.getElementById('id').value;"
=> the 'document.getElementById('id').value' is not evaluated
(I should get "sendMail.do?docId=6489")
2/ in the 2nd case I've created a javascript function, and tried with
~ <a href="#" onClick="sendMail();">
~ <bean:message key="button.send" />
~ </a>
my sendMail() function being:
~ function sendMail() {
~ var docId = document.getElementById('id').value;
~ window.location.href='sendMail.do?docId='+docId;
~ }
I do get the correct URL in my address bar then:
~ http://localhost:9080/app-web/sendMail.do?docId=1618
but with the following error:
~ Error 500: Cannot find bean org.apache.struts.taglib.html.BEAN
~ in any scope
My question: is there a way to call my JSP-defined 'sendMail'
procedure with this 'docId' parameter ? (I only need to call this
procedure/action, don't need to open another window)
In advance, thanks...
Seb
I'm using Struts 1.1. I'm displaying in a list in a JSP, with 4
columns
(an ID, a date, a type1 and a type2). A click on the 4rth element
in one row of this list triggers the appearance of a small pop-up
(just a div that I make visible), with 3 fields To, Cc, Bcc and a
hidden 'id' field, and 2 buttons: 'Send' or 'Cancel'.
I'd like to call the 'sendMail' defined in my struts-config.xml, with
one argument: the ID of the row clicked. I can't seem to be able
to have it working.
1/ in the 1rst case I do the following in the definition of my 'Send'
button:
~ <a href="#" onClick="sendMail.do?docId=document.getElementById
('id').value;">
~ <bean:message key="button.send" />
~ </a>
I get error "missing: in conditional expression" with
"sendMail.do?docId=document.getElementById('id').value;"
=> the 'document.getElementById('id').value' is not evaluated
(I should get "sendMail.do?docId=6489")
2/ in the 2nd case I've created a javascript function, and tried with
~ <a href="#" onClick="sendMail();">
~ <bean:message key="button.send" />
~ </a>
my sendMail() function being:
~ function sendMail() {
~ var docId = document.getElementById('id').value;
~ window.location.href='sendMail.do?docId='+docId;
~ }
I do get the correct URL in my address bar then:
~ http://localhost:9080/app-web/sendMail.do?docId=1618
but with the following error:
~ Error 500: Cannot find bean org.apache.struts.taglib.html.BEAN
~ in any scope
My question: is there a way to call my JSP-defined 'sendMail'
procedure with this 'docId' parameter ? (I only need to call this
procedure/action, don't need to open another window)
In advance, thanks...
Seb