Editable datefield focus issue in iexplorer - actionscript-3

I have one textinput and beside that there is datefield which is editable="true".
Now, when i enter something in textinput and press tab then it focus on datefield but, not remove focus from <s:TextInput.
This happens only in internet explorer. Not any other browser having that issue.
I have just simple textinput and datefield.
<s:TextInput width="100" />
<mx:DateField width="100" editable="true" selectedDate="{new Date()}" />

Change that editable part to false and you are good to go , try listening to tab event (Keyboard and then change the focus)

Related

How to change label length on AS3 checkbox?

I have a checkbox label that needs to be about 50 characters long, but it's being truncated at 13 characters.
How do I code it to allow longer text in the label please?
Thank you
You can follow two different ways:
The first: Try in your checkBox (s: or mx:) to increase the width property
<s:CheckBox id="myChk" width="100" />
<mx:CheckBox id="myChk" width="100" />
The second: You can wrap your checkbox in a FormItem (s: or mx:) so, you can manage the width of FormItem and your checkbox manage only the tick select.
<s:FormItem id="myItem" label="AAAAAAAAAAAAAAAAAAAAAAAAAAAAA">
<s:CheckBox id="myChk" />
</s:FormItem>

How to focus a paper-input with Polymer 1.9.1?

I need to focus paper input in a paper dialog box. I have tried all available solution but nothing is working.
this.$.homeSearch.$.input.focus();
this is my markaup
<paper-input id="homeSearch" class="home-search-btn" placeholder="Where do you want to go?" no-label-float value="{{searchText}}">
</paper-input>
I don't want autofocus when page load. I need to fire focus event from a method.
Instead of
this.$.homeSearch.$.input.focus();
, you can do
this.$.homeSearch.focus();
instead. paper-input inherits from HTMLElement by default so it already has a focus method built-in.

PrimeFaces - weird event handlers after added overlaypanel to inputText

I have form with input field:
<p:inputText id="M25BRAN" value="#{bean.value}" />
When user press "ENTER" form is submitted.
But after I added overlay panel (it is shown programmatically by a JS script function - onmousemove):
<p:overlayPanel id="M25BRAN_overlaypanel" widgetVar="M25BRAN_overlay_panel" for="M25BRAN" showEvent="null" hideEvent="null">
<h:outputText value="#{bean.memoText}" />
</p:overlayPanel>
When user press "ENTER", the small and empty overlaypanel is shown (small white rectangle). I am suspecting that this is the reason (red border):
http://s1.postimg.org/6u1mtn9fz/ovp.png
But I don't know why PF bunds this additional event handlers (onkey up/down). They are present only if overlaypanel is bound to component. How can I disable this additional events?

Submit form with primefaces widgets on enter

I need to have my primefaces p:commandLink submit a h:form when the user presses the enter key.
I tried the solutions suggested here and in a couple of other places. I also tried the primefaces defaultCommand. No matter what I try, the browser seems to notice the button press, but the action is not performed.
These are my form's widgets:
<p:autoComplete id="acSimple" value="#{home.searchKeywords}" completeMethod="#{home.completeText}" style="" />
<p:commandLink id="srchbutton" action="#{home.goToSearchResults}" onclick=" $('.prgrs').show();">
<h:graphicImage id="srch" name="images/searchbutton.jpg" class="img-responsive" style="display: inline-block; margin-left:0px; margin-bottom:-0px;" />
</p:commandLink>
<p:defaultCommand target="srchbutton" />
<h:form onkeypress="if (event.keyCode == 13) { document.getElementById('form:srchbutton').click(); return false; }">
Make sure your real id of link is "form:srchbutton" or put whatever it is.
You can use developer tools or firebug to find it out.
Dijana's solution is right, but the action onkeyup should be used and not onkeypress.
ENTER is an action event so it will not be caught by onkeypress which captures basic and meta characters.
So you need onkeydown (which can cause problems if ENTER is down even after the next page loads) or onkeyup.

primefaces select tab when button is clicked

I assume this is a rather simple issue, but I'm very new to Primefaces. I have a form that's including a few Primefaces tabs. Naturally I can view each tab when I click on it, but I'm looking for a way to go to a certain tab when a commandButton is clicked. Is there any way to do this?
Basically I'm looking for something like:
<h:commandButton value="Submit"
onclick="<open a certain tab>"
action="#{doSomeJavaWork}"
update=":main_tabs:some_form" />
Thanks!
<h:commandButton ... onclick="tabViewWidgetVar.selectTab(2);" .../>