HTML Form-like behavior in Flash

Hello,
I'm looking to find a reference that can help me in the
creation of Flash user input screens that behave in a manner
analogous to an HTML form. Specifically I'm concerned with error
checking and data validation. For example, if a user is creating a
new record or editing an existing record and they choose to
navigate away from the page, the code should check for data
changes, and on finding any offer the user an option to save the
data. Once the offer is made and responded to the flow of the
application should proceed appropriately.
In an HTML form this type of behavior would be accomplished
with an appropriately worded JavaScript "confirm" dialog. This
dialog allows for a synchronous interaction between the user and
the flow of the JavaScript code in which user choice results in how
the code flow proceeds. With Flash, such a synchronous event is not
inherently possible (to the best of my admittedly limited
experience). Without this type of "confirm" dialog, one must create
a custom messaging system to communicate with the user, and must
also structure the code in such a way that everything is able to
achieve the desired effects in an asynchronous manner.
I've tried searching this forum but I don't know how to
phrase my search in order to find good results. If anyone has any
ideas, links to resources, links to threads, or any other items
that might help in my quest to build fully optimized and robust
user input forms in Flash CS3, I'd really appreciate the help.
Thanks in advance for any advice!
Regards,
Dave

Why not just use a DataGrid component? They're pretty easy to
use actually.
Try this: start a new AS2 project and drag a DataGrid from
the components
panel onto the stage. Use the properties panel to size it to
500 x 300. When
you add data to a grid it will just show a scroll bar if
necessary, it
doesn't resize... Give it an instance name of "theGrid".
Now, add the following script to the frame:
import mx.controls.gridclasses.DataGridColumn;
function doGrid(gridRef, gArray:Array)
for (var i = 0; i < gArray.length; i++) {
var cat:DataGridColumn = new DataGridColumn(gArray
[0]);
cat.width = gArray[2];
cat.headerText = gArray
[1];
cat.editable = false;
gridRef.addColumn(cat);
var gFormat = new Array(["fname", "First Name:", 120],
["lname", "Last
Name:", 200], ["date", "Win Date:", 80]);
doGrid(theGrid, gFormat);
If you compile now, you'll see the grid with the field
titles... I use the
doGrid function, and an array like this to make formatting
the grid easy.
The first item in the array matches the dataProvider
property, as you will
see in a moment - the second is the title, and the third the
width of the
column... change these as you need.
To add data, you just create an array of objects, with the
object properties
matching the first item in the format array - like so - add
the following
and test again:
var gridData = new Array({fname:"Dave", lname:"Mennenoh",
date:"09/14/08"},
{fname:"giga", lname:"saurus", date:"10/14/08"});
theGrid.dataProvider = gridData;
That's all there is to it... If you add more data than can be
shown, you'll
get a scroll bar. You can add en event listener to know when
someone selects
an item, etc...
good luck
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

Similar Messages

  • Table-like behavior in flash

    I have an app I've built for a client that displays a bunch
    of dynamic data in a table-like grid. This is currently a "top 10"
    that shows details of the top-10 winners of a contest. The client
    has now said that under certain circumstances this "top 10" display
    grid will now need to display a table of dynamic data of
    undetermined height (That is it could be a "top 30" or a "top
    100"). So firstly I imagine the data will need to be embedded in a
    scrollable movie-clip that adjusts its height based on the amount
    of data there is. I was disappointed to learn flash html does not
    support tables. I've seen reference to some components available,
    but they all seem sort of like a big jump for something the client
    sees as a minor change to the application. Could someone please
    help me determine what is the easiest route for me to take?

    Why not just use a DataGrid component? They're pretty easy to
    use actually.
    Try this: start a new AS2 project and drag a DataGrid from
    the components
    panel onto the stage. Use the properties panel to size it to
    500 x 300. When
    you add data to a grid it will just show a scroll bar if
    necessary, it
    doesn't resize... Give it an instance name of "theGrid".
    Now, add the following script to the frame:
    import mx.controls.gridclasses.DataGridColumn;
    function doGrid(gridRef, gArray:Array)
    for (var i = 0; i < gArray.length; i++) {
    var cat:DataGridColumn = new DataGridColumn(gArray
    [0]);
    cat.width = gArray[2];
    cat.headerText = gArray
    [1];
    cat.editable = false;
    gridRef.addColumn(cat);
    var gFormat = new Array(["fname", "First Name:", 120],
    ["lname", "Last
    Name:", 200], ["date", "Win Date:", 80]);
    doGrid(theGrid, gFormat);
    If you compile now, you'll see the grid with the field
    titles... I use the
    doGrid function, and an array like this to make formatting
    the grid easy.
    The first item in the array matches the dataProvider
    property, as you will
    see in a moment - the second is the title, and the third the
    width of the
    column... change these as you need.
    To add data, you just create an array of objects, with the
    object properties
    matching the first item in the format array - like so - add
    the following
    and test again:
    var gridData = new Array({fname:"Dave", lname:"Mennenoh",
    date:"09/14/08"},
    {fname:"giga", lname:"saurus", date:"10/14/08"});
    theGrid.dataProvider = gridData;
    That's all there is to it... If you add more data than can be
    shown, you'll
    get a scroll bar. You can add en event listener to know when
    someone selects
    an item, etc...
    good luck
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Buliding a SELECT in PSP using fields from html form

    Hi everyone, first of all forgive me my poor english.
    I'm making "CV Base" in PSP as a school project. And I've got a search html form like this (simple version):
    select list: Profession
    text field: Age
    And my question is... How to build a select in psp which will parse only given parameters? For example. I'm looking for C Programmer in any age so i select C Pogrammer from the list and leave afe field blank. So the SELECT should be sth like this: select * from Person where Profession like 'C Programmer'; But in another search i need a programmer who is 25 years old... So select has one more WHERE... I'm sure You all know what I mean
    Please help me.
    Martin

    Hey, i wanna open cursor and don't know how to do this. Got this:
    <%@ plsql parameter="f_wyk" type="varchar2" default="NULL" %>
    <%! sel_str varchar2(1000) := 'SELECT imie, nazwisko, wiek, ulica, nr_domu, nr_lokalu, kod_pocz, miasto, nazwa_woj FROM Uczelnia ucz, Stanowisko stan, Jezyk jez, Wojewodztwo woj, Wyksztalcenie wyk, Adres adr, Osoba os, os_wyk ow, os_jez oj, os_sta ost, os_ucz ou WHERE nazwa_wyk LIKE :1 ...
    <% OPEN cur FOR sel_str USING 'pod%'; %>
    <% LOOP %>
    <% FETCH cur INTO rosoba; %>
    <% EXIT WHEN cur%NOTFOUND; %>
    <%= rosoba.imie %>
    <% END LOOP; %>
    <% CLOSE cur; %>
    and when i put <% OPEN cur FOR sel_str USING *'pod%'; %>* it works but i'cant use parameter <% OPEN cur FOR sel_str USING *<%=f_wyk%>*; %>
    I have
    Projekt\psp>loadpsp -replace -user system/system szukaj2.psp
    ORA-20006: "szukaj2.psp": compilation failed with the following errors.
    "szukaj2.psp", line 100, pos 31: PLS-00103: Encountered the symbol "<" when expecting one of the following:
    ( - + case in mod new not null out <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternatively-q
    please help

  • Flash navigation and HTML forms

    Wondering if any one can help. Whenever I use an html form on
    an html page, my flash navigation will not show up. The area where
    it should be is blank and my browser status bar says that there are
    two items remaining (my flash navs). The browser stays like this
    indefinately, not completely loading the page.
    Any suggestions ?
    Thanks,
    Elise

    Thank you for reply. I appreciate it. So, if I understand
    correctly:
    I would embed the navbar.swf in all my html files. Then Each
    button would go to each html pages (Like page1.htm page2.htm
    etc...) Then I use your code in my html file right? Like each html
    file will have the following code:
    <param name="movie" value="nav.swf?frame=page2">
    Is that how it works. Sorry for not being able to your
    answer.
    Thank you very much again

  • Modify flash movie from HTML form

    so here is what I have:
    I have a flash movie and as the flash movie plays there are
    elements that say things like, "Your company name here" or "Your
    title here", or "Your Product Picture here" etc.
    From an HTML form (I can do all this part) I would want
    someone to be able to specify their customized information and
    SOMEHOW that would end up in the Flash movie. I would like to know
    whether I need special software to create these. I ultimately need
    have the final product be a .swf with the form-entered information
    like Company Name, etc.
    I don't know what I need in order to do this. I'm basically
    info-gathering. Ask any questions if I am leaving anything out that
    might help you help me identify what we need.
    Thanks in advance.

    no. none from me. i honestly dont have the first clue

  • HTML form over Flash bkd in Safari

    Hi, I've got a site which uses an animated Flash background
    element which is overlayed with a div containing an HTML form. It
    works fine in every browser I have, except Safari. In Safari, as
    soon as I click in the form, the entire HTML content of the page
    disappears. The form and links will still function, but are
    invisible.
    Does anyone know about this problem? Is there a workaround,
    or am I doing something wrong?
    The page is
    here.
    Please note that the site is in a pretty early stage of
    development, and not a lot of it works, but at least it
    demonstrates the Safari problem.
    Thanks!
    Michael

    i got someone to check on safari if their browser needed
    updating for the flash plug-in but it didnt, still no luck with
    this... I think I will try a few things and see what happens, any
    other ideas though, I really can't explain why its doing
    this?

  • Re-build HTML Form in Flash?

    Hi
    Wonder if someone can help. Please excuse my incompetence, I am fairly new to Flash / Actionscript
    Basically I am trying to re-build this simple HTML form in Flash, I have not shown the actual URL here, but this is a functioning form when the correct URL is in place:
    <form action="http://www.customersURLhere/" method="post">
      <input type="text" name="vrm"/>
      <input type="submit" value="go"/>
      <input type="hidden" name="update" value="false"/>
      <input type="hidden" name="source" value="aexp"/>
      <input type="hidden" name="supplier" value="AEMP" />
    </form>
    I have attempted to re-build this in flash. I have 1 text input field which I have set the variable name to 'vrm' to match the input field above. I then created a basic flash button and set the following action:
    on (release) {update = "false";source = "aexp";
    supplier = "AEMP";
    getURL ("http://www.customersURLhere", "", "POST");
    Can anyone spot any obvious errors???
    Any help would really be appreciated.

    Thanks for your help.
    Unfortunately I am still struggling to get this to work.
    I have applied your script to the button, is that correct? (The button is on it's own layer and has one keyframe at the start or the movie.)
    Do I need to label/name the button 'submitBtn' in some way?
    You added a comment '//do whatever'... do I need to add something here?
    Sorry, I'm a complete novice!!

  • How to download a mail from pop3 server to an HTML Form

    Hi Friends,
    i want to download the Mails from a POP3 server using an Html
    Interface.I mean not from command Line.
    I have designed an interface that will send emails to Recipients,
    but i didn't get any idea about how to download the mails to an interface like a HTML Form.
    if any body know the answer post the replay with the code snipnet
    Nagaraju G.

    In Mail's Accounts/Mailbox Behavior preference pane make sure these 4 checkboxes are NOT checked:
    OT

  • Update XML files with HTML forms...

    Hi,
    I would like to know if its possible to update or insert data
    to XML files from a HTML form? And how can I do it?
    Does dreamweaver have any extension that does this?

    hi bregent!
    im using php.
    i have a xml flash slide show script, and i want to insert
    this slide show on a site. No problem here, but i would like to
    create a backoffice were i can update or insert the pictures of the
    xml slide show.
    can you help me on this?

  • How can an applet retrieve the values of a HTML form shown in a JEditorPane

    Hi,
    I'm doing an applet that contains a JTree and a JEditorPane
    among other components. Each node of the JTree represents some
    information that is stored in a database, and whenever a JTree
    node is selected, this information is recovered and shown in
    the JEditorPane with a html form. To make the html form,
    the applet calls a servlet, which retrieves the information of
    the node selected from the database. This information is stored
    like a XML string, and using XSLT, the servlet sends the html
    form to the applet, which shows it in the JEditorPane.
    My problem is that I don't know how I can recover new values
    that a user of the application can introduce in the input fields
    of the html form. I need to recover this new values and send them
    to another servlet which store the information in the database.
    If someone could help me I'd be very pleased.
    Eduardo

    At least I found a fantastic example. Here it is:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    public class FormSubmission extends JApplet {
    private final static String FORM_TEXT = "<html><head></head><body><h1>Formulario</h1>"
    + "<form action=\"\" method=\"get\"><table><tr><td>Nombre:</td>"
    + "<td><input name=\"Nombre\" type=\"text\" value=\"James T.\"></td>"
    + "</tr><tr><td>Apellido:</td>"
    + "<td><input name=\"Apellido\" type=\"text\" value=\"Kirk\"></td>"
    + "</tr><tr><td>Cargo:</td>"
    + "<td><select name=\"Cargo\"><option>Captain<option>Comandante<option>General</select></td>"
    + "</tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Enviar\"></td>"
    + "</tr></table></form></body></html>";
    protected HashMap radioGroups = new HashMap();
    private Vector v = new Vector();
    public FormSubmission() {
    getContentPane().setLayout(new BorderLayout());
    JEditorPane editorPane = new JEditorPane();
    editorPane.setEditable(false);
    editorPane.setEditorKit(new HTMLEditorKit()
    public ViewFactory getViewFactory() {
    return new HTMLEditorKit.HTMLFactory() {
    public View create(Element elem) {
    Object o = elem.getAttributes().getAttribute(javax.swing.text.StyleConstants.NameAttribute);
    if (o instanceof HTML.Tag)
    HTML.Tag kind = (HTML.Tag) o;
    if (kind == HTML.Tag.INPUT || kind == HTML.Tag.SELECT || kind == HTML.Tag.TEXTAREA)
    return new FormView(elem)
    protected void submitData(String data)
    showData(data);
    protected void imageSubmit(String data)
    showData(data);
    // Workaround f�r Bug #4529702
    protected Component createComponent()
    if (getElement().getName().equals("input") &&
    getElement().getAttributes().getAttribute(HTML.Attribute.TYPE).equals("radio"))
    String name = (String) getElement().getAttributes().getAttribute(HTML.Attribute.NAME);
    if (radioGroups.get(name) == null)
    radioGroups.put(name, new ButtonGroup());
    ((JToggleButton.ToggleButtonModel) getElement().getAttributes().getAttribute(StyleConstants.ModelAttribute)).setGroup((ButtonGroup) radioGroups.get(name));
    JComponent comp = (JComponent) super.createComponent();
    // Peque�a mejora visual
    comp.setOpaque(false);
    return comp;
    return super.create(elem);
    //editorPane.setText(FORM_TEXT);
    editorPane.setText(texto);
    getContentPane().add(new JScrollPane(editorPane), BorderLayout.CENTER);
    private void showData(String data) {
         // ergebnis significa resultado
    StringBuffer ergebnis = new StringBuffer("");
    StringTokenizer st = new StringTokenizer(data, "&");
    while (st.hasMoreTokens()) {
    String token = st.nextToken();
    String key = URLDecoder.decode(token.substring(0, token.indexOf("=")));
    String value = URLDecoder.decode(token.substring(token.indexOf("=")+1,token.length()));
    v.add(value);
    ergebnis.append(" "); ergebnis.append(key); ergebnis.append(": "); ergebnis.append(value); ergebnis.append(" ");
    ergebnis.append(" ");
    JOptionPane.showMessageDialog(this, ergebnis.toString());
    public static void main(String[] args) throws Exception {
    JFrame frame = new JFrame ();
    FormSubmission editor = new FormSubmission ();
    frame.getContentPane().add(editor);
    frame.pack();
    frame.show();
    }

  • HTML Form in a "PL/SQL (anonymour Block)"

    Hello
    I need a little ugent guidance
    I have create a "form" within a "PL/SQL (anonymour Block)". The requirement is to show what a HTML form looks like as you build the code
    The problem is I am "Up Setting" the APEX processing i.e. wwv_flow.accept ... I have added an example below .....
    All help very welcome
    Thanks
    Pete
    htp.prn('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">');
    htp.prn( '<style type="text/css">');
    htp.prn('#form{font-family: "Trebuchet MS", Verdana, sans-serif; width:25em;}');
    htp.prn('h2{margin: 0 0 0 0; padding: 0;}');
    htp.prn('p{margin: 0 0 1em 0; padding: 0; font-size:90%}');
    htp.prn('fieldset{background:#C361D2; border:none; margin-bottom:1em; width:24em; padding-top:1.5em}');
    htp.prn('p.legend{background:#DED983;
    color:black;
    padding: .2em .3em;
    width:750px;
    font-size:18px;
    border:6px outset #DED980;
    position:relative;
    margin: -2em 0 1em 1em;
    width: 20em;}');
    htp.prn('fieldset{margin-bottom:1em; width:66em; padding-top:1.5em;}');
    htp.prn('#company {background:#F3B4F5; border:outset #F3B4F5; width="700";}');
    htp.prn('#company label{position:absolute;
    font-family:arial;
    font-size:16px;
    padding:.2em;}');
    htp.prn('input{margin-left:9em;margin-bottom:.2em; line-height:1.4em;}');
    htp.prn('#message1 {background:#a3B4F5; border:outset #a3B4F5; width="700";}');
    htp.prn('#message2 {background:#c3B4F5; border:outset #c3B4F5; width="700";}');
    htp.prn('button1 {font:48px "Trebuchet MS", "Verdana", sans-serif;
                     background:#F0888A;
                     border:outset #6EC6F1}');
    htp.prn('#buttons1 input {background:#DED983;
    font:1.2em "Trebuchet MS", Verdana, sans-serif}');
    htp.prn('p#buttons1 {white-space:nowrap}');
    htp.prn('</style>');
    htp.prn('<table width="760"><tr bgcolor="#D5EAE9">');
    htp.prn('<BR><BR>');
    htp.prn ('<form method="" action="">');
    htp.prn ('<fieldset id="company"><p class="legend" >Company</p>');
    htp.prn ('<label>Comapany Name: </label> <input name="company" type="Text" size="30"/>');
    htp.prn ('<br><br>');
    htp.prn ('</fieldset>');
    htp.prn ('<br><br><br>');
    htp.prn ('<fieldset id="message1"><p class="legend">Message One</p>');
    htp.prn ('</fieldset>');
    htp.prn ('<br><br><br>');
    htp.prn ('<fieldset id="message2"><p class="legend">Message Two</p>');
    htp.prn ('</fieldset>');
    htp.prn ('<br><br>');
    htp.prn ('</form>');
    htp.prn('</tr></table>');
    End;
    ______________________________________________________________________________________________________

    Pete:
    Remove the name attributes from all input elements defined by the pl/sql process. For example
    <input name="company" type="Text" size="30"/> should be replaced by <input type="Text" size="30"/> or <input name="f01" type="Text" size="30"/>
    The APEX accept process recognises a predefined set of HTML form input names. Any input with a name not from this set will cause the accept process to fail. f01 through f50 are valid names for the accept procedure.
    varad

  • How to submit a html form using java

    hi friends,
    i have a html form with some input fields, when ever a user submit the form the user information is stored in the database. is it possible to pass the user information in the url(url rewriting) and submit it by a java program so that the data will be stored in the database, as like as, user submit it manually.
    for eg:
    /*sample.html*/
    <form action="store.jsp" method="post">
    User Data:<input type="text" name="userdata">
    <input type="submit">
    </form>
    in my java is it possible to store the record as below:
    URL url=new URL("http://localhost:7001/webapp/store.jsp?userdata=AutomaticDatasave");
    URLConnection con=url.openConnection();
    int i=0;
    while((i=con.getInputStream().read())!=-1)
    System.out.print(i);/*it has to print the data that store.jsp is returned like information stored or error storing data(what ever)*/
    }Edited by: rajaram on Oct 27, 2007 1:01 AM

    hi Drclap,
    Thanks for your reply, which is helpful to me....
    tried what you said, what i did is modified the code like below
    con.setDoOutput(true);
    BufferedWriter br=new BufferedWriter(new InputStreamWriter(con.getOutputStream()));
    String str="userdata=AutomateDataSave\n";
    br.write(str,0,str.length());
    br.flush()But
    Iam Getting Internal Server Error
    Exception in thread "main" java.io.IOException: Server returned HTTP response code: 500 for URL
    Edited by: rajaram on Oct 27, 2007 1:24 AM

  • How to retrieve data from the HTML form in the JEditorPane?

    I could quite easily use JEditorPane to render and display a simple HTML file.
    My HTML looks like this:
    <html>
    <head>
    <title> simple form</title>
    </head>
    <body bgcolor="cccccc">
    <center><h1>SURVEY THING</h1>
    </center>
    <form id="survey">
    <p>1.Type something in.</p>
    <textarea cols=25 rows=8>
    </textarea>
    <BR>
    <p>2.Pick ONLY one.</p>
    <input type="radio" name="thing" value="0" Checked> NO choice <BR>
    <input type="radio" name="thing" value="1"> First choice <BR>
    <input type="radio" name="thing" value="2"> Second choice
    <BR>
    <p>3.Pick all you like.</p>
    <input type="checkbox" name="stuff" value="A"> A <BR>
    <input type="checkbox" name="stuff" value="B"> B <BR>
    <input type="checkbox" name="stuff" value="C"> C <BR>
    <input type="submit" value="give data">
    <input type="reset" value="do clensing">
    </form>
    </body>
    </html>
    It gets diplayed fine and I can type in text, select radio buttons (they behave mutualy-exclusive,
    as they should) and check checkboxes.
    The problem I have is with retrieving the values which were entered into the form.
    If I, after editing, try to write the html to the file using HTMLWriter,
    it records the changes I made into the textarea, however all the radio and checkbox selections are lost.
    Maybe the problem is that when I enter the values I do not use any methods like
    insertBeforeStart and so on, but I believe I shouldn't need to use them to populate a form.
    Especially I never change the structure of the HTML.
    Also, when I try to traverse the Element tree and see the input elements attributes,
    I can never see a change in the entered values. However it is probably b/c I am traversing through
    the model and the changes are in the view (just a guess.)
    Anyway, if anybody could direct me onto the right path: how to retrieve the values typed in the form,
    or if it is possible at all in the JEditorPane, I would greatly appreciate.
    thanks
    maciej
    PS. I have seen the answer to a similar question posted some time last year. However, I am trying
    to find a soultion which allows forms/surveys to be built by people who have no java and only basic
    html knwledge. And Axualize way is probably a little bit too "high-tech."

    Maybe helpful for u.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Container;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    public class TestHtmlInput extends JFrame {
         JEditorPane pane=new JEditorPane();
         public TestHtmlInput() {
              super();
              pane.setEditorKit(new HTMLEditorKit());
              pane.setText("<HTML><BODY><FORM>" +
              "<p>1.Input your name.</p>" +
              "<INPUT TYPE='text' name='firstName'>" +
              "<p>2.Input your information.</p>" +
              "<TEXTAREA rows='20' name='StationDescriptions' cols='100'>" +
              "<p>3.Pick ONLY one.</p>" +
              "<input type='radio' name='thing' value='0' Checked> NO choice <BR>" +
              "<input type='radio' name='thing' value='1'> First choice <BR>" +
              "<input type='radio' name='thing' value='2'> Second Choice <BR>" +
              "<p>4.Pick all you like.</p>" +
              "<input type='checkbox' name='stuff' value='A'> A <BR>" +
              "<input type='checkbox' name='stuff' value='B'> B <BR>" +
              "<input type='checkbox' name='stuff' value='C'> C <BR>" +
              "<p>5.Choose your nationality.</p>" +
              "<select name='natio'>" +
              "<option>12</option>" +
              "<option selected>13</option>" +
              "</select>" +
              "</FORM></BODY></HTML>");
              this.getContentPane().add(new JScrollPane(pane));
              JButton b=new JButton("print firstName text");
              b.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        System.out.println("Number of Components in JTextPane: " + pane.getComponentCount());
                        for (int i = 0; i <  pane.getComponentCount(); i++) {
                             //NOTE FOR BELOW: know its a Container since all Components inside a JTextPane are instances of the inner class
                             //ComponentView$Invalidator which is a subclass of the Container Class (ComponentView$Invalidator extends Container)
                             Container c = (Container)pane.getComponent(i);
                             //the component of this containers will be the Swing equivalents of the HTML Form fields (JButton, JTextField, etc.)
                             //Get the # of components inside the ComponentView$Invalidator (the above container)
                             Component swingComponentOfHTMLInputType = c.getComponent(0);
                             //each ComponentView$Invalidator will only have one component at array base 0
                             //DISPLAY OF WHAT JAVA CLASS TYPE THE COMPONENT IS
                             System.out.println(i + ": " + swingComponentOfHTMLInputType.getClass().getName());
                             //this will show of what type the Component is (JTextField, JRadioButton, etc.)
                             if (swingComponentOfHTMLInputType instanceof JTextField) {
                                  JTextField tf = (JTextField)swingComponentOfHTMLInputType;
                                  //downcast and we have the reference to the component now!! :)
                                  System.out.println("  Text: " + tf.getText());
                                  tf.setText("JTextField found!");
                             } else if (swingComponentOfHTMLInputType instanceof JButton) {
                             } else if (swingComponentOfHTMLInputType instanceof JComboBox) {
                                     JComboBox combo = (JComboBox)swingComponentOfHTMLInputType;
                                     System.out.println("  Selected index: " + combo.getSelectedIndex());
                                } else if (swingComponentOfHTMLInputType instanceof JRadioButton) {
                                     JRadioButton radio = (JRadioButton)swingComponentOfHTMLInputType;
                                     System.out.println("  Selected: " + new Boolean(radio.isSelected()).toString());
                             } else if (swingComponentOfHTMLInputType instanceof JCheckBox) {
                                     JCheckBox check = (JCheckBox)swingComponentOfHTMLInputType;
                                     check.setSelected(true);
                                     System.out.println("  Selected: " + new Boolean(check.isSelected()).toString());
                             } else if (swingComponentOfHTMLInputType instanceof JScrollPane) {
                                  JScrollPane pane = (JScrollPane)swingComponentOfHTMLInputType;
                                  for (int j=0; j<pane.getComponentCount(); j++) {
                                       //JTextArea area = (JTextArea)swingComponentOfHTMLInputType.getComponent(0);
                                       Container c2 = (Container)pane.getComponent(j);
                                       for (int k=0; k<c2.getComponentCount(); k++) {
                                            Component c3 = (Component)c2.getComponent(k);
                                            if (c3 instanceof JTextArea) {
                                                 JTextArea area = (JTextArea)c3;
                                                 System.out.println("  " + area.getClass().getName());
                                                 System.out.println("     Text: " + area.getText());
                                                 area.setText("JTextArea found!");
                             } else {
              this.getContentPane().add(b,BorderLayout.SOUTH);
         public static void main(String args[]) {
              TestHtmlInput app = new TestHtmlInput();
              app.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              app.setSize( 400, 900 );
              app.setVisible( true );
    }

  • Jsp - calling a method form an HTML form inside a jsp

    Good mornig everybody,
    Does anybody know how to call a Java Method (a public method of a Class) form an Html form that stay in a jsp page.
    I'd like to do something like that in myPage.jsp
    <%
    // Declaration of object
    MyObject obj = new MyObject();
    %>
    <html>
    <form action="obj.myMethod()">
    <input type=submit vaule=runMethod>
    </form>
    </html>
    Many Tanks
    Matteo

    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8" import="java.util.*,java.text.*,java.math.*"%>
    <jsp:useBean id="p" scope="request" class="com.ecl.web.beans.Bean"/>
    <jsp:setProperty name="p" property="*"/>
    float t = p.geta(); // (geta() Function in Bean)
    do something like this...
    create a bean write ur function in that bean...Then call the function in that bean using set and get property...

  • Loading images in a table and show this image in a html form

    Hi All,
    I'am a newbie in Oracle and PL/SQL.
    I need to load a image in a table and restrive this image and show it in a html form. I'd like to use a PL/SQL procedure.
    Thanks in advance for any suggestions.

    Hi,
    This forum is for Oracle9iAS Web Services discussion.
    I would recommend that you post your question to the 9iAS - General discussion forum.
    Regards,
    Tim

Maybe you are looking for