Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Requested: Simple JSF example for ASP.NET developers

Reply
Thread Tools

Requested: Simple JSF example for ASP.NET developers

 
 
tomjbr.41840400@bloglines.com
Guest
Posts: n/a
 
      03-06-2007
Is it possible with JSF to define what method that should execute when
a button is clicked, and then from that method get values from the
form (without using a request object), and then set values to the
generated page ?

For those who understand some basic ASP.NET, the following kind of
code example is what I would like to see for JSF.


<html>
<body>
<form runat="server">
Enter your name:
<asp:TextBox id="txt1" runat="server" />

<asp:Button OnClick="myMethod" Text="Submit" runat="server" />

<p><asp:Label id="lbl1" runat="server" /></p>
</form>
</body>
</html>

<script runat="server">
Sub myMethod(sender As Object, e As EventArgs)
lbl1.Text="Your name is " & txt1.Text
End Sub
</script>


Here are the relevant ASP.NET parts I am interested in and would like
to see for JSF:
Here we define a method named "myMethod" which will execute when the
button is clicked.
<asp:Button OnClick="myMethod" ... />
And here is the implementation of the VB.NET method:
(the name of the method could be chosen, for example "myMethod" while
the parameters are prefined by ASP.NET)
Sub myMethod(sender As Object, e As EventArgs)
' here we do a "get" and a "set":
' "lbl1.Text=..." is a "set" and the "txt1.Text" is a "get"
lbl1.Text="Your name is " & txt1.Text '
End Sub

How do you do this in JSF ?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wanted Java Developers/Senior Java Developers in Bangalore pacwestsoftware@gmail.com Java 0 12-07-2007 11:35 AM
Include JSF page within another JSF page BlackIce Java 1 07-05-2006 11:24 PM
JSF debugging / JSF newsgroup Sebastian Fey Java 1 04-07-2006 08:52 PM
[JSF]Need to deploy a jsf application on SunApplicationServer. dudu Java 0 03-03-2006 12:09 PM
Java Architects / Sr. developers / Developers smanojs@yahoo.com Java 1 01-02-2005 05:04 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57