What's the difference between GWT's EditTextCell and TextInputCell? - gwt

Both cells seem to render an <input type="text"...></input>. How do they differ? What are their respective uses?

EditTextCell is a special cell that can be used to edit a text. By default the cell is in normal mode and the text is displayed as non-editable html. On click the cell changes to edit mode and the text is displayed in an input. The user can edit the text inside the input.
If in edit mode a ENTER changes back to normal mode and fires any ValueUpdater. If in edit mode a ESC changes back to normal mode without firing any ValueUpdater.
On the other hand TextInputCell is a cell that ALWAYS displays the text in an input element.
To see both cells is action (columns 3 & 4): http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellSampler

In EditTextCell you can press Escape to cancel edits.

Related

NatTable allow cell editing only when cell is selected

Working with a NatTable, I would like the following behavior:
Single click on an unselected, editable cell - cell is selected
Double-click on a cell (at any time), do custom open action
Single-click on a selected cell triggers an edit
Do I need to write a custom IEditableRule that checks selection? If there a way to check the selection from w/i this rule, or do I need to also create a rule that can listen to the entire table selection and unify these concepts?
You need to register custom bindings for editing. The default bindings are registered via DefaultEditBindings. You need to replace them with bindings for double click to open the editor and some customized actions that check the selection. For the key bindings NatTable uses the same approach. It is not the default to check the selection because of abstraction and it should be possible to edit even if you have no SelectionLayer in place.
To check if the cell is selected you either need a reference to SelectionLayer or check the DisplayMode of the cell. Never tried to use a IEditableRule for this.
Maybe these posts give you some more information:
https://www.eclipse.org/forums/index.php/t/452759/
Stop NatTable from going into edit mode when an editable cell is left-mouse-clicked

iTextSharp PDFForm Radio Button format change

We have a library of PDF forms which we're filling with variable content in text, check box and radio button form fields. Since the form is a template, we use the PDFStamper to perform the form fills. Everything is filling and checking appropriately. The problem we have is that the Radio Button controls are set up (in the form) to display a check mark and not the conventional dot within a circle. When filling the form manually with Acrobat reader, the buttons appear as check boxes however; after filling with iText PDFStamper, the resulting PDF radio buttons revert to their conventional style (dot within a circle).
Is this a bug or is it the intended functionality? Is there a work around. We are currently on V5.5.8. I know in previous version(s) the formatting was maintained.
Thanks for any help .

UITextField's Clear Button set to 'Never Appears' but still shows when adding text

I need to never display the clear button on a specific text field. in IB I've set the clear button as 'Never Appears'. However, once the user inputs even 1 character into the text field, the clear button shows up. These text fields are pretty short (due to spacing) and the clear button covers the written text, which looks terrible.
I need to do away with the clear button all together but setting it as 'Never Appears' still makes it appear.
self.myTextField.clearButtonMode = UITextFieldViewModeNever;
Should work to make it never appear.
Are you sure you didn't set it to "Appears while editing" somewhere by mistake?
The default value for the clearButtonMode property is UITextFieldViewModeNever.
From the documentation :
clearButtonMode
Controls when the standard clear button appears in the text field.
#property(nonatomic) UITextFieldViewMode clearButtonMode
Discussion
The standard clear button is displayed at the right side of the text
field as a way for the user to remove text quickly. This button
appears automatically based on the value set for this property.
The default value for this property is UITextFieldViewModeNever.

Tab from input to input in CellTable

I have a CellTable with a bunch of cells that render to <input> tags. Tabbing between the inputs is broken because of CellTable's fancy event processing. It seems that tab inspires each cell to finishEditing, but that in turn hogs the focus and the focus never gets to the next <input>.
Setting tabIndex on each input does not seem to affect the behavior.
How can I restore the usual tabbing functionality?
I recently figured this out. Annoying, but simple once you find the magic.
Create a new Cell type to use in your table, as the stock TextInputCell specifies a tab index of -1. Basically do everything that TextInputCell does, but dont specify any tab index in your template.
Disable the default keyboard navigation on your CellTable. cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED)
This should result in a normal tab navigation in your CellTable.
Disabling KeyboardSelectionPolicy may not work on all views, if you are using any MVP frameworks. GWT selects the cell instead of the input field within the cell.
Here is a solution which I used in my applications: Adding TAB control to GWT CellTable
the solution from Ben Imp works fine if you dont change the value of the cell, but if you change the value and try to navigate with tab to the next cell it lost focus and starts with the first element of the view. I have not found a solution for this inappropriate behaviour.
For those looking at this in the future trying to figure out how to have tabbing while changing values, do what the Ben Imp suggests then also in your custom components remove any reference to super.finishEditing. In some cases this means overriding finishEditing and having it do nothing.

UITextField: Text Entered Programmatically but not Visible in the Text Field

I have a weird behaviour that has only shown up in the last week. I don't use IB, all the controls are created in code.
I have a text field with a keyboard active. The first time I load the text field and use the keyboard, everything works normally. The second time I use it, the typed text does not show in the text field. However, the text is in the text field programmatically. For example, I can use it to execute a search. When the keyboard closes, the text appears.
Some of my UITextFields have misaligned text. For example, I write "hello", and instead of displaying centered inside the field like normal, it displays shifted several pixels downward to the extent that the bottom of the text is cut off. It's almost as if another view is chopping the bottom off the text by obscuring it.
I use three20, but according to http://groups.google.com/group/three20/browse_thread/thread/d7c4bc1ee2f9590d#, Xcode is suspected of causing the problem. I seen the behavior on 2 diferent macs, one running with Snow Leopard (10.6) and the other with Leopard (10.5).
This is how the problem looks in Xcode:
It is not obvious, but there is text in that search field. Notice that the placeholder text is not show. However, if I hit Search, the code executes with the entered text.
This is how the app appears in the simulator:
I finally find the reason.
I call [textField becomeFirstResponder] in a function called from loadView. But I move it to viewDidAppear and everything work Ok...
I've seen that happen with text fields and affine transforms. If you rotate a text field using a transform, the text shows up in a seemingly random part of the superview. If you use a transform to move the text field to make room for the keyboard, you might be seperating the embedded text editor from the field itself. That would also explain why the text is in the code because the text attribute of the text field is not affected by the visual layout of the UI.