Form and the get method

I am using a simple form with one dropdown menu and one
submit button.
The form uses the get mothod to send the menu id to another
page.
The form must also get another value and send it along with
the selected menu value.
The missing value will come from the "prod_id" from my
recordset, but I do not want to show that value to the user, of
course, so I do not know how to incorporate it into the form.
My second page relies on $_GET['prod_id'] and
$_GET['menu_value']
The menu_value is in the url, but not the prod_id, as
explained.
Thanks for any advice.

On Fri, 20 Feb 2009 19:19:28 +0000 (UTC), "bregent"
<[email protected]> wrote:
> That's what I was going to suggest, with the caveat that
if this is sensitive
>information you are trying to hide, it will be visible in
source view. The fact
>that you did not want it in the querystring leads my to
believe this may be the
>case.
That's true.
Gary

Similar Messages

  • Hey guys, i get the message "Your Apple ID was deaktivated" I have changed my password and the pay method too but nothing happens

    Hey guys, i get the message "Your Apple ID was deaktivated" I have changed my password and the pay method too but nothing happens

    After resetting your password have you tried logging out of your account on your phone by tapping on your id in Settings > iTunes & App Store and then logging back in to see if that 'refreshes' the account on it and if it then works ?
    If that doesn't fix it then you might need to contact iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • HttpURLConnection and HEAD/GET methods

    I am attempting to validate whether an HTML page exists or not.
    I have found that, for about 7% of the pages checked, HEAD and GET methods return different response codes.
    I have structured my code such:
    1) make initial check using HEAD method
    2) for non valid (200) response codes, recheck the page using the GET method.
    In this case about 75% of the pages that failed using the HEAD method will work when using the GET method.
    So, I guess my questions are:
    1) Does anybody know why HEAD/GET return different response codes?
    2) Does anybody know a better way to check if a page exists?
    Here is the sample program I am using with a few URLs that exhibit this behaviour:
    import java.io.IOException;
    import java.net.HttpURLConnection;
    import java.net.InetAddress;
    import java.net.URL;
    import java.net.UnknownHostException;
    public class Internet
         private final static String DEFAULT_LOCAL_HOST = "127.0.0.1";
         private URL url;
         private HttpURLConnection http;
         private int responseCode;
         private String responseMessage;
         public Internet(URL url)
              this.url = url;
         public boolean isValid()
              try
                   //  Make first attempt using a HEAD request
                   http = (HttpURLConnection)url.openConnection();
                   http.setRequestMethod( "HEAD" );
                   http.connect();
                   System.out.println( "head: " + http.getResponseCode()
                   + " : " + http.getResponseMessage() );
                   //  GET seems to do a better job, try again
                   if ( http.getResponseCode() != HttpURLConnection.HTTP_OK)
                        http = (HttpURLConnection)url.openConnection();
                        http.setRequestMethod( "GET" );
                        http.connect();
                        System.out.println( "get:  " + http.getResponseCode() );
                   responseCode = http.getResponseCode();
                   responseMessage = http.getResponseMessage();
                   if (http.getResponseCode() == HttpURLConnection.HTTP_OK)
                        return true;
                   else
                        System.out.println( http.getResponseMessage() );
                        return false;
              catch (IOException e)
                   responseCode = -1;
                   responseMessage = e.getMessage();
                   System.out.println( e );
                   return false;
         public static void main(String[] args)
              throws Exception
              URL url = new URL( "http://www.trca.on.ca" );
              Internet internet = new Internet( url );
              System.out.println( internet.isValid() );
              url = new URL( "http://school.discovery.com/sciencefaircentral" );
              internet = new Internet( url );
              System.out.println( internet.isValid() );
              url = new URL( "http://www.amazon.com" );
              internet = new Internet( url );
              System.out.println( internet.isValid() );
    }

    Using my sample program:
    1) about 3K of data is transferred
    2) it runs in about 8 seconds
    Using InputStream in = http.getInputStream():
    1) about 73K of data is transferred
    2) it runs in about 15 seconds
    Using the getInputStream() method causes the entire file to be transmitted (even though I don't use any read() methods). I don't care about the data.
    I want the check to be as fast as possible which is why I use the HEAD method. It doesn't transfer the contents of the file. But why in some cases does it show a response code other than 200?

  • I can't over give my variable to the return in the get Method!

    Hello Java Cracks
    At the moment I am working with JDOM. I am able to get access to the XML File with JDOM, but when I want to send, the value of a variable, which I get from the XML File it is not possible. When I try to send the variable to the get Method (getDtdVersion), the value I over give is always �null�. Please help me, and say what the problem is?
    I also post you the second class, where I want to use the variable I over give.
    Here is my code:
    Class 1, I take the String from this class. See the arrow
    package FahrplanXML;
    import java.io.File;
    import java.io.IOException;
    import javax.swing.JFileChooser;
    import javax.swing.filechooser.FileFilter;
    import org.jdom.Attribute;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.JDOMException;
    import org.jdom.input.SAXBuilder;
    import org.xml.sax.InputSource;
    public class FileAuswahl {
    private File filenames;
    private String scheduledtdversion;
    public void ablauf() throws JDOMException, IOException {
    FileAuswaehlen();
    saxwer();
    grundoberflaeche xmloberflaeche = new grundoberflaeche();
    xmloberflaeche.grundoberflaechen();
    public void FileAuswaehlen() {
    JFileChooser datei = new JFileChooser();
    datei.setFileFilter(new FileFilter()
    @Override public boolean accept (File f)
    return f.isDirectory() ||
    f.getName().toLowerCase().endsWith(".xml");
    @Override public String getDescription()
    return "XML-Files";
    int state = datei.showOpenDialog(null);
    if (state == JFileChooser.APPROVE_OPTION )
    filenames = datei.getSelectedFile();
    System.out.println (filenames);
    if (filenames != null)
    try {
    System.out.print(filenames);
    saxwer();
    } catch (JDOMException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    else
    System.out.println("Kein File ausgew�hlt");
    else
    System.out.println("Auswahl abgebrochen");
    System.exit(0);
    //Ausgew�hlter Dateiname an saxwer �bergeben
    public File getNames() {
    System.out.println (filenames);
    return this.filenames;
    public void saxwer() throws JDOMException, IOException {
    //FileAuswahl filename = new FileAuswahl();
    File files = getNames();
    System.out.println (files);
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(files);
    Element schedulemessage = doc.getRootElement();
    //Root Element auslesen
    String sch_msg_dtdversion = schedulemessage.getAttributeValue ("DtdVersion"); // <---
    scheduledtdversion = sch_msg_dtdversion;
    new grundoberflaeche().grundoberflaechen();
    public String getDtdVersion() {
    System.out.println (scheduledtdversion);
    return this.scheduledtdversion;
    Now, you will see the class in which I pass the String. See also arrow...
    package FahrplanXML;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.IOException;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.text.Caret;
    import org.jdom.Attribute;
    import org.jdom.JDOMException;
    public class grundoberflaeche {
    // Layout f�r Laender vorbereiten
    static void addComponent (Container cont,
    GridBagLayout diversemoegl,
    Component laenderdetails,
    int x, int y,
    int width, int height,
    double weightx, double weighty )
    GridBagConstraints grundoberflaechen = new GridBagConstraints();
    grundoberflaechen.fill = GridBagConstraints.BOTH;
    grundoberflaechen.gridx = x; grundoberflaechen.gridy = y;
    grundoberflaechen.gridwidth = width; grundoberflaechen.gridheight = height;
    grundoberflaechen.weightx = weightx; grundoberflaechen.weighty = weighty;
    diversemoegl.setConstraints(laenderdetails, grundoberflaechen);
    cont.add(laenderdetails);
    //Ausw�hlen des XML Files
    public void XMLAuswaehlen() {
    JFrame xmlauswahl = new JFrame("Fahrplan ausw�hlen");
    xmlauswahl.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container laenderdetails = xmlauswahl.getContentPane();
    GridBagLayout diversemoegl = new GridBagLayout();
    laenderdetails.setLayout(diversemoegl);
    JButton dateiauswahl = new JButton ("Datei ausw�hlen");
    addComponent(laenderdetails,diversemoegl,dateiauswahl,1,1,1,1,1,1);
    ActionListener ersterdateiauswaehler = new ActionListener()
    public void actionPerformed( ActionEvent e)
    try {
    new FileAuswahl().ablauf();
    } catch (JDOMException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    dateiauswahl.addActionListener(ersterdateiauswaehler);
    xmlauswahl.setSize(150,70);
    xmlauswahl.setVisible(true);
    //Layout machen
    public void grundoberflaechen() {
    JFrame fahrplan = new JFrame("Fahrplanauswahldetails");
    fahrplan.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container laenderdetails = fahrplan.getContentPane();
    GridBagLayout diversemoegl = new GridBagLayout();
    laenderdetails.setLayout(diversemoegl);
    //Klassenobjekt aufbauen
    FileAuswahl fileauswahl = new FileAuswahl();
    // Labelsbauen und einbauen in den Fahrpl�nen
    String dtdversion = fileauswahl.getDtdVersion(); // <---
    System.out.println(dtdversion);
    JTextField DtdVersion = new JTextField(1);
    DtdVersion.setText(dtdversion);
    JTextField fahrplanzeit = new JTextField(1);
    fahrplanzeit.setText("123");
    JTextField fahrplanzeita = new JTextField(1);
    fahrplanzeita.setText("piips");
    //JButton oesterreich = new JButton("�sterreich");
    //JButton italien = new JButton("Italien");
    //JButton frankreich = new JButton("Frankreich");
    //JButton spanien = new JButton("Spanien");
    addComponent(laenderdetails,diversemoegl,new JLabel("Fahrplandetails"),0,0,1,1,0,0);
    addComponent(laenderdetails,diversemoegl,DtdVersion,1,0,1,1,0,0);
    addComponent(laenderdetails,diversemoegl,fahrplanzeit,2,0,1,1,0,0);
    addComponent(laenderdetails,diversemoegl,fahrplanzeita,3,0,1,1,0,0);
    // Action Listener f�r Dateiauswahl
    // Action Listener f�r das Speichern der Datei
    //addComponent(laenderdetails,diversemoegl,frankreich,2,1,1,1,0,0);
    //addComponent(laenderdetails,diversemoegl,spanien,3,1,1,1,0,0);
    fahrplan.setSize(600,750);
    fahrplan.setVisible(true);
    Thank you very much for your help....
    Your Java Learner

    I suspect you are setting the scheduledtdversion member in one instance of your FileAuswahl class, but are creating yet another instance of that class and printing the member of that instance, which is null. I notice you are creating a new FileAuswahl instance each time something happens, rather than reusing the same instance.
    FileAuswahl fileauswahl = new FileAuswahl();Ok, new object here. Not the same one that you previously set the scheduledtdversion member in
    String dtdversion = fileauswahl.getDtdVersion();It's null of course, for the reason above.

  • I have a pdf registration form on my website.  It has a link that take the user to a payment page within my website.  They pay then submit the form.  The link currently opens in the same browser tab as the form and the user thinks that is the submission,

    I have a pdf registration form on my website.  It has a link that take the user to a payment page within my website.  They pay then submit the form.  The link currently opens in the same browser tab as the form and the user thinks that is the submission, which it is not.  I want my link to open into a new browser tab.  How do I do that?

    You can use the following JS code:
    app.launchURL("http://www.example.com", true);

  • When I try to save, I keep getting the message "The document could not be saved. You don't have permission" - even though I am the Administrator and the Get Info displays "Administrator and (me)".

    When I try to save, I keep getting the message "The document could not be saved. You don't have permission" - even though I am the Administrator and the Get Info displays "Administrator" and my_name(me)". Also, when I do a disk permission repair, it always repairs the same applications and files. Last night, I did a disk permission repair twice and both times it took a long time and did the exact same repair both times.

    Disk Utility won't repair your home folder.  Sounds like your home folder permissions are messed up tho.  Try repairing them this way by using Lion Recovery.
    1. Restart Lion, and before you hear the chime, hold down the Command and R keys.
    2. You’ll be at the Repair Utilities screen. Click the Utilities item in the Menu Bar, then click Terminal.
    3. In the Terminal window, type resetpassword and hit Return.
    4. The password reset utility window launches, but you’re not going to reset the password. Instead, click on icon for your Mac’s hard drive at the top. From the dropdown below it, select the user account where you’re having issues.
    5. At the bottom of the window, you’ll see an area labeled Reset Home Directory Permissions and ACLs. Click the Reset button there.
    The reset process takes just a couple of minutes. When it’s done, exit the programs you’ve opened and restart your Mac.
    Good luck
    RM

  • After upgrading to 8.0 the add-on compatability tool runs and the Getting Started web page loads every time the browser starts.

    After upgrading to 8.0 from 7.0.1 every time I start FF I get the add-on compatibility tool to run and the Getting Started web page loads along with my homepage in separate tabs as well. So far I have tried running the installer again, disabling all add-0ns and custom settings and restarting and turning off automatic updates. Nothing worked there. I got the same behavior each time. I don't know what else to try other than a full uninstall and reinstall. Something I'd like to avoid if it's possible because of the time involved. This is the second time I have posted regarding this issue. The first time I didn't get a response. A solution or a possible workaround would be greatly appreciated if anyone knows of any. As a staff member and a global forum moderator for an anti-virus company I understand how hectic things can be at times but some feedback, good or bad, on this issue would be very welcomed! Regards, Ritchie...

    Hi michaell, thanks for the reply. I tried everything in the Preferences are not saved link you provided and nothing worked there. If creating a new profile will delete all my add-ons and custom settings I might as well just do a complete uninstall and reinstall. That actually would be easier. That article told me how to save my bookmarks though so I don't have to loose those which is nice. I don't know if this makes any difference but there is a discrepancy between the preference file in the article which is: prefs.js and what's showing on my PC which is: prefs with no .js suffix. I tried to rename the file to prefs.js and restarted. No luck there either. It just created another prefs file. I guess we've pretty much exhausted all the avenues to try! I'm just going to go ahead and do a reinstall when I get the time. Thanks so much for your help michaell. I do appreciate the effort. Regards, Ritchie...

  • Re: fortecgi and the POST method

    DAVID A. TRIGO wrote:
    Has anyone successfully used the forte CGI program using the POST
    method from a form? I've had success with PUT, but fortecgi seems to
    have a problem when the HTML form uses POST.
    I'm running Netscape Enterprise Server 3.0 on Solaris 2.5
    thanks,
    David Trigo
    Allmerica FinancialDavid --
    Can you be a little more specific about what you mean by "fortecgi
    seems to have a problem when the HTML form uses POST"? What kind of error
    messages do you get? What do they say?
    For instance, the following code works fine:
    tag code in "somepage.htm" ...
    <form method="POST" action="$$FORTE.ExecURL">
    <input type="hidden" name="ServiceName" value="SomeService">
    <input type="hidden" name="TemplateName" value="next_page.htm">
    <input type="hidden" name="HiddenParam" value="dog">
    <div align="center"><center><p>
    Type some junk here: <input type="text" name="junkTxt"
    size="20">
    </p></center></div>
    <div align="center"><center><p>
    <input type="submit" value="Submit" name="submitBtn">
    <input type="reset" value="Reset" name="resetBtn">
    </p></center></div>
    </form>
    in "next_page.htm" ...
    <?forte execute TestThis ResultSet="StuffRS">
    <table border="1" width="43%">
    <tr>
    <td width="100%"><p align="center"><strong>STUFF</strong></td>
    </tr>
    <tr>
    <td width="100%"><p align="center">$$StuffRS.firstWord</td>
    </tr>
    <tr>
    <td width="100%"><p align="center">$$StuffRS.secondWord</td>
    </tr>
    </table>
    up in Forte World, in your HandleTag method ...
    firstItem:TextData=new;
    secondItem:TextData=new;
    if Tag.Compare('TestThis', ignorecase=TRUE) = 0 then
    firstItem = request.FindNameValue('junkTxt');
    secondItem = request.FindNameValue('HiddenParam');
    rset.Add('firstWord',firstItem);
    rset.Add('secondWord',seconditem);
    The end result should be a table with 2 entries -- whatever you typed in
    the text box and the hidden string "dog"
    Dr. Daniel Marcus
    Sage IT Partners, Inc.
    353 Sacramento St., Suite 1360
    San Francisco, CA 94111
    415.392.7243 x357
    [email protected]

    This works:
    <FORM METHOD="post" ACTION="http://localhost:9704/analytics/saw.dll?" ENCTYPE="application/x-www-form-urlencoded">
    <input type=hidden name=Cmd value=Answers>
    <input type=hidden name=nqUser value=Administrator>
    <input type=hidden name=nqPassword value=Administrator>
    <input type=submit value="Answers">
    </FORM>

  • A question about concurrency and static getter methods

    Hello
    I have a class with some static methods. they just return a reference and doesnt apply any changes.
    something like this:
    public class FieldMapper {
            private static Map<Class,Map<String,String>> fieldMap = new HashMap<Class,Map<String,String>>();
            public static getFields(Class clazz){
                  return fieldMap.get(clazz);
    }my question is, let's consider many users connect to my server and each has its own session, now assume one user want to use FieldMapper.getFields(User.class) and another is going to call FieldMapper.getFields(Employee.class) at same time or a bit milli seconds after, and this method is not synchronized, is there any conflict in calling the method? would this method return wrong reference to the first invocation?
    in genereal, may the concurrency make problem on reading resources? or just on changing resources?
    Thank you very much in advance.

    To publish an object safely, both the reference to the object and the object's state must be made visible to other threads at the same time. A properly constructed object can be safely published by:
    Initializing an object reference from a static initializer;
    Storing a reference to it into a volatile field or AtomicReference;
    Storing a reference to it into a final field of a properly constructed object; or
    Storing a reference to it into a field that is properly guarded by a lock. The internal synchronization in thread-safe collections means that placing an object in a thread-safe collection, such as a Vector or synchronizedList, fulfills the last of these requirements. If thread A places object X in a thread-safe collection and thread B subsequently retrieves it, B is guaranteed to see the state of X as A left it, even though the application code that hands X off in this manner has no explicit synchronization.
    Now in the case you have specified you are using HashMap. Which is not designed to be threadsafe as opposed to HashTable or concurrentHashMap. In such a case I would advise against using this. The concurrency problem is caused by race conditions on mutable objects, whether it is reading or writing. If it is mutable, it is susceptible to race conditions. IMHO
    &spades;

  • Adobe Reader XI - dynamic PDF Form and the E-Mail Dialog

    Hi Community,
    I have a dynamic PDF Form and we use the E-Mail function to save the XML-Data to local harddrive. That works until Adobe Acrobat Reader 10.1.2. But with the Adobe Reader XI (11.0.4) the E-Mail Dialog has changed so I am One is forced to send the XML file with Outlook or the internal mailer and has no option to save the file locally.
    Does anyone know a workaround or something similar. The Live Cycle server with PDF extension is too expensive for our small project.
    E-Mail Dialog (10.1.2)
    If you choose Internet-E-Mail you get a Save-As File Dialog
    E-Mail Dialog (11.0.4)
    There is no way to save the XML-Data to local Harddrive.

    Hi Pat,
    Are you using Adobe Reader XI? And not Acrobat. It does not ask me to save the form if there are unsaved changes.
    I have used previous versions of reader for saving this form data and it did allow me to save it with ctrl+s. And those versions did prompt me to save the changes before closing.
    I guess I should not have updated the reader.

  • I dont know what to do!!! I pulled out my headphones and then saw that my sound was not working correctly. I was horrified to find a piece of the headphone never came out. I have heard how much it costs to repair and the other methods are not working.

    Please help, i am so scared that i will never get my laptop back the way it was.

    "the other methods aren't working"
    Well, what other methods have you tried that didn't work?  Frankly, your post reads as a hoax, but I have some extra time on my hands, and an idea.  Make an appointment with the Apple Genius at your local Apple store.  You could also bring your MBP to an AASP.  Regardless, either one should be able to remove the bottom cover, and use a plastic thingy (dang, what is that tool called?) to push out the offending bit.

  • Adda more pages to an Interactive Form and the binary context

    Hi to all,
    my scenario is: I have a java webdynpro with a view with an interactive form of 2 pages. I inserted a button on the pdf which duplicates the second page (using java script). Then there is the "submit to SAP" button which transfers the content of the binary context (I bound it to the pdfSource attribute of the interactive form) to an R/3 system. The fact is that when then I read the "binary" file from R/3, I find only the 2 pages and not the pages I added with my button.
    How can I do? It's important for me the possibility of having more second pages.
    Sorry for my english,
    Thanks in advance
    Enrico

    Hi Enrico,
    If I understand correctly, you are calling the addInstance() on click of the button that you placed in your form and when you add more pages using this button and save the fikle and open it again, the newly added instances are not displayed in the form. Am I right?
    If this is the scenario, the you need to store the value of the forms created using this button and call the same addInstance() method in the initialize event of your form. I.e place the same code that is there in click event of the button inside the Initialize event of the form with the number that we have saved in some hidden field.
    Hope this resolves your issue.
    Cheers,
    Arafat

  • Understanding Comparable and the compareTo( ) method

    I have a Contact object which lists a person's information for a "phone book" program.
    I am trying to sort the Contact objects in a Vector by way of their last name fields.
    I am having a hell of a time trying to use this compareTo( ) method.
    I'm really struggling with understanding how to go about making the method work with a comparison. Most of the examples which I find compare "numbers' and not strings which make it more difficult to understand.
    I have implimented the comparable Interface at the start of my class. To sort my Vector, I'm attempting to use the compareTo( ) method to determine which Last name field has the lower value. I keep going back and forth working through the error messages I receive and I'm just stumped trying to figure out how to get this thing to work. Can someone please point out the mistakes without writing too much code? I don't want someone to do the work for me. Here is the code:
    import java.io.*;
    import java.util.*;
    class PhoneBook implements Comparable{
         private static Vector v = new Vector();
         private static Iterator iter = v.iterator();
         private static int num, index;
         private static Contact firstContact, secondContact, temp;  //"static" to be referenced from main
         public static void main(String arg[])throws Exception {
              Contact c;
              String str;
              BufferedReader br = new BufferedReader(
          new InputStreamReader(
               new FileInputStream(
                                           new File("contacts.txt"))));
              while((str = br.readLine()) != null){
               v.add(c= new Contact(br.readLine()));
               num = v.size();
               for(int i=0; i < num; i++){
          firstContact = (Contact)v.elementAt(i);
               if(v.elementAt(++i) == null)
                    break;
               else
                    secondContact = (Contact)v.elementAt(++i);
               index = compareTo(firstContact);
               if(index == 1){
                       temp = (Contact)v.elementAt(i);
                       v.setElementAt(v.elementAt(++i), i);
                       v.setElementAt(temp, ++i);
              public static int compareTo(Object person){
         int x = ((Contact)person).getLName().compareTo(secondContact.getLName());
         return x;
    }yet still I get the following compiler error:
    PhoneBook.java:4: compareTo(java.lang.Object) in PhoneBook cannot implement compareTo(java.lang.Object) in java.lang.Comparable; compareTo(java.lang.Object) and compareTo(java.lang.Object) are static
    class PhoneBook implements Comparable{
    ^
    1 error

    You are pretty close here except for one incorrect basic assumption. Your compiler error is because you are trying to implement compareTo() with a static method. However, this is irrelevant because it is not the PhoneBook class that should implement Comparable, but the Contact class.
    The idea is that other functions can call the compareTo() method on an instance of Contact and pass a reference to a second instance. Based on the result, the relative sort order of the two objects can be determined.
    e.g.Contact c1 = new Contact("Smith", "John");
    Contact c2 = new Contact("Jones", "Alan");
    int x = c1.compareTo(c2);In your example, you can implement compareTo() to use the corresponding method in String. For compatibility, you should also implement equals().
    public class Contact implements Comparable {
       public int compareTo(Object otherContact) {
           Contact otherC = (Contact) otherContact;  // could throw exception
           return getLName().compareTo(otherC.getLName());
       public boolean equals(Object otherContact) {
           Contact otherC = (Contact) otherContact;  // could throw exception
           return getLName().equals(otherC.getLName());
    } // end of class Contact I haven't compiled or tested the above code nor does it deal with exceptions (e.g. otherContact is not an instance of Contact) - I'll leave that to you! You'll also need to change your PhoneBook sort routine to invoke firstContact.compareTo(secondContact)
    FYI - I understand that this is an academic exercise and so you may need to code the sort yourself, but once Contact implements Comparable, you could sort the Vector using standard Java methods. Check out java.util.Collections - there is a method that will perform your sort in one line of code.
    Good Luck.

  • Why do I get a class conflict between the Prepare SQL.vi and the Get Column Name.vi with the SQL Toolkit compatibility vis from the Database Connectivity Toolkit?

    I have done extensive programming with the SQL Toolkit with LabVIEW versions through 6.1. My customer now wants to upgrade to Windows 7, so I am trying to upgrade to LabVIEW 2009 (my latest purchased version) using the Database Connectivity Toolkit, and the SQL Toolkit Compatibility vis. Everything seemed to be going okay with the higher level SQL operations, but I ran into trouble with the Get Column Name.vi. 
    The pictures below show the problem. The original SQL Toolkit connected the Prepare SQL.vi with the Get Column Name.vi with a cluster of two references, one for connection, and one for sql. The new compatibility vis have a class conflict in the wire because the Prepare SQL.vi contains a cluster with connection, and command references, but the Get Column Name.vi expects a cluster with connection and recordset references. 
    How do I resolve this conflict?
    Thank You.
    Dan

    I've never worked with the old version of the toolkit, so I don't know how it did things, but looking inside the SQL prep VI, it only generates a command, and the the column name VI wants a recordset. I'm not super familiar with all the internals of ADO, but my understanding is that is standard - you only have the columns after you execute the command and get the recordset back. What you can apparently do here is insert the Execute Prepared SQL VI in the middle and that will return what you need.
    I'm not sure why it worked before. Maybe the execute was hidden inside the prep VI or maybe you can get the column names out of the command object before execution. In general, I would recommend considering switching to the newer VIs.
    Try to take over the world!

  • How can I export a PDF form and the filled in fields to a text document?

    OK, so I have a situation.  I need people to be able to open a reader-enabled PDF form, fill out the form fields, and then export the filled-out PDF form to a basic text document.  This seems easy since Adobe Reader can save to text.  The problem is, the answers in the form fields do not show in the text file!  Each radio button shows as yes and no, and there is no indication in the text file which one was selected.  In addition, the form fields are not exported next to the questions on the form.  I tried flattening the form in Adobe pro, and that did not work either.
    How can I create a fillable form for Adobe Reader, and then let the user export their answers AND the questions on the form to plain text?

    OK, so I tried this as a starting point, and assigned it to a button on page 3 of the form.
    p=0;
    console.show();
    console.clear();
    for (var j = 0; j < this.getPageNumWords(p);j++) {
          var word = this.getPageNthWord(p,j,false);
          console.println(word);
    This gives me all the words on the first page not in fields, and each word goes on a separate line.  Now, characters in the document such as "&" or ")" cause the rest of the word to go on the next line down.
    Next, I tried this:
    console.show();
    console.clear();
    for (var j = 0; j < this.getPageNthWord(j);j++)
          var word = this.getPageNthWord(j,false);
          console.println(word);
    This only gives me the first word on page 3, the page the button is placed?
    What I need to do is run the code and place words on one line until the code hits a keyword "var cKeyWord1 = “Key1” for example?, then insert the value of field one, Start a new line in the console, restart the code where it left off until it hits the next key word "var cKeyWord2 = “Key2”, insert the value of field two, add a new line, and on and on.
    Is this possible?

Maybe you are looking for

  • How to get the index of a row in dynamically generated list

    Hi, I am displaying a list which contains 6 rows using <logic:iterator/> If i am changing a text value which is in 3 row, I want to pass that row index to the javascript function. I am using IndexId attribute of <logic:iterator> to get the index of a

  • The query column CANDIDATE ID appears in cfdump but not cfoutput query=queryname

    I've done this a thousand times.  I have a stored proc that returns data.  I give the resultset a name.  I output it with cfoutput query =queryname.  Now it's failing for every column in the query.  But if I do a cfdump with the queryname as a var, I

  • Why after uploading to FTP does the site page appear then disappear?

    Hello Everybody, I am an amateur when it comes to Muse but am capable of making minor text and image changes, saving as HTML, then uploading to my FTP server.  I have an accordion menu on my main page that I had previously made some changes to by add

  • HT1430 the ios 5.1 update froze my i phone 3gs... how do i re activate my phone??

    i went to upload IOS 5.1 on my i phone 3s (because it said i had to in order to download certain apps) and now my phone is not recognizing my sd card and it's saying i need to activate my phone... but it wont activate.  does anyone know how to restor

  • Scrollbar in a JComboBox ???

    Hi All, I have to fill up a JComboBox with some Strings, but some Strings are too long and when they are displayed the appear truncked (on the left side, of course g). Is ther any way to add a scrollbar on the bottom of the opened JComboBox so you ca