You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by ke...@sz.murata.com.cn on 2010/07/06 03:27:43 UTC
how to set function key in TextInput
Hi All,
I would like set the how to set function key "Ctrl + S" in the TextInput.
How can do that.is it implements ComponentKeyListener?
On the other hand,TextInput already include the function for "Ctrl+V" and
"Ctrl+C"?
Which source file I can ref it?
Many thanks.
Best regards,
Ken Jiang
*******************************************
Murata Electronics Trading (Shenzhen) Co.,Ltd
Tel:86-755-82847251
E-mail:kenjiang@sz.murata.com.cn
*******************************************
Re: how to set function key in TextInput
Posted by Greg Brown <gk...@mac.com>.
> 1.How applet (javascript in html) pass parameter to Pivot?How to Piovt get
> the parameter(Map<String, String> properties?)
You can pass initial startup properties to the application via an applet <param> tag:
<param name="startup_properties" value="foo=abc&bar=123">
These values will be passed to the applications's startup() method in the properties argument.
If you want to pass information dynamically, you can see the DOM Interaction demo for an example:
http://pivot.apache.org/demos/dom-interaction.html
The application defines a sayHello() method that is called by JavaScript. It also calls out to a JavaScript function in the page using the BrowserApplicationContext.eval() method:
http://svn.apache.org/repos/asf/pivot/trunk/demos/src/org/apache/pivot/demos/dom/DOMInteractionDemo.java
The relevant script looks like this:
<script type="text/javascript">
// This function will be called by Pivot
function sayHello(helloText) {
alert(helloText);
}
// This function will call into Pivot
function onHelloButtonClick() {
var applet = document.getElementById("applet");
applet.getApplication().sayHello("Hello from JavaScript!");
}
</script>
> 2.is there any example for QueryServlet? especially for post TableView data
> to server side and how QueryServlet parse the JSON?
A QueryServlet example will be included in Pivot 1.5.1 along with a tutorial example. However, you can see it here for now:
http://svn.apache.org/repos/asf/pivot/branches/1.5.x/tutorials-server/src/org/apache/pivot/tutorials/webqueries/server/
The client application is here:
http://svn.apache.org/repos/asf/pivot/branches/1.5.x/tutorials/src/org/apache/pivot/tutorials/webqueries/
It simulates a simple expense management system.
Re: how to set function key in TextInput
Posted by ke...@sz.murata.com.cn.
Hi Greg,
Great example.
Do you have any example for below topic:
1.How applet (javascript in html) pass parameter to Pivot?How to Piovt get
the parameter(Map<String, String> properties?)
2.is there any example for QueryServlet? especially for post TableView data
to server side and how QueryServlet parse the JSON?
Many thanks.
Best regards,
Ken Jiang
*******************************************
Murata Electronics Trading (Shenzhen) Co.,Ltd
Tel:86-755-82847251
E-mail:kenjiang@sz.murata.com.cn
*******************************************
From: Greg Brown <gk...@mac.com>
To: user@pivot.apache.org
Date: 07/07/2010 02:16
Subject: Re: how to set function key in TextInput
Hi Ken,
I just created a new "examples" project and added an example of using
ComponentKeyListener to process keystrokes:
http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/keyboard/
It includes examples of handling keyPressed() events in Java and
JavaScript.
Hope this helps.
Greg
On Jul 5, 2010, at 9:27 PM, kenjiang@sz.murata.com.cn wrote:
>
> Hi All,
>
> I would like set the how to set function key "Ctrl + S" in the
TextInput.
> How can do that.is it implements ComponentKeyListener?
> On the other hand,TextInput already include the function for "Ctrl+V" and
> "Ctrl+C"?
> Which source file I can ref it?
> Many thanks.
>
>
>
>
> Best regards,
> Ken Jiang
>
> *******************************************
> Murata Electronics Trading (Shenzhen) Co.,Ltd
> Tel:86-755-82847251
> E-mail:kenjiang@sz.murata.com.cn
> *******************************************
>
Re: how to set function key in TextInput
Posted by Greg Brown <gk...@mac.com>.
Hi Ken,
I just created a new "examples" project and added an example of using ComponentKeyListener to process keystrokes:
http://svn.apache.org/repos/asf/pivot/trunk/examples/src/org/apache/pivot/examples/keyboard/
It includes examples of handling keyPressed() events in Java and JavaScript.
Hope this helps.
Greg
On Jul 5, 2010, at 9:27 PM, kenjiang@sz.murata.com.cn wrote:
>
> Hi All,
>
> I would like set the how to set function key "Ctrl + S" in the TextInput.
> How can do that.is it implements ComponentKeyListener?
> On the other hand,TextInput already include the function for "Ctrl+V" and
> "Ctrl+C"?
> Which source file I can ref it?
> Many thanks.
>
>
>
>
> Best regards,
> Ken Jiang
>
> *******************************************
> Murata Electronics Trading (Shenzhen) Co.,Ltd
> Tel:86-755-82847251
> E-mail:kenjiang@sz.murata.com.cn
> *******************************************
>