Re: How to pass a variable from Javascript code to Java

[email protected]
Newsgroups gmane.comp.java.tapestry.user
Message-ID <[email protected]>
Hi Marwa,

there is an example in the bottom part of this page

https://tapestry.apache.org/ajax-and-zones.html

which you can use for your development. The paragraph "Invoking server-side event
handler methods from JavaScript" contains the corresponding explanation.

If you do not want to use zones and asynchronous requests, you cat use a hidden field
to transfer the value to java.
The hidden field hast to be contained in a form. You put the value with java script in
the hidden field. With a form submit it will be transferred to java.

Sorry that I am not referencing to an example, but possibly you manage it even with
this information..

With regards, Peter


> Thanks for your replay but actually I scanned all the links and I couldn't
> find an answer for my issue... Let me explain it in more details ..in the
> .tml code I have this line
> <p>Name: <span id="name"></span></p>
> and in the javascript code, there is a function that calculates the "name"
> for this element and another that creates a link containing the name of
> this element to be displayed as a link.
>
> function appendIriLabel(element, name, iri) {
> var tag;
> if (iri) {
> tag = element.append("a")
> .attr("href", iri)
> .attr("title", iri)
> .attr("target", "_blank");
> } else {
> tag = element.append("span");
> }
> tag.text(name);
> }
>
> and what I need is to pass the string variable "name" from the client side
> javascriptcode, to the java code in order to use it in the server side
> functions.
> How to make this?
>
> Hope I could illustrate my problem well ...
>
>
> On Sun, Aug 26, 2018 at 12:00 PM Basile Chandesris <[email protected]> wrote:
>
>> Le 25/08/2018 à 08:32, marwa hussein a écrit :
>> > Hello, I am building a web application and I have to use an open source
>> > Javascript package that is responsible for the visualization tasks. Now,
>> I
>> > need to pass a "string variable" from the javascript code to the java
>> > code?? how to do this in tapestry5 ..Please refer me to a working example
>> > if you can!!
>> >
>> >
>>
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/javascript
>>
>> https://tapestry.apache.org/legacy-javascript.html
>>
>> https://tapestry.apache.org/javascript.html
>>
>>
>>
>> http://tapestry5-jquery.com/
>>
>> https://github.com/ffacon/tapestry5-angular-demo
>>
>> https://github.com/eddyson-de/tapestry-react
>>
>> https://tapestry.apache.org/coffeescript.html
>>
>>
>>
>>
>
> --
>
>
>
> *Marwa Hussein M. TA @ Information Systems Department Faculty of Computers
> & Information Assuit University*
> <[email protected]>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.