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

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

Related

Is material-ui friendly to form?

Recently, when I use React&material-ui to make a form, I find that many components do not have 'name' property, such as 'SelectField'. So I must get the value through a method. Is material-ui suitable for implementing a form? If the answer is yes, can you give me a intact example which uses some components such as 'TextField', 'SelectField', and how do I submit it?
I could recommend connectin material-ui with redux-form:
http://redux-form.com/6.8.0/examples/material-ui/
Works fine as long as you pass component representing material-ui form into the Field from react redux
import { Field } from 'redux-form/immutable';
import TextField from 'material-ui/TextField';
<Field
name="username"
id="username"
type="text"
placeholder="Username"
label="Username"
required
iconName="person"
component={TextField}
/>
And then you would have form values existing in redux state.
This actually is not a material-ui specific issue i believe. You'll be in the same boat if you use simple <input> elements.
Basically what you want to do is get/set the value of a text box / checkbox when a user does some action or clicks submit. Material-ui just lets you do pretty, reusable and designed components so that you wont have to write them yourself.
To work easily with forms you would have do some additional coding from your side. I also suggest the great library redux-form but it would require you to also implement redux in your app (A great thing by itself but i dont know what are your requirements).
If you want another option then you can use https://github.com/christianalfoni/formsy-react which is another great and popular library for managing forms and doesnt require redux
If you want to do things yourself then you can use recommendations from https://facebook.github.io/react/docs/forms.html which in general tell you to have controlled components.
One final thing. Dont be afraid to use additional libraries and modules. The whole point in having hundreds thousands of modules is for people to use them =]

Sightly and cq:dropTargets

I'm developing a new site using the latest AEM6 (formerly CQ). Originally you were able to drag images/videos into the components drop zone which was setup in the components dropTarget using JSP's.
But since Sightly templating is now the preferred way of building components rather than JSP's is it still possible to have dropTarget in Sighlty templates?
Drop target is configured using node cq:dropTargets node under the cq:editConfig and it doesn't depend on the used markup language.
The only thing that markup has to produce is a <div> tag with class cq-dd-CONFIGNAME which will be used as a drop zone. Sightly can easily generate such markup (below example will show it only in the edit mode):
<div data-sly-test="${wcmmode.edit}" class="cq-dd-images">Drop image here</div>

How to use WAI-ARIA in GWT 2.4

I've created component in GWT but now I need to add accessibility to our components. We are using GWT 2.4. I.E How I can add role tag or aria tag in a DisclosurePanel.
Thanks.
Did you reference GWT Guideline Documentation for ARIA - https://developers.google.com/web-toolkit/doc/latest/DevGuideA11y
Also read through http://code.google.com/p/google-web-toolkit/wiki/ARIAImplementationDetails
I am not exactly sure about adding role tag or aria tag in a DisclosurePanel. You can try and follow the principles GWT team use for Tree or Menubar which similarly show/hide data on interaction.

Spring Form, commandName and autocomplete="off"

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

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.