Vaadin How to SelectAll() in ComboBox field? - vaadin

Vaadin 7.6.2
What's the best approach to performing a selectAll() in ComboBox field?

If you mean selecting all text in the input field of a ComboBox, there is no a build-in support for that.
The most elegant solution would be to create your own Vaadin extension, which would provide server-side API for selecting text in a ComboBox.
The easiest but a bit hackish solution is to defined a unique id for your ComboBox:
comboBox.setId("my-combobox");
and use the JavaScript API of Vaadin to execute a JavaScript snippet that selects text on client side:
JavaScript.eval("setTimeout(function() { document.getElementById('my-combobox').firstChild.select(); }, 0);");
I tested this quickly, and it seemed to work in Chrome, Safari and Firefox at least.

Related

How to show Find/Replace Dialog on SpreadsheetGear workbook?

How can I show from code SpreadsheetGear dialogs like Find/Replace?
There is WorkbookDesigner form which has most of those dialogs in main menu, but how can I implement it myself?
The "Find and Replace" dialog is not part of SpreadsheetGear's public API and so cannot be instantiated from code. Developers using Windows Forms have been able to "hack" this since a keyboard shortcut does exist to launch this dialog from the WinForms WorkbookView. This has been done by sending a Ctrl+F keystroke to the WorkbookView, using something like the following:
workbookView.Focus();
System.Windows.Forms.SendKeys.Send("^f");
WPF doesn't support this model since it is part of Windows Forms. However, it appears that using System.Windows.Forms.SendKeys.SendWait("^f") might work instead, but I make no guarantees of this.
Generally speaking, if a particular "dialog", such as the Find and Replace dialog, is not listed in the SpreadsheetGear.Windows.Forms namespace, then it is not available to instantiate from code.

Hightlighting a particular text dynamically on the screen using smartGwt

I Have an implemented a search screen , like hows it done in the windows but im not able to highlight the text for which search was made.
i tried to use window.find () but its not available in smartgwt
If I were with such request I would probably go for a jsni function and some sort of code like this one..... or using javaScript text higlighting jQuery plugin. I don't think there is neither in gwt or smartgwt such a feature...

jquery datepicker on windows phone not selecting the date

When selecting the date in the standard JQuery datepicker on a Windows 7 phone i found that the date doesn't select for me and the field doesn't fill in the date. This feature works on all other tested devices including (of course the standard desktop) iTouch, iPad and Android. It almost acts like the dom object is not triggering when the datepicker is selected sometimes causing a text field behind the control to take focus. I did manage to get the timepicker (http://fgelinas.com/code/timepicker/) work but not the datepicker.
Has anyone experienced this and found a fix? Thanks in advance for your help!
DateBox has a ton of options and it's built for jQM:
http://dev.jtsage.com/jQM-DateBox/
try to use this line of code :
document.getElementById('container div of datepicker').innerHTML = document.getElementById('container div of datepicker').innerHTML
it seems like crazy and unbeliveable but it works with me

Cannot type into an editor in a xul panel

the Cannot type into an editor in a xul panel is a known bug in firefox.
I simply want to reuse my code from my google chrome extension by hosting a webapp online and including it in the extension both google chrome and firefox by using a popup window.
This is how I include the webapp
<popupset id="mainPopupSet">
<menupopup id="smsflatrate-popup">
<iframe height="500px" src="http://webapp.mysite.net/"
flex="1" type="content-primary"/>
</menupopup>
</popupset>
The problem is, it is possible to focus input elements but the input fields do not react on key-events, so no input can be provided.
It seems that there is some kind of solution for this problem, but I think I do not really understand what to do here.
E.g. from the link above, what would be a solution according to this post?
There are many ways to display HTML in a XUL UI:
1) including HTML inline in the XUL document. This should work fine everywhere,
including in panels.
2) include an HTML IFRAME in the XUL document. This currently works fine
everywhere, except that IF the iframe is in a panel, there are some problems
with focus. This bug is about that one issue.
3) instead of a panel, you can create a XUL window using window.open that
contains HTML inline or in an IFRAME, and everything should work.
Having said that, if I open this bug's testcase in a Firefox trunk build, I
*can* tab into the textbox and type into it, so it looks like focus is
basically working now? The problem is that I can't focus the textbox by
clicking on it. In fact, if you click on the arrow to do a search, you navigate
to a new page where there is a textbox that you *can* click to focus.
So I think we have here just some simple bug that's preventing click-to-focus
from working, sometimes. Enn, can you look into that?
It seems to me that given the list of suggestions your best choice is to open a new window to represent your popup. You can make it look like a popup by setting its position, turning off OS crhome, etc.

Adding an RTE to salesforce text areas

Does anyone know if there's a way to add an RTE to textarea fields within salesforce? I'm fairly new to the platform but i haven't been able to find any useful documentation on this.
In addition to the component, there's also an example of integrating the open source FckEditor component into Visualforce here:
http://blog.sforce.com/sforce/2009/05/a-rich-editor-component-for-visualforce.html
If you're using VisualForce, you can use the inputTextArea tag to edit/save rich text. Set the "richText" attribute to true.

Resources