RE: html:form tag and document submit()
html:form is a JSP Tag library that renders a form tag based on the struts-config. document.form.submit() is a JavaScript expression that is going to submit the specific form. -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: 13 March, 2003 11:31 To: 'Struts Users Mailing List' Subject: html:form tag and document submit() Hi, I have a dumb question to ask. What does the tag html:form do that document.form.submit() doesn't do ? If there is a considerable difference between these two methods, then it might explain some of the things we have been facing here. Mohan -Original Message- From: Ian Hunter [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 7:21 AM To: Struts Users Mailing List Subject: Accessing DynaActionForm fields within custom tag I have a form where the submit button is supposed to say add login or update login depending on if the user in question (based on field fkMember) already exists in the login database. I have tags called HasLogin and HasNoLogin that take an integer parameter, and return whether or not the condition is true. I am using a DynaActionForm to populate the rest of the fields. The DynaActionForm is a session scoped bean called loginForm -- the following code actually works: !-- form tags and all that above -- tdhtml:submit jsp:useBean id=loginForm scope=session class=org.apache.struts.action.DynaActionForm/ app:HasNoLogin idMember=%=new Integer (Integer.parseInt((String)loginForm.get(fkMember)))% bean:message key=button.addlogin/ /app:HasNoLogin app:HasLogin idMember=%=new Integer (Integer.parseInt((String)loginForm.get(fkMember)))% bean:message key=button.updatelogin/ /app:HasLogin /html:submit/td !-- rest of page below -- The syntax above offends my sensibilities. First, I ought to be able to refer to the bean in question without using a jsp:useBean I think; it's obviously available to the rest of the form, if the form works (and it does). Seconds, casting the get() as a String and doing a parseInt to it to create a new Integer is silly. Isn't there a more elegant way to do this? Ian - 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] __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the company. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of Standard Bank. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:form tag and document submit()
Hi, I might have mislead you. I mean something else. In certain cases document.form.submit() doesn't seem to create the form bean and put it in the scope. Now if we invoke some other action doesn't use document.form.submit() and go back and use document.form.submit() then it works. Initially I thought of pre-populating our form bean and then use document.form.submit(). Even that doesn't seem to solve the problem. This is what prompted the question. Mohan -Original Message- From: du Plessis, Corneil C [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 3:08 PM To: Struts Users Mailing List Subject: RE: html:form tag and document submit() html:form is a JSP Tag library that renders a form tag based on the struts-config. document.form.submit() is a JavaScript expression that is going to submit the specific form. -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: 13 March, 2003 11:31 To: 'Struts Users Mailing List' Subject: html:form tag and document submit() Hi, I have a dumb question to ask. What does the tag html:form do that document.form.submit() doesn't do ? If there is a considerable difference between these two methods, then it might explain some of the things we have been facing here. Mohan -Original Message- From: Ian Hunter [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 7:21 AM To: Struts Users Mailing List Subject: Accessing DynaActionForm fields within custom tag I have a form where the submit button is supposed to say add login or update login depending on if the user in question (based on field fkMember) already exists in the login database. I have tags called HasLogin and HasNoLogin that take an integer parameter, and return whether or not the condition is true. I am using a DynaActionForm to populate the rest of the fields. The DynaActionForm is a session scoped bean called loginForm -- the following code actually works: !-- form tags and all that above -- tdhtml:submit jsp:useBean id=loginForm scope=session class=org.apache.struts.action.DynaActionForm/ app:HasNoLogin idMember=%=new Integer (Integer.parseInt((String)loginForm.get(fkMember)))% bean:message key=button.addlogin/ /app:HasNoLogin app:HasLogin idMember=%=new Integer (Integer.parseInt((String)loginForm.get(fkMember)))% bean:message key=button.updatelogin/ /app:HasLogin /html:submit/td !-- rest of page below -- The syntax above offends my sensibilities. First, I ought to be able to refer to the bean in question without using a jsp:useBean I think; it's obviously available to the rest of the form, if the form works (and it does). Seconds, casting the get() as a String and doing a parseInt to it to create a new Integer is silly. Isn't there a more elegant way to do this? Ian - 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] __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the company. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of Standard Bank. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. __ - 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: html:form tag and document submit()
The html:form struts tag will render/ create an html page (from your jsp) which will be, standard html form tag: form action=XZXZXZ method=post The value XXZXZ will be taken from the struts-config.xml at runtime/ page creation time. Method by default will always be post. In html u can submit a form either by having a submit button rendered with input type=submit Or use javascript to submit it (form.submit()) rgds g1 -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 3:01 PM To: 'Struts Users Mailing List' Subject:html:form tag and document submit() Hi, I have a dumb question to ask. What does the tag html:form do that document.form.submit() doesn't do ? If there is a considerable difference between these two methods, then it might explain some of the things we have been facing here. Mohan -Original Message- From: Ian Hunter [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 7:21 AM To: Struts Users Mailing List Subject: Accessing DynaActionForm fields within custom tag I have a form where the submit button is supposed to say add login or update login depending on if the user in question (based on field fkMember) already exists in the login database. I have tags called HasLogin and HasNoLogin that take an integer parameter, and return whether or not the condition is true. I am using a DynaActionForm to populate the rest of the fields. The DynaActionForm is a session scoped bean called loginForm -- the following code actually works: !-- form tags and all that above -- tdhtml:submit jsp:useBean id=loginForm scope=session class=org.apache.struts.action.DynaActionForm/ app:HasNoLogin idMember=%=new Integer (Integer.parseInt((String)loginForm.get(fkMember)))% bean:message key=button.addlogin/ /app:HasNoLogin app:HasLogin idMember=%=new Integer (Integer.parseInt((String)loginForm.get(fkMember)))% bean:message key=button.updatelogin/ /app:HasLogin /html:submit/td !-- rest of page below -- The syntax above offends my sensibilities. First, I ought to be able to refer to the bean in question without using a jsp:useBean I think; it's obviously available to the rest of the form, if the form works (and it does). Seconds, casting the get() as a String and doing a parseInt to it to create a new Integer is silly. Isn't there a more elegant way to do this? Ian - 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 email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form tag and document submit()
One is a javascript method that allows you to submit a form, the other a jsp tag that renders to an html form when its asociated with a form bean.. Or have i miss understood the question? Giovedì, 13 mar 2003, alle 10:31 Europe/Rome, Mohan Radhakrishnan ha scritto: Hi, I have a dumb question to ask. What does the tag html:form do that document.form.submit() doesn't do ? If there is a considerable difference between these two methods, then it might explain some of the things we have been facing here. Mohan -Original Message- From: Ian Hunter [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 7:21 AM To: Struts Users Mailing List Subject: Accessing DynaActionForm fields within custom tag I have a form where the submit button is supposed to say add login or update login depending on if the user in question (based on field fkMember) already exists in the login database. I have tags called HasLogin and HasNoLogin that take an integer parameter, and return whether or not the condition is true. I am using a DynaActionForm to populate the rest of the fields. The DynaActionForm is a session scoped bean called loginForm -- the following code actually works: !-- form tags and all that above -- tdhtml:submit jsp:useBean id=loginForm scope=session class=org.apache.struts.action.DynaActionForm/ app:HasNoLogin idMember=%=new Integer (Integer.parseInt((String)loginForm.get(fkMember)))% bean:message key=button.addlogin/ /app:HasNoLogin app:HasLogin idMember=%=new Integer (Integer.parseInt((String)loginForm.get(fkMember)))% bean:message key=button.updatelogin/ /app:HasLogin /html:submit/td !-- rest of page below -- The syntax above offends my sensibilities. First, I ought to be able to refer to the bean in question without using a jsp:useBean I think; it's obviously available to the rest of the form, if the form works (and it does). Seconds, casting the get() as a String and doing a parseInt to it to create a new Integer is silly. Isn't there a more elegant way to do this? Ian - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]