Dynamic form input name

Hi,
My brain is frozen or something because I couldn't think out this issue.  Basically my form input radio name and value are dynamically pulled from a database.  The name of the form is concat with a name and id is from a database.  On the form processing side, how would I get all the dynamic input radio name.  The value of the input will be attach to the name.  Hope that make sense. 
form.cfm
<cfquery name="get_form_name" datasource="#ds#">
     SELECT id, name
     FROM records
</cfquery>
<cfoutput>
<form action="form_process.cfm">
<cfloop query="get_form_name">
<p>name: <input type="radio" name="test_#get_form_name.id#" value="#get_form_name.name#" /></p>
</cfloop>
<input type="submit" value="submit">
</form>
</cfoutput>
form_process.cfm
somehow get all the input name from the FORM to set cfparam and value.  Once I have this, i have the form values that are passing over.

Your requirement is that you want the application to remember the name of a query variable across multiple page requests. That is a typical case where you would use the session scope.
Following your example,
form.cfm
<cfquery name="get_form_name" datasource="#ds#">
     SELECT id, name
     FROM records
</cfquery>
<cfset session.formRecords = structNew()>
<form action="form_process.cfm" method="post">
<cfoutput query="get_form_name">
<p>name: <input type="radio" name="test_#id#" value="#name#" /></p>
<cfset session.formRecords["test_#id#"] = name>
</cfoutput>
<input type="submit" name="sbmt" value="submit">
</form>
form_process.cfm
<!--- The names and values of the form fields are stored, respectively, as key-value pairs in the structure session.formRecords--->
<cfdump var="#session.formRecords#">
Remarks
1) I simplified the code somewhat. I also added post method to the form, as I assume that is what you are aiming for. Otherwise the form fields will be submitted via the URL.
2) It seems to me the database table holds rows having distinct values of ID . Therefore, my guess is that the functionality you should be going for is <input type="checkbox"> instead of <input type="radio">.

Similar Messages

  • Dynamic Form field name

    I have a shopping cart that creates a dynamic field for the
    quantity of each product in the cart. I need to be able to make
    sure the user does not submit a blank value. I can not use cfinput
    as per client instructions. The field is:
    <input name="Quant_#GetCart.ShowID#" type="Text"
    value="#GetCart.Quantity#" size="1" maxlength="2"
    title="Quantity"/>
    How would you go about validating Quant_#GetCart.ShowID#?
    Thanks in advance for the help/suggestions.

    LeftCorner,
    Thanks for the compliments, and for analyzing my code. It's
    cool to see you care. I agree that the find() should have been
    findNoCase(), and the inclusion of a trim() could be a good one,
    however, the evaluating is not better. In general, Evaluate() is
    becoming less used, and is being certainly phased out where it's
    not extremely necessary. There are a few arguments as to why,
    performance being one of them, readability being another. I stand
    by my code and I recommend you check out structure notation
    (structure[key] when you would normally write structure.key except
    you don't know what "key" really is) wherever possible.

  • Please help with dynamic form field names in cfloop

    Hi,
    I need to create a form with day, date, month, year and time for 12 months
    Instead of coding them 12 times, I create day,date,month,year and time fileds in my form 1 time and then I use cfloop from="1" to="12" index="i" to loop these form fields 12 times.
    I gave each form field name such as: <input type="text" name="ScheduleDate_# i #" value=" "> this way each of those field will be named differently such as:
    ScheduleDate_1, ScheduleDate_2,ScheduleDate_3, ScheduleTime_1,ScheduleTime_2, etc
    I'm facing problem when this form is submitted, I think the error has something to do with the pound sign (##) when it comes to updating the back end
    I use MS SQL
    It doesn like this:
    <CFLOOP From="1" To="12" index="k">
    <CFIF Len(Trim(Form.MeetYear_#k#)) NEQ 0 AND Len(Trim(Form.MeetTime_#k#)) NEQ 0>
    <cfquery name="CreateSchedule" datasource="#DSN#">
    UPDATE TableSchedule 
    SET SchedDay = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedDay_#k##">,SchedMonth =
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedMonth_#k##">,SchedDate =
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedDate_#k##">,SchedYear =
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedYear_#k##">,SchedTime =
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedTime_#k##">
    Where SchedId = <cfqueryparam cfsqltype="cf_sql_numeric" value="#k#">  
    </cfquery>
    </CFIF>
    </CFLOOP>
    Can anyone help please?

    You can't nest hash marks. Do this instead:
    SET SchedDay = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form["SchedDay_" & k]#">
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Help with Dynamic Form Input

    Hello,
    I'd like to generate a form with a PL/SQL script.
    Basically I'd like to ask the user to rank a set of items.
    I have two tables one, ITEMS [ID (Primary Key), NAME (VARCHAR2)] and one PREFERENCES [ID (Primary Key), ITEM_ID (Foreign Key),PREFERENCE (Number), USERNAME (VARCHAR2)]
    From what I understand Collections and APEX_ITEM would be useful here.
    What should I do next?
    Should I read all of the ITEMS ( there will only be 7-13) into a collection and then use APEX_ITEM to generate rows in the form?
    Should I first create rows in Preferences, containing only the ITEM_ID and the USERNAME, and then use multiple row update in APEX_ITEM to generate a tabular form to update the rows?
    Any input would be greatly appreciated.
    Thanks,
    Sam

    I would like one form on one page for creating multiple rows. A tabular form would be fine.
    the page would look like
    Item 1 , Choose a Preference (LOV)
    Item 2, Choose a Preference (LOV)
    Item n, choose a Preference (LOV)
    I know that this could probably be done more easily one row at a time, but I am concerned about making it easy for the end user.
    A tabular form could be appropriate, however it seems like most of your example tabular forms, have already generated records. (ie http://htmldb.oracle.com/pls/otn/f?p=31517:170:4031429456413649::NO ).
    Would it make sense to prepare the form by inserting values into the table just before displaying the form.
    something like (in psudocode)
    select ID from ITEMS into l_items;
    INSERT INTO PREFERENCES (ITEM_ID)
    VALUES (l_items)
    I have a trigger on Preferences that inserts v('APP_USER') into the USERNAME column.
    If I did this the form could display
    select     "ITEMS"."NAME" as "NAME",
         "PREFERENCES"."PREFERENCE" as "PREFERENCE"
    from     "ITEMS" "ITEMS",
         "PREFERENCES" "PREFERENCES"
    where "PREFERENCES"."ITEM_ID"="ITEMS"."ID"
    NAME would be displayed as TEXT
    PREFERENCE would be an LOV
    USERNAME would be hidden
    Thanks for your help.
    -Sam

  • Form inputs generated by HttpPortletRendererUtil.portletParameter contain .

    Hi,
    I'm creating JSP portlets and have to sumbit values from a HTML form. I'm using
    HttpPortletRendererUtil.portletParameter to generate unique form input names.
    I'm following the forminput.jsp sample.
    All is fine but now I want to build some javascript form validation which presents a problem cause form input names are generated like "_piref33_38678_33_1_1.mSite"
    if I test with javascript I tend to use <inputname>.value which results now in "_piref33_38678_33_1_1.mSite.value"
    But .... javascript seems to evaluate the name until the '.' and thinks its an object of some sort..
    Has anyone had similar problems or how can I easy validate a JSP form which is using the JPDK call.
    Regards
    Cumquat
    Dave Ruzius

    I think the code below helps you.
    <%
    parameter = HttpPortletRendererUtil.portletParameter ("param")
    %>
    Use this in javascript.
    document.form.elements["<%= parameter%>"].value
    i hope this solves your problem.

  • Convert dynamic form to dynamic input form

    Hi All,
    I am using Jdeveloper 11.1.2.4.
    As a part of a requirement, I have created a dynamic form built out of a read only view object.
    On a user event (button press), I want to convert the form into an input form to allow the user to make suitable change to data and save to the database.
    At this stage I have programmatic access to the table name which is being used to create the dynamic form.
    Please suggest on how to convert the dynamic form into input form.
    Best Regards,
    Ankit Gupta

    <cfupdate> process data from the form scope. You are
    not putting your
    role datum into the form scope. You need to scope the
    variable in your
    cfset(s).
    <cfset form.roleColumn = form.role=>
    But I am not sure this would work well. It is probably better
    if you
    write your own SQL. <cfinsert> and <cfupdate> are
    for very basic
    database operations. Once you start putting other processing
    requirements in, such as this, they quickly become
    inadequate.
    Try replacing your <cfupdate> with a <cfquery>
    tag something like this.
    <cfquery datasource="my_DSN">
    UPDATE my_table
    SET lastName = '#form.lastName#',
    firstName = '#form.firstName#',
    #form.role# = true
    WHERE key = value
    </cfquery>
    I made my best guesses at how this SQL would look based on
    the examples
    you have provided. You'll have to finish it off based on your
    actual
    requirements.
    Mikelaskowski wrote:
    > Thanks,
    > I really like your solution. It definatly sounds a lot
    easier.
    > I am still having a little trouble though. I am probably
    missing something
    > silly (especially in my cfupdate tag) as I am a little
    new at this stil.
    >
    > When I used your code in my action page I get the
    following error:
    > Error Occurred While Processing Request
    > Variable PRESIDENT is undefined. <--when president is
    selected in the role
    > field. It changes nicely when another is selected.
    >
    > Here is my current code on my action page:
    >
    >
    > Thanks Again!!!
    >
    > <CFSET lastFirst = lastName & ", " &
    firstName>
    > <CFSET roleColumn = Evaluate(role)>
    > <cfupdate datasource="my_DSN"
    tablename="my_table">
    > <html>
    > <head>
    > <title>Title</title>
    > </head>
    > <body>
    > <cfoutput>The role is #roleColumn#<br>
    > The value is #lastFirst#</cfoutput>
    > </body>
    > </html>
    >

  • Help needed, Createing Dynamic User input

    Hello,
    I am attempting to create some dynamic user input by "predicting" what the user requires in a text box.
    For example if the user enters "Smi" I have a select list pop up which gives the user all options that begin with "Smi".
    I am able to achieve the popups but the interface is quite jerky and not terribly responsive I am trying to solve this by using a thread which starts and stops when new input is received but it is still not quite right.
    The program uses a Sorted TreeSet to hold the data (I thought this would give me a quick search time) and a simple interface at this stage.
    Any help would be fantastic
    Thanks in advance :P
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
       /** This program represents part of a larger user interface for allowing the
       user to select data from a file or database.
       <p>
       When the program starts up, it will read in data from a given file, and hold
       it in some type of container allowing rapid access.
       <p>
       The user may then type in the first few letters of the surname of a person,
       and this program should immediately present in a popup dialog the names which
       match.  The user will be able to click on one of the names in the popup and
       that will cause all data about that person to be displayed in the JTextArea
       at the bottom of the window.
       <p>
       This program requires the FormLayout.class, FormLayout$Placement.class, and
       FormLayout$Constraint.class files in the same directory
       (folder) or in its classpath.  These is provided separately.
    class PartMatch extends JFrame implements Runnable
                        /** Close down the program. */
       JButton quitbtn;
                        /** Field for the surname. */
       JTextField namefld;
                        /** Full details of the person(s). */
       JTextArea  results;
                        /** Popup dialog to display the names and addresses which
                        match the leading characters given in namefld. */
       Chooser matches;
                      /** Default background color for a window. */
       final static  Color            defBackground = new Color(0xD0C0C0);
                      /** Default foreground color for a window. */
       final static  Color            defForeground = new Color(0x000000);
                      /** Default background color for a field */
       final static  Color            fldBackground = new Color(0xFFFFFF);
                      /** Default background color for a button */
       final static  Color            btnBackground = new Color(0xF0E0E0);
       final static  Color            dkBackground = new Color(0xB0A0A0);
                      /** Larger font */
       final static  Font bold = new Font("Helvetica", Font.BOLD, 30);
       TreeSet members;
       String input;
       String[] found;
       public static void main(String arg[])
          UIManager.put("TextField.background",fldBackground);
          UIManager.put("TextField.foreground",defForeground);
          UIManager.put("TextField.selectionBackground",btnBackground);
          UIManager.put("TextArea.background",fldBackground);
          UIManager.put("TextArea.foreground",defForeground);
          UIManager.put("TextArea.selectionBackground",btnBackground);
          UIManager.put("Panel.background",defBackground);
          UIManager.put("Label.background",defBackground);
          UIManager.put("Label.foreground",defForeground);
          UIManager.put("Button.background",btnBackground);
          UIManager.put("Button.foreground",defForeground);
          UIManager.put("CheckBox.background",defBackground);
          UIManager.put("ScrollBar.background",defBackground);
          UIManager.put("ScrollBar.thumb",btnBackground);
          UIManager.put("ComboBox.background",btnBackground);
          UIManager.put("ComboBox.selectionBackground",dkBackground);
          PartMatch trial = new PartMatch(arg);
       public PartMatch( String [] arg )
          super("Part Match");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container cpane = getContentPane();
          FormLayout form = new FormLayout(cpane);
          JLabel lab1 = new JLabel("Fetch details") ;
          lab1.setFont( bold );
          form.setTopAnchor( lab1, 4 );
          form.setLeftAnchor( lab1, 4 );
          JLabel lab2 = new JLabel("Surname: ") ;
          form.setTopRelative( lab2, lab1, 4 );
          form.setLeftAlign( lab2, lab1 );
          namefld = new JTextField( 30 );
          form.setBottomAlign( namefld, lab2 );
          form.setLeftRelative( namefld, lab2, 4 );
          namefld.addCaretListener( new CaretListener()
             public void caretUpdate(CaretEvent e)
                 showMatches();
          quitbtn = new JButton( "Quit" );
          quitbtn.addActionListener( new ActionListener()
             public void actionPerformed(ActionEvent e)
                quitProcessing();
          form.setBottomAlign( quitbtn, namefld );
          form.setLeftRelative( quitbtn, namefld, 15 );
          results = new JTextArea( 10,50 );
          results.setEditable(false);
          JScrollPane jsp = new JScrollPane( results,
                                     JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
          form.setTopRelative( jsp, lab2, 6 );
          form.setLeftAlign( jsp, lab2 );
          form.setBottomAnchor( jsp, 5 );
          form.setRightAnchor( jsp, 5 );
          form.setRightAnchor( quitbtn, 5 );
          matches = new Chooser( this );
          //matches.setUndecorated(true);
          pack();
          setVisible(true);
          namefld.requestFocus();
          if (arg.length > 0) init(arg[0]);
          else init("triathlon.txt"); //<<<<<<<<<<<<<<<< Place the default filename here
          /** Called once only, at the end of the constructor, to read the data
            * from the membership file.
       public void init( String fname )
          members = new TreeSet();
           try {
               FileReader fr = new FileReader(new File (fname));
               Scanner scan = new Scanner(fr);
               trimember cmem;
               String cLine, eTag, memberNo, first, last, gender, yob, tel ,addr,
                       club;
               while(scan.hasNextLine())
                   cLine = scan.nextLine();
                   Scanner scan2 = new Scanner(cLine);
                   scan2.useDelimiter(";");
                   eTag = scan2.next().trim();
                   memberNo = scan2.next().trim();
                   first = scan2.next().trim();
                   last = scan2.next().trim();
                   gender = scan2.next().trim();
                   yob = scan2.next().trim();
                   tel = scan2.next().trim();
                   addr = scan2.next().trim();
                   club = scan2.next().trim();
                   cmem = new trimember(eTag, memberNo, first, last, gender, yob,
                           tel, addr, club);
                   members.add(cmem);
           catch (FileNotFoundException ex)
               results.append("Sorry can't find the input file\n");
               results.append("Please check file name and location and try again");
               ex.printStackTrace();
          /** Called every time there is a change in the contents of the text field
            * namefld.  It will first clear the text area.  It then needs to search
            * through the container of data to find all records where the surname
            * starts with the characters that have been typed.  The names and
            * addresses need to be set up as strings and placed in
            * an array of Strings.  This can be placed in the "matches" window and
            * displayed for the user, inviting one to be selected.
            * <p>
            * The performance of this is very important.  If necessary, it may be
            * necessary to run as a separate thread so that the user interface is
            * not delayed.  It is essential that the user be able to type letters at a
            * reasonable speed and not have the keystroke processing held up by
            * previous text.
       public void showMatches( )
           run();
                // First clear the text area
          //results.setText("");
                // Determine the leading characters of the surname that is wanted
                input = namefld.getText();
                // Locate the data for this name, and display each matching item
                //  in the JTextArea ...
                // Example of how to set the data in the popup dialog
          matches.list.setListData(found);
          matches.pack();   // resize the popup
                // set the location of the popup if it is not currently visible
          if ( ! matches.isVisible())
             Dimension sz = matches.getSize();
             Point mouse = getMousePosition();
             Point framepos = getLocation();
             int x=0, y=0;
             if (mouse == null)
                Point pt = results.getLocation();
                x = pt.x + 20 + framepos.x;
                y = pt.y + 20 + framepos.y;
             else
                x = mouse.x - 2 + framepos.x;
                y = mouse.y - 2 + framepos.y;
             matches.setLocation(x,y);
          matches.setVisible(true);
          namefld.requestFocus();
          /** Perform any final processing before closing down.
       public void quitProcessing( )
          // Any closing work.  Then
          System.exit(0);
        public void run()
            ArrayList<String> foundit = new ArrayList<String>();
            System.out.println(input);
            if(input != null)
            Iterator it = members.iterator();
            while(it.hasNext())
               trimember test = (trimember) it.next();
               if (test.last.startsWith(input))
                   foundit.add(test.last +", "+ test.first);
            found = new String[foundit.size()];
            for(int i=0; i<foundit.size();i++)
                found[i] = foundit.get(i);
         /** A window for displaying names and addresses from the data set which
          match the leading characters in namefld.
          <p>
          This will automatically pop down if the user moves the mouse out of the
          window.
          <p>
          It needs code added to it to respond to the user clicking on an item in
          the displayed list. */
       class Chooser extends JWindow
                /** To display a set of names and addresses that match the leading
                characters of the namefld text field. */
          public JList list = new JList();
          Chooser( JFrame parent )
             super( parent );
             Container cpane = getContentPane();
             cpane.addMouseListener( new MouseAdapter()
                public void mouseExited(MouseEvent e)
                   Chooser.this.setVisible(false);
             cpane.add("Center",list);
             list.addListSelectionListener( new ListSelectionListener()
                public void valueChanged(ListSelectionEvent e)
                   Chooser.this.setVisible(false);
                   System.out.println("ValueChanged");
                   // First clear the text area
                   results.setText("");
                   String in = (String) list.getSelectedValue();
                   System.out.println("Selected Value was : "+in);
                   String[] inlf = in.split(", ");
                   System.out.println("inlf[0]:"+inlf[0]+" inlf[1]:"+inlf[1]);
                   results.append("Surname \tFirst \teTag \tMemberNo \tSex \tYOB " +
                           "\tTel \tAddress \t\t\tClub\n");
                   Iterator it = members.iterator();
                   while(it.hasNext())
                       trimember test = (trimember) it.next();
                       if (test.last.equals(inlf[0])&&test.first.equals(inlf[1]))
                           results.append(test.toString()+"\n");
                   namefld.requestFocus();
          public class trimember implements Comparable
           String eTag;
           public String memberNo;
           public String first;
           public String last;
           String gender;
           String yob;
           String tel;
           String addr;
           String club;
           public trimember(String eT, String me, String fi, String la,
                   String ge, String yo, String te, String ad, String cl)
               eTag = eT;
               memberNo = me;
               first = fi;
               last = la;
               gender = ge;
               yob = yo;
               tel = te;
               addr = ad;
               club = cl;         
           //To String method to output string of details
           public String toString()
               return last + "\t" + first + "\t" + eTag + "\t" +
                       memberNo + "\t" + gender + "\t" + yob + "\t"+ tel + "\t" +
                       addr + "\t" + club;
           //Compare and sort on Last name
           public int compareTo(Object o)
               trimember com = (trimember) o;
               int lastCmp = last.compareTo(com.last);
               int firstCmp = first.compareTo(com.first);
               int memCmp = memberNo.compareTo(com.memberNo);
               if (lastCmp == 0 && firstCmp !=0)return firstCmp;
               else if (lastCmp==0&&firstCmp==0)return memCmp;
               else return lastCmp;
    }

    Please don't cross-post. It is considered very rude to do that here:
    http://forum.java.sun.com/thread.jspa?messageID=9953193

  • Help needed, Providing Dynamic User input

    Hello,
    I am attempting to create some dynamic user input by "predicting" what the user requires in a text box.
    For example if the user enters "Smi" I have a select list pop up which gives the user all options that begin with "Smi".
    I am able to achieve the popups but the interface is quite jerky and not terribly responsive I am trying to solve this by using a thread which starts and stops when new input is received but it is still not quite right.
    The program uses a Sorted TreeSet to hold the data (I thought this would give me a quick search time) and a simple interface at this stage.
    Any help would be fantastic
    Thanks in advance :P
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
       /** This program represents part of a larger user interface for allowing the
       user to select data from a file or database.
       <p>
       When the program starts up, it will read in data from a given file, and hold
       it in some type of container allowing rapid access.
       <p>
       The user may then type in the first few letters of the surname of a person,
       and this program should immediately present in a popup dialog the names which
       match.  The user will be able to click on one of the names in the popup and
       that will cause all data about that person to be displayed in the JTextArea
       at the bottom of the window.
       <p>
       This program requires the FormLayout.class, FormLayout$Placement.class, and
       FormLayout$Constraint.class files in the same directory
       (folder) or in its classpath.  These is provided separately.
    class PartMatch extends JFrame implements Runnable
                        /** Close down the program. */
       JButton quitbtn;
                        /** Field for the surname. */
       JTextField namefld;
                        /** Full details of the person(s). */
       JTextArea  results;
                        /** Popup dialog to display the names and addresses which
                        match the leading characters given in namefld. */
       Chooser matches;
                      /** Default background color for a window. */
       final static  Color            defBackground = new Color(0xD0C0C0);
                      /** Default foreground color for a window. */
       final static  Color            defForeground = new Color(0x000000);
                      /** Default background color for a field */
       final static  Color            fldBackground = new Color(0xFFFFFF);
                      /** Default background color for a button */
       final static  Color            btnBackground = new Color(0xF0E0E0);
       final static  Color            dkBackground = new Color(0xB0A0A0);
                      /** Larger font */
       final static  Font bold = new Font("Helvetica", Font.BOLD, 30);
       TreeSet members;
       String input;
       String[] found;
       public static void main(String arg[])
          UIManager.put("TextField.background",fldBackground);
          UIManager.put("TextField.foreground",defForeground);
          UIManager.put("TextField.selectionBackground",btnBackground);
          UIManager.put("TextArea.background",fldBackground);
          UIManager.put("TextArea.foreground",defForeground);
          UIManager.put("TextArea.selectionBackground",btnBackground);
          UIManager.put("Panel.background",defBackground);
          UIManager.put("Label.background",defBackground);
          UIManager.put("Label.foreground",defForeground);
          UIManager.put("Button.background",btnBackground);
          UIManager.put("Button.foreground",defForeground);
          UIManager.put("CheckBox.background",defBackground);
          UIManager.put("ScrollBar.background",defBackground);
          UIManager.put("ScrollBar.thumb",btnBackground);
          UIManager.put("ComboBox.background",btnBackground);
          UIManager.put("ComboBox.selectionBackground",dkBackground);
          PartMatch trial = new PartMatch(arg);
       public PartMatch( String [] arg )
          super("Part Match");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container cpane = getContentPane();
          FormLayout form = new FormLayout(cpane);
          JLabel lab1 = new JLabel("Fetch details") ;
          lab1.setFont( bold );
          form.setTopAnchor( lab1, 4 );
          form.setLeftAnchor( lab1, 4 );
          JLabel lab2 = new JLabel("Surname: ") ;
          form.setTopRelative( lab2, lab1, 4 );
          form.setLeftAlign( lab2, lab1 );
          namefld = new JTextField( 30 );
          form.setBottomAlign( namefld, lab2 );
          form.setLeftRelative( namefld, lab2, 4 );
          namefld.addCaretListener( new CaretListener()
             public void caretUpdate(CaretEvent e)
                 showMatches();
          quitbtn = new JButton( "Quit" );
          quitbtn.addActionListener( new ActionListener()
             public void actionPerformed(ActionEvent e)
                quitProcessing();
          form.setBottomAlign( quitbtn, namefld );
          form.setLeftRelative( quitbtn, namefld, 15 );
          results = new JTextArea( 10,50 );
          results.setEditable(false);
          JScrollPane jsp = new JScrollPane( results,
                                     JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
          form.setTopRelative( jsp, lab2, 6 );
          form.setLeftAlign( jsp, lab2 );
          form.setBottomAnchor( jsp, 5 );
          form.setRightAnchor( jsp, 5 );
          form.setRightAnchor( quitbtn, 5 );
          matches = new Chooser( this );
          //matches.setUndecorated(true);
          pack();
          setVisible(true);
          namefld.requestFocus();
          if (arg.length > 0) init(arg[0]);
          else init("triathlon.txt"); //<<<<<<<<<<<<<<<< Place the default filename here
          /** Called once only, at the end of the constructor, to read the data
            * from the membership file.
       public void init( String fname )
          members = new TreeSet();
           try {
               FileReader fr = new FileReader(new File (fname));
               Scanner scan = new Scanner(fr);
               trimember cmem;
               String cLine, eTag, memberNo, first, last, gender, yob, tel ,addr,
                       club;
               while(scan.hasNextLine())
                   cLine = scan.nextLine();
                   Scanner scan2 = new Scanner(cLine);
                   scan2.useDelimiter(";");
                   eTag = scan2.next().trim();
                   memberNo = scan2.next().trim();
                   first = scan2.next().trim();
                   last = scan2.next().trim();
                   gender = scan2.next().trim();
                   yob = scan2.next().trim();
                   tel = scan2.next().trim();
                   addr = scan2.next().trim();
                   club = scan2.next().trim();
                   cmem = new trimember(eTag, memberNo, first, last, gender, yob,
                           tel, addr, club);
                   members.add(cmem);
           catch (FileNotFoundException ex)
               results.append("Sorry can't find the input file\n");
               results.append("Please check file name and location and try again");
               ex.printStackTrace();
          /** Called every time there is a change in the contents of the text field
            * namefld.  It will first clear the text area.  It then needs to search
            * through the container of data to find all records where the surname
            * starts with the characters that have been typed.  The names and
            * addresses need to be set up as strings and placed in
            * an array of Strings.  This can be placed in the "matches" window and
            * displayed for the user, inviting one to be selected.
            * <p>
            * The performance of this is very important.  If necessary, it may be
            * necessary to run as a separate thread so that the user interface is
            * not delayed.  It is essential that the user be able to type letters at a
            * reasonable speed and not have the keystroke processing held up by
            * previous text.
       public void showMatches( )
           run();
                // First clear the text area
          //results.setText("");
                // Determine the leading characters of the surname that is wanted
                input = namefld.getText();
                // Locate the data for this name, and display each matching item
                //  in the JTextArea ...
                // Example of how to set the data in the popup dialog
          matches.list.setListData(found);
          matches.pack();   // resize the popup
                // set the location of the popup if it is not currently visible
          if ( ! matches.isVisible())
             Dimension sz = matches.getSize();
             Point mouse = getMousePosition();
             Point framepos = getLocation();
             int x=0, y=0;
             if (mouse == null)
                Point pt = results.getLocation();
                x = pt.x + 20 + framepos.x;
                y = pt.y + 20 + framepos.y;
             else
                x = mouse.x - 2 + framepos.x;
                y = mouse.y - 2 + framepos.y;
             matches.setLocation(x,y);
          matches.setVisible(true);
          namefld.requestFocus();
          /** Perform any final processing before closing down.
       public void quitProcessing( )
          // Any closing work.  Then
          System.exit(0);
        public void run()
            ArrayList<String> foundit = new ArrayList<String>();
            System.out.println(input);
            if(input != null)
            Iterator it = members.iterator();
            while(it.hasNext())
               trimember test = (trimember) it.next();
               if (test.last.startsWith(input))
                   foundit.add(test.last +", "+ test.first);
            found = new String[foundit.size()];
            for(int i=0; i<foundit.size();i++)
                found[i] = foundit.get(i);
         /** A window for displaying names and addresses from the data set which
          match the leading characters in namefld.
          <p>
          This will automatically pop down if the user moves the mouse out of the
          window.
          <p>
          It needs code added to it to respond to the user clicking on an item in
          the displayed list. */
       class Chooser extends JWindow
                /** To display a set of names and addresses that match the leading
                characters of the namefld text field. */
          public JList list = new JList();
          Chooser( JFrame parent )
             super( parent );
             Container cpane = getContentPane();
             cpane.addMouseListener( new MouseAdapter()
                public void mouseExited(MouseEvent e)
                   Chooser.this.setVisible(false);
             cpane.add("Center",list);
             list.addListSelectionListener( new ListSelectionListener()
                public void valueChanged(ListSelectionEvent e)
                   Chooser.this.setVisible(false);
                   System.out.println("ValueChanged");
                   // First clear the text area
                   results.setText("");
                   String in = (String) list.getSelectedValue();
                   System.out.println("Selected Value was : "+in);
                   String[] inlf = in.split(", ");
                   System.out.println("inlf[0]:"+inlf[0]+" inlf[1]:"+inlf[1]);
                   results.append("Surname \tFirst \teTag \tMemberNo \tSex \tYOB " +
                           "\tTel \tAddress \t\t\tClub\n");
                   Iterator it = members.iterator();
                   while(it.hasNext())
                       trimember test = (trimember) it.next();
                       if (test.last.equals(inlf[0])&&test.first.equals(inlf[1]))
                           results.append(test.toString()+"\n");
                   namefld.requestFocus();
          public class trimember implements Comparable
           String eTag;
           public String memberNo;
           public String first;
           public String last;
           String gender;
           String yob;
           String tel;
           String addr;
           String club;
           public trimember(String eT, String me, String fi, String la,
                   String ge, String yo, String te, String ad, String cl)
               eTag = eT;
               memberNo = me;
               first = fi;
               last = la;
               gender = ge;
               yob = yo;
               tel = te;
               addr = ad;
               club = cl;         
           //To String method to output string of details
           public String toString()
               return last + "\t" + first + "\t" + eTag + "\t" +
                       memberNo + "\t" + gender + "\t" + yob + "\t"+ tel + "\t" +
                       addr + "\t" + club;
           //Compare and sort on Last name
           public int compareTo(Object o)
               trimember com = (trimember) o;
               int lastCmp = last.compareTo(com.last);
               int firstCmp = first.compareTo(com.first);
               int memCmp = memberNo.compareTo(com.memberNo);
               if (lastCmp == 0 && firstCmp !=0)return firstCmp;
               else if (lastCmp==0&&firstCmp==0)return memCmp;
               else return lastCmp;
    }Edited by: Roger on Nov 3, 2007 11:50 AM

    Please don't cross-post. It is considered very rude to do that here:
    http://forum.java.sun.com/thread.jspa?threadID=5233033&messageID=9953169#9953169

  • Dreamweaver CS4 - Dynamic Form Question

    Hello you all.  I've been tasked with developing a form for my company that allows a user to add as many contacts into a form field as they like, i.e., they would enter a contact first and last name and then click on a "+" sign or button to add another name etc.  The "+" or Add button would shoot each name into a database and display it above the new blank field.
    I am familiar with developing regular static forms but nothing dynamic like this.  I know explaining this to me from start to finish is out of the scope of this forum, but where do I start.  Does Dreamweaver CS4 have some type of widget or Java addon that will allow me to generate this type of field and then I can tackle the database setup at another time?
    Any help would be much appreciated!

    Have a look at the following, just copy and paste in a new document and test in a browser
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <style>
    .clickable {cursor: pointer;}
    #fullname2 {visibility: hidden;}
    </style>
    </head>
    <body>
    <form action="" method="get">
    <input name="fullname1" id="fullname1" type="text"><span id="add1" class="clickable"> +</span>
    <br>
    <input name="fullname2" id="fullname2" type="text">
    </form>
    <script src="http://labs.adobe.com/technologies/spry/includes/SpryDOMUtils.js"></script>
    <script>
    Spry.$$("#add1").addEventListener("click", MyOnClickHandler, false);
    function MyOnClickHandler() {
         Spry.$$("#fullname2").setStyle("visibility: visible;")
    </script>
    </body>
    </html>
    Gramps

  • Dynamic forms in struts

    Hi,
    I have a pretty difficult problem that I don't know how to solve using struts. I need to generate dynamic surveys from a database. The structure of the survey can be different for every different user. I really want to use the struts Form classes but I'm not sure how to do this. The only way I can think of is messy...
    For every new type of survey generated from the database...
    1. Generate a new class definition for the struts Form object and compile that.
    2. Every struts Action class that interacts with the new dynamic Form classes will need to use reflection on the dynamic Form object to be able to pull all of the data from that form.
    I'm sure there are many web sites where forms are dynamically generated and I would think this problem has already been solved. Does anyone out there have any ideas?

    Try to follow this way:
    1 provide actions chain in your configuration file like this:
             <form-bean
                  name="addFlatForm"
                  type="app.owner.forms.AddFlatForm">
                </form-bean>
            <action
                 path="/InitAddFlatForm"
                 type="app.owner.actions.InitAddFlatFormAction"
                 attribute="addFlatForm"
                 validate="false"
                 parameter="owner.extendedplace;place;/pages/AddFlat.jsp">             
            </action>
            <!-- "/pages/AddFlat.jsp" - jsp page with html:form on it-->     
            <action
                 path="/AddFlatForm"
                 type="app.owner.actions.AddFlatAction"
                 name="addFlatForm"
                 validate="true"
                 input="/pages/AddFlat.jsp">
                 <forward
                      name="success"
                      path="/shortinfo/Welcome.do"></forward>
            </action>2 first action(InitAddFlatFormAction) will be "prepare" action, where you must create new instance of the ActionForm descendant with Map, List, array etc definition. where your dynamic fields will be located , and fill the keys value from your database.
    public class InitAddFlatFormAction extends Action{
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                HttpServletRequest request, HttpServletResponse response){
              //obtain parameters
              String[] params = ActionHelper.parseParameter(mapping, 3, Constants.PARAMETER_SEPARATOR);
              //get extended place from session attribute
              ExtendedPlace currPlace = (ExtendedPlace)ServletUtils.getAttribute(
                        request, params[0], ServletUtils.SESSION_SCOPE);
              //create form if form == null
             if (form == null) {
                  System.out.println("InitAddFlatFormAction::execute method: create new instance of action form.");
                  //create new form instance
                  form = new AddFlatForm(new HashMap<String, Object>());
                  //set form to selected scope attribute
                if ("request".equals(mapping.getScope()))
                     ServletUtils.setAttribute(request,
                               form, mapping.getAttribute(), ServletUtils.REQUEST_SCOPE);   //just set the value to selected scope
                else
                     ServletUtils.setAttribute(request,
                               form, mapping.getAttribute(), ServletUtils.SESSION_SCOPE);   //just set the value to selected scope
             //fill the form
             AddFlatForm flatForm = (AddFlatForm) form;
             flatForm.setValue(params[1], currPlace);
             return URIUtils.forwardAction(params[2]);
         }3 second action(AddFlatAction) will be "process" action. This action can be used when your data are successful validated.
    //any your actions4 form bean(ActionForm desctndant)
    public class AddFlatForm extends ActionForm{
         public AddFlatForm(Map<String, Object> map){
              super();
              //check input arguments
              AssertHelper.notNullIllArg(map);
              setMap(map);
         private Map<String, Object> map = null;
         public void setMap(Map<String, Object> map) {
              this.map = map;
         public Map<String, Object> getMap() {
              return this.map;
         public void setValue(String key, Object value){
              getMap().put(key,value);
         public Object getValue(String key){
              return getMap().get(key);
        public ActionErrors validate(ActionMapping mapping,
                HttpServletRequest request) {
            return (null);
    }And than in your jsp page you can use something like this:
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
                                            <c:set var="placeId">
                                                 <bean:write name="extPlace" property="placeInfo.id"/>
                                            </c:set>
                                            <c:set var="groupId">
                                                 <bean:write name="groups" property="filterGroupInfo.id"/>
                                            </c:set>
                                            <c:set var="filterId">
                                                 <bean:write name="filters" property="filter.id"/>
                                            </c:set>
                                            <bean:message name="filters" property="filter.filterDescription"/>
                                            <html:text property="value(${placeId};${groupId};${filterId})"/>                                                                 Something like this are displayed in struts-example.war (example application for struts1.1)
    pay attention for classes
    EditRegistrationAction.java and SaveRegistrationAction.java
    sorry for bad english... :)

  • Dynamic Form in Tabular Form i.e SET VALUE

    Hi,
    I have an tabular form ,
    In which two column are there i.e username and department
    Just I wnt to know can dynamic action i.e SET VALUE CAN BE USED IN TABULAR FORM.
    AS I CHANGE THE USERNAME THERE PERSPECTIVE DEPARTMENT SHOULD CHANGE.
    can anyone help.

    Hello Trent,
    I too, am attempting to set the value of an item when another item is changed.
    I need to capture the APP_USER changing the row for each row changed in the tabular form when submitted.
    My table is in a remote database that is not allowed to have APEX loaded directly in the instance (or db link TO the APEX instance).
    Can’t get the APP_USER making the change at this level, as the APEX code is not there.
    The instance that hosts the APEX installation accesses the table via a view through a db link.
    Can’t use a trigger on the view to set the APP_USER using APEX functionality.
    Not desirable to re-invent the IUD wheel using instead-of triggers.
    The example you posted on http://apex.oracle.com/pls/apex/f?p=45448:11 is exactly what I need (even though your example sets the value on Lose Focus and I Set value on Change).
    I am attempting to implement the dynamic action for the item using your javascript, and am almost there....but not quite. The dynamic action is updating the target item in ALL the rows in the tabular form, not just the one that is being changed.
    This, I am sure, is due to my inexperience with Dynamic Actions, jquery syntax, and the javascript API’s for APEX. I believe I know what the issue IS, I’m just not sure how to work around it.
    Please note: I attempted to download your example at the above website (turning off popup blockers), but had no success (I got the thank-you for downloading message, but have no clue what was downloaded to where). I was hoping to compare your form Dynamic action with mine to see where I went wrong.
    If you could please, review the following and:
    1)     let me know what might be different from your working example?
    2)     provide info on how to get your working form downloaded (such a tease to have the download link there and not get it to work ;0} ) , please?
    The following shows the html from view source for a row in my tabular form. This will help you get an idea of the items. The actual number of rows in the form is about 50.
    <table cellpadding="0" border="0" cellspacing="0" summary="" class="report-standard">
    <tr class="highlight-row">
    <td headers="CHECK$01" class="data">
    <label for="f01_0002" class="hideMe508">CHECK$01</label>
    <input type="checkbox" name="f01" value="2" class="row-selector" id="f01_0002" />
    </td>
    <td headers="JOBNO_DISPLAY" class="data">X111Y2222</td>
    <td align="center" headers="DEPR" class="data">
    <label for="f03_0002" class="hideMe508">DEPR</label>
    <input type="checkbox" name="f03_NOSUBMIT" value="1" id="f03_0002_01"
    onClick="if (this.checked) {apex.jQuery('#f03_0002').val('1');}
    else {apex.jQuery('#f03_0002').val('');}" />
    <input type="hidden" name="f03" value="" id="f03_0002" /></span>
    </td>
    <td headers="UPDUSER" class="data">
    <label for="f04_0002" class="hideMe508">UPDUSER</label>
    <input type="text" name="f04" size="16" maxlength="2000"
    value="MOMSDAT" id="f04_0002" />
    </td>
    <td headers="DERIVED$01" class="data">MOMSDAT</td>
    <td headers="UPDDATE" class="data">13-DEC-11
    <label for="f02_0002" class="hideMe508">JOBNO</label>
    <input type="hidden" name="f02" value="X111Y2222" id="f02_0002" />
    <input type="hidden" id="fcs_0002" name="fcs"
    value="DB31F7B9ED99E6A2F7295F6B7D236409">
    <input type="hidden" id="frowid_0002" name="frowid"
    value="AAATI3AAGAAAAIXAAo" />
    <input type="hidden" id="fcud_0002" name="fcud" value="U" />
    </td>
    </tr>.....
    <tr>.....</tr>
    </table>
    To help explain:
    I have a checkbox associated with array name f03_NOSUBMIT,
    This checkbox OnClick updates a hidden item associated with array name f03. The hidden item is linked to the depr column of my view/table (this functionality is straight from Oracle’s tabular checkbox wizard – works great, no problems).
    When the check box is changed, I need to capture the APP_USER value in the UPDUSER field associated with the f04 array (nice that the array names matched up with your example :0} )
    To do so, I created a dynamic action:
    Name: Set_Upduser
    Sequence: 10 (it’s the only DA)
    Event: Change
    Select Type: jQuery Selector
    jQuery Selector: input[name=”f03_NOSUBMIT”]
    --note: the event does not fire if I use f03
    --since that value is not actually
    --changed until submit with this
    --method.
    Condition: - No condition –
    True Actions:
    Sequence: 10
    Action: Set Value
    Fire When Event Result is: True
    Fire On page Load: Unchecked
    Stop Execution On Error: Checked
    Set Type: JavaScript Expression
    JavaScript Expression:
    var row = $x_UpTill(this.triggeringElement, 'TR');
    var otherElement = $('input[name="f04"]',row)[0];
    otherElement.value = '&APP_USER.';
    Selection type: jQuery Selector
    jQuery Selector: input[name="f04"]
    This ALMOST works...
    When I run the page and click on just one check box, the UPDUSER fields are updated with the APP_USER for ALL the records, not just the row for the checkbox I clicked. And, if I submit the changes, ALL the records in the table now have the APP_USER in the UPDUSER column. Not just the column where the check box was changed (Which would be expected since all the values are changed in the form – hey, the submit part works :0} ).
    Your example at http://apex.oracle.com/pls/apex/f?p=45448:11 works, setting the value for the target field only for that row. If I can get mine to work the same way, I will be good to go (as in hog-heaven, doing the Snoopy Supper-Time dance).
    I am thinking my issue is with the row identification in the
    --- var otherElement = $('input[name="f04"]',row)[0];
    I seem to not be picking up the row value in the row var.
    Am I reading line correctly where 'input[name="f04"]' is pNd, and row is pValue? Read the description of the $x_UpTill API, not sure how this is working to identify pValue (Row?).
    Additionally, I am not sure what the [0] is for at the end of the otherElement var definition. I don’t see that listed with the $ JavaScript API parameters (Google wasn't much help there either).
    OR, am I missing something else?
    Once again, if you could:
    1) let me know what might be different from your working example? (What does yours have that mine doesn’t)
    2) Provide any info on how to get your working form downloaded at http://apex.oracle.com/pls/apex/f?p=45448:11. Please, please?
    As always, your assistance is greatly appreciated!
    Edited by: amckinne on Dec 27, 2011 5:29 PM
    Edited by: amckinne on Dec 27, 2011 5:33 PM

  • Dynamic form processing in struts

    Hi all,
    I need your help regarding dynamic form elements form processing.
    Here is my JSP Script,
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <html:html>
    <HEAD>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <TITLE>Processing Dynamic Forms</TITLE>
    <script type="text/javascript">
    //function which adds new row
    function AddRow()
         tb=document.getElementById("demo");
         // attach counter
         lnrows = tb.rows.length;
         //alert(lnrows);
         newrow = tb.insertRow(lnrows);
         var fourth_col = "amt"+lnrows;
         cell3=newrow.insertCell(0);
         cell3.innerHTML="<center><input type='text' id='"+fourth_col+"' name='"+fourth_col+"' size='10'/></center>";
         document.getElementById("cntr").value = lnrows;
    // function to delete row
    function DeleteRow()
         tb=document.getElementById("demo");
         lnrows = tb.rows.length;
         //alert(lnrows);
         if(lnrows > 2)
              tb.deleteRow(lnrows-1);
              document.getElementById("cntr").value = tb.rows.length - 1;
    </script>
    </HEAD>
    <BODY>
    <html:form action="/dynaActions">
    <TABLE id='demo' align='center' width='80%' border='1'>
    <TR>
         <TH width='25%'>Party Name</TH>
    </TR>
    <TR>
         <TD align='center'><input type='text' id="party1" name="party1" size="30" /></TD>
    </TR>
    </TABLE>
    <TABLE align='center' width='80%' border='0'>
    <TR align="right">
    <td>
         <html:button property="Add" value="Add" onclick="AddRow();" ></html:button>
         <html:button property="Remove"  value="Remove" onclick="DeleteRow();"></html:button>
    </td>
    </TR>
    <TR align="center">
    <td>
         <input type='hidden' id="cntr" name="cntr" value="1" />
         <html:submit/>
    </td>
    </TR>
    </TABLE>
    </html:form>
    </BODY>
    </html:html> As you seen there is dynamically form elements generated as many as required. Now how do I process this with ActionForm & Action?
    Regards,
    Mahesh

    Hi rrhegde,
    Thanks for response.
    Ok, So instead of making it party1, party2, party3, party4, .............................
    if I make it party[1], party[2], party[3], party[4],.............................
    But then how do I process this array. Since the array length will not be fixed, it depends upon users.
    If possible pls provide me some example code on this.
    Thanks & Regards,
    bonzy

  • Cannot submit dynamic form when the form go to the same URL

    Hi,
    I am using Safari 5.1 (7534.50). I am having problem on dynamic form submission.
    When I click on the button 1 on the following form, it will open a page in a new window.
    After that, if I push the button 2, the form cannot be submit and it won't open a new page.
    If I push the button 1 again, the form cannot be submit again either.
    <form target="_blank" action="http://www.domain.com" method="get" name="prForm">
    <input value="0" name="test">
    </form>
    <a href="javascript:submitForm(1);">Submit Button 1 </a>
    <a href="javascript:submitForm(2);">Submit Button 2</a>
    <script type="text/javascript" language="javascript">
    function submitForm(val) {
        var pf = document.prForm;
        pf['test'].value = val;
        pf.submit();
    </script>
    This behaviour has been considered as a bug in Google Chrome and has currently been fixed.
    I wonder if Apple will fix the same bug in the future?

    Might make this easier to answer if you can see the page in question:
    http://www.whataretheyreallylike.com/review.html
    Your thoughts, please?

  • Bizarre CFIF issue with dynamic form variables? Very strange...

    I can't figure out what I'm doing wrong here.  Here's my code.  Issue explained below.
                <cfquery name="reviewconfigloader" datasource="MOLMS">
                SELECT *
                FROM dbo.BaseModel
                WHERE dbo.BaseModel.AccountID = #molmsAccountID# AND.dbo.BaseModel.basemodelActive = 1
                </cfquery>
          <table width="100%" border="0" cellspacing="0" cellpadding="3">
            <cfloop query="reviewconfigloader"><cfif isdefined("form.baseconfig#reviewconfigloader.basemodelID#") AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ "" AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0><cfoutput><tr>
              <td width="40%" bgcolor="##F7F7F7" class="basemodelsub">     #form['baseconfig#reviewconfigloader.basemodelID#']#  #reviewconfigloader.basemodelName# #reviewconfigloader.basemodelSubName#</td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">x 14 </div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$486/yr</div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/yr</div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/3 yr</div></td>
            </tr></cfoutput></cfif></cfloop>
          </table>
    What I'm doing here is fairly basic.I'm running a query with a number of configs in it...and then creating a loop to output them.  Ultimately, I only want the configurations that didnt have 0 submitted in the form on the previous page.  Each one of the configs in the config query has a dynamic form variable on the previous page with a quantity tied to it.  I am trying to eliminate all quantities past that aren't 0 (or not eliminate, just not show)...as you can see from the cfif statement.
    Here's where it gets weird.  You'll notice I output #form['baseconfig#reviewconfigloader.basemodelID#']#, just for testing, which shows me the quantity as it should.  I ran a test and put in a couple of 1s, 0s, 12s, 6s, etc in the form fields on the previous page.  If this thing worked, it wouldnt show anything for any of the records with their basemodelID value being submitted as 0.  Not the case.  It shows all records.  What is more hilarious is that it outputs perfectly in my test #form['baseconfig#reviewconfigloader.basemodelID#']#, showing the correct numbers entered in the previous form, the 1s, the 0s, etc, tied to each record.  But for whatever reason, the cfif code isn't catching it.
    What's even more bizarre...I replaced the cfif ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0 with GT 12 (12 was the highest number that I put in the form) and it still showed all records.  Then I put it in as LT 12 and it showed nothing.  I decided  to take it one step further and put it in for GT 1231243242343 (random massive number), which it still showed all of the records.  So somehow, my CFIF statement thinks that  ("form.baseconfig#reviewconfigloader.basemodelID#") is a incredibly large number, although when I output it in the row below, it is the number it should be.
    I'm stumped.  Any ideas?  Thanks in advance!!

    Hey Dan...thanks....unfortunately...with the cfif testing, thats kinda what I'm
    doing because I dont have an "expected" value.  My expected value is anything a user inputs thats greater than zero, hence NEQ 0 and NEQ "". The real problem is taht what I'm outputting works and what the cfif clause is seeing is obviously very different.
    As far as your comment about looping out the variables and then setting a query equal to the value in a cfquery, remember...these are form objects and therefore nothing can be tied back to the database.  The result from the code is establishing a form variable (example.... form.basemodel1 (if 1 was the basemodelID from the database query) so it can capture whatever data the user has passed from the previous page in a text input.  So that input could have been 23, it could have been 1053.
    So really the only way to do it is create a query and loop out the variables.... and attach them to form objects (basemodel1, basemodel2, basemodel3 etc where the 1,2 and 3 are the unique ID's for those models in the database), and then look for where those form objects may have been filled in in the previous page by stating IF this form object not equal to 0 or "", output the data.
    Does that make sense?  Thanks for the help guys I'm completely stumped by this.  I've done this a million times with CFIF and I'm really struggling with why this isnt working....
    JE    

  • Need to flatten dynamic form

    I have created a dynamic form for use by our sales agents. This form will be submitted to a web service to obtain a secure electronic signature, and the form needs to be submitted as a 1.4 compliant pdf. It will be submitted from the agents machine using the SOAP protocal.
    Is there a way to generate a flattened pdf when the user clicks a submit button? I am looking for a low-cost solution.
    Thanks,
    Debra

    Hi,
    U need to create the R/3 system in the portal after in SLD u need to add the properties of r/3 system and sap gatway and TCP/IP name in VA.
    Once SLD is connected u can check in ContentAdmin->web dynpro-> maintain SLD and check the SLD is successfully connected.
    After that u need to create the JCo names MetaData and model data once these are created ping the Metadata and model data successfully connected.
    Once Jco names are correct then only u can go import model form r/3 system
    There u need to give R/3 system properties properly.
    Import the model into WD naming supposr RAMA.
    register the model into webdynpro using the usedmodels.
    Then goto the Customcontroller the model nodes are avail in rightside of your cutomcustomcontrollercontext and do the Model binding.
    Once you get the model into your cuctomcontroller u can register the custom controller into viewcontroller and getting the nodes into view context.
    And goto the View and apply template and create the Table by using the existing node.
    Goto the init method of the View controller and add the following code.
    FNModule_Input input = new FNModule_Input();
    wdContext.nodeFNModule_Input().bind(input);
    // pass the input
    input.setZ_Kunnr("0000000001");
    try {
    wdContext.currentFNModule_InputElement().modelObject().execute();
    wdContext.nodeOutput().invalidate();
    } catch (WDDynamicRFCExecuteException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    this link s ready used code for the get the data from R/3
    https://www.sdn.sap.com/irj/sdn/softwaredownload?download=/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/business_packages/a1-8-4/4tutwd_flightlist.zip
    if you have any issues post here.
    Thanks,
    Lohi.

Maybe you are looking for

  • How do I keep duplicate messages in Mail and Gmail?

    For the past few years messages would appear in both my Mail and Gmail inboxes.  If I deleted a message in Gmail, the duplicate would REMAIN in Mail. Therefore, I could keep some messages in my gmail account that pertained to work and delete their du

  • Problem about  logon ticket cookie

    Hi all,     We have just set up  trust between two portals.And we want to archive this:     One user log on a portal(consumer) and he can logon another(producer) with logon ticket.     But one problem is:     One user log on consumer and access the p

  • Wd abap - successfull save

    Hello, Is there a quick workaround to display a message when successful changes to a screen were made? I can create a transparent container with image and text but does WD ABAP have a build in component for this? Thanks.

  • Port Mapping in Extreme

    Hi I had all my ports forwarded on my Airport but when I updated I lost all connection... I have the main machine is a G% but I have a XP box I use as a web server...it does not server?/ I went to the port forwarding feature but nothing worked??

  • Can two photos and a small Flash applet give a sense of dimensionality?

    http://wiggle.sourceforge.net/ Can two photos and a small Flash applet give a sense of dimensionality? James must not eat the brownies. Lorna in Southern California