Spring Form, commandName and autocomplete="off" - forms

I want to have the autocomplete="off" attribute on a form. I need it on the form because Firefox ignores it on the individual input elements.
The spring form tag does not support autocomplete and barfs if I try to add it.
If I don't use the spring form I am unable to set the commandName attribute.
Can anyone think of a way to get both autocomplete and commandName working together?
Cheers,
Peter

The spring form:input and form:password tags do support autocomplete. And they work just fine.
Here is the Spring form tld reference.

You have at least 3 choices:
extend the original form tag by your own implementation
use the bind tag instead of the form tag, then you can write the html form tag like you wast: see http://jroller.com/habuma/entry/spring_form_tags
add the attribute by java script. for example the dojo framework willl help you

Related

how to disable browser autofill username and password. we are using Gwt MVP model for creating screen and using Sencha GXT library

we have autocomplete="off" in jquery but not finding to set in gwt xml file.Can someone help me to set autocomplete to false.
<f:FieldLabel labelSeparator="" ui:field="userNameLabel">
<f:widget><f:TextField width="300" ui:field="userName" /></f:widget>
</f:FieldLabel>
Textfield doesn't have autocomplete attribute to set.
What ui library are you using?
For example if you are using vanilla gwt you could get the Element and set the attribute autocomplete="off" manually
http://www.gwtproject.org/javadoc/latest/com/google/gwt/dom/client/Element.html#setAttribute-java.lang.String-java.lang.String-
You could create a Composite that wraps the field and set this automatically, then create instances of TextFieldNotAutocomplete for example
http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/Composite.html

TYPO3 Powermail 2.x many forms and hidden fields

I am in a TYPO3 project with Powermail 2.x and there are different forms (created in the backend). Every form needs the same hidden fields, is tehre a way to create this needed fields once and use it in any form? Does someone know something similar or exactly something like this?
Thanks in advance!!
Based on my experience with powermail there is no option to add the fields from another form on the same page or from another page.
I would suggest to complete the first Powermail form with all required fields and then copy it. Once you copy the Powermail plugin element and paste it on another page, the included Powermail form and all fields are also copied.
It's not exactly what you were looking for, but simple and effective.

Adding attributes to cq5 form using FormsHelper

I'm trying to add an attribute to the form tag of a cq5 form. I noticed that the output is generated using
FormsHelper.startForm(slingRequest, new JspSlingHttpServletResponseWrapper(pageContext));
I was curious how I can either:
alter the request so that the formHelper prints the form w/ the attributes I need
Hook into the actual print out to include the attributes I need.
Any help or direction would be good.
note:
I've already checkout out the javadoc for formshelper, done some searching via goolgle, and dev.day.com including the dev.day.com doc on developing forms.
thank you
API doesn't allow you to add any attributes to this tag. You can only specify desired CSS classes adding css property to the form component. Of course, you can also create component sling filter and response wrapper to rewrite created form, but it seems to be an overkill. I think better solution is using JS to add attributes client-side.

Changing output of Forms with Struts+Freemarker

I'm working on a Website with Struts2 and Freemarker.
Whenever I add form tags such as:
<#s.form action="foo">
<#s.combobox (...)/>
It generates a bunch of html/css/javascript that I don't need.
Is there any way I can specify that no extra elements should be generated or do I really need to go into Freemarker.jar and edit the templates to my liking?
Have you read about "themes" in struts2 tags ?
http://struts.apache.org/2.x/docs/why-do-the-form-tags-put-table-tags-around-controls.html
http://struts.apache.org/2.x/docs/themes-and-templates.html

GWT : How to Read Hidden Box value?

I Have a hidden box in my HTML. How I can get it value in my GWT when onModuleLoad??
the hidden box will content a value pass from another page. Now I can see the hidden box content the value but I fail to get the value in my GWT onModuleLoad.
HTML page:
<%
String sSessionID=request.getParameter("NA_SessionID");
if(sSessionID==null)
session.setAttribute("NetAdminSession",(String)session.getAttribute("NetAdminSession"));
else
session.setAttribute("NetAdminSession",sSessionID);
%>
<form name=frmMain method=post>
<input type=hidden name=NA_SessionID name=NA_SessionID value="<%=(String)session.getAttribute("NetAdminSession")%>"></input>
</form>
You can access any element in the DOM by using the GWT DOM Class. For example, if your hidden box has the id "NetAdminSession", you may use the following to access the hidden box...
DOM.getElementById("NetAdminSession");
To: Geoffrey Wiseman
my HTML file is in the GWT HTML.. but I change it to JSP file instead of HTML
To: prometheus
Thanks you information, I will give it a try now.
I'm not sure what your overall approach/architecture is, but it might also be helpful to look into some of the new features added in GWT 2.0. Specifically, Declarative Layout with UIBinder. With this you can actually construct your user interface with declarative XML instead of using pure Java. I would steer away from creating too much of your UI in the actual HTML file since it will be easier to control those UI elements if you construct them in your GWT code. You can still stick to good MVC principles if you break your classes/code up the right way.