-
1. Re: Enter Key press Event on <a4j:support>
boy18nj Aug 25, 2010 10:19 PM (in response to rajendra85)It seems your onsubmit javascript code has syntax problem, write the same code as a javascript function like function dofocus() and then call that function.
-
2. Re: Enter Key press Event on <a4j:support>
rajendra85 Aug 26, 2010 12:49 AM (in response to rajendra85)Click HELP for text formatting instructions. Then edit this text and check the preview.
hi
`<html>
<head>
<title>Hello</title>
<script type="text/javascript" language="javascript">
function chk(ev) {
var key;
ev = ev || event;
if (ev.keyCode == 13 || ev.which==13) {
var val = document.getElementById("mainForm:textfield").value;
alert ("You pressed the Enter key\nYou have entered " + val);
}
}
</script>
</head>
<body>
<f:view>
<h:form id="mainForm">
<h:outputText id = "otfield" value="Enter date"/>
<h:inputText id = "textfield" size = "20" onkeypress = "chk(event)">
<a:support event="onkeypress"
action="#{user.changeValue}"
reRender="textfield"
id="okp">
</a:support>
</h:inputText>
</h:form>
</f:view>
</body>
</html>`
Hi guys,
I have tried the above code for normal java script function and Im getting Alert message
so I can able to get the enterKeypress event but Im not able to get the ajax function call...
function chk(ev) : will work fine but Im unable to call the java method; it is not working can anybody know how to call action method after enterkeypress event..can anybody get me the code...?
Please its an urgent requirement for me
Thanks in advance..
"" -
3. Re: Enter Key press Event on <a4j:support>
raphaufrj Aug 26, 2010 8:36 PM (in response to rajendra85) -
4. Re: Enter Key press Event on <a4j:support>
rajendra85 Aug 27, 2010 7:37 AM (in response to rajendra85)Click HELP for text formatting instructions. Then edit this text and check the preview.
I got the solution i tried this code its working fine its calling the java method after enter key press and able to display the formatted text in the console; but i am not able to render the formatted text into the JSF page; when close the browser and opens again i am able to get the formatted text into the text field I think the JSF page is not refreshing;Its not able to reRender the value into the JSF page
Can anybody help me in this.
Can anybody help me in this.and I am pasting the code that i have used!!!!Its working as metioned above.....
<body> <f:view> <h:form id="mainForm"> <h:inputText value="#{user.dateEntered}" id="t1"> <a:support event="onkeyup" action="#{user.changeValue}" onsubmit="if (event.keyCode != 13) { return false; }" reRender="t1" /> </h:inputText> </h:form> </f:view> </body>
-
5. Re: Enter Key press Event on <a4j:support>
rajendra85 Aug 30, 2010 8:14 AM (in response to rajendra85)Click HELP for text formatting instructions. Then edit this text and check the preview.
I have got the solution for this topic can anybody struggle on this plaese see the below link I have attached code;
-
6. Re: Enter Key press Event on <a4j:support>
rajendra85 Aug 30, 2010 8:15 AM (in response to rajendra85)
Rajendra J wrote on Aug 30, 2010 08:14:
Click HELP for text formatting instructions. Then edit this text and check the preview.
I have got the solution for this topic can anybody struggle on this plaese see the below link I have attached code; Click on : MyLink
My LinkClick HELP for text formatting instructions. Then edit this text and check the preview.
-
7. Re: Enter Key press Event on <a4j:support>
rajendra85 Aug 30, 2010 8:16 AM (in response to rajendra85)I have got the solution for this topic can anybody struggle on this plaese see the below link I have attached code; Click on : MyLink
-
8. Re: Enter Key press Event on <a4j:support>
rajendra85 Aug 30, 2010 8:17 AM (in response to rajendra85)
Rajendra J wrote on Aug 30, 2010 08:16:
I have got the solution for this topic can anybody struggle on this plaese see the below link I have attached code; Click on : MyLink
Finally those who responded this topic or issue I am thankful to everyone.
My LinkClick HELP for text formatting instructions. Then edit this text and check the preview.
-
9. Re: Enter Key press Event on <a4j:support>
rajendra85 Aug 30, 2010 8:18 AM (in response to rajendra85)I have got the solution for this topic can anybody struggle on this plaese see the below link I have attached code; Click on : MyLink
Finally those who responded this topic or issue I am thankful to everyone.
-
10. Re: Enter Key press Event on <a4j:support>
rajendra85 Aug 30, 2010 8:19 AM (in response to rajendra85)