Problem - different classes in a custom list

Hi,
Im making a school project and must use this List-class, written by some of our teachers.
The problem is, the nodes in the list are type of Objects, and i must store multiple types of classes in the list.
Storing works fine, but when i want to do something with a specific item in the list, i cannot use it's methods since its now type Object. So everytime I want to use it, i have to cast the Object back to the class it was originally, and there are like 20 of them so thats hell of a lot if-clauses to check which type must i cast it to, and thats in every place that does something with the list.
Am I being extremely dumb here? Whats the proper way to do this?

ju551 wrote:
All the objects are kind of creatures that are inherited from the same abstract class.
Hmm did i get this right now... So if i make that ancestor class into an interface, I can just cast them everytime to that class and when i call its (abstract) methods it will invoke the real methods in the subclasses?Ah, you don't need an interface in that case. You can just cast all instances to the base class and call the methods that are available there. The methods in the subclasses will be called if they are overridden.
Kaj

Similar Messages

  • Problem refactor classes residing in different development components?

    Hi!
    In dc1 defined class "ClassExample" added to public part.
    When in dc2 apply refactoring for "ClassExample" to "ClassExampleNew" issue error message - Method to be renamed is binary.
    Support nwds refactoring classes defined in different dc?
    Wbr, Ivan.

    Hi Pooja,
    thank you very much for your response. But - the problem lies in custom portal development component. When I want to use some custom portal service in my web dynpro, I should write into sharing reference "PORTAL:vendor.com/MyAmazingService". MyAmazing service is name of development domponent (PAR type) deployed on portal before.
    No problem here - problem begins in developing this  custom portal service as development component. When I want to build my portal service as DC, there is problem of used libraries. It's not the same as classpath in NWDS (it would be nice if it will be connected, but it isn't). The classpath for DC build is generated from "used DC's" and that's the problem - how to add KM or RF classes as "used DC"? Where can I found them?
    I'm asking for correct design and component architecture - maybe my current attitude is wrong. Every example and tutorial works only with "create new project by this way..." "your first sample..." but some turorial for component architecture, making some reusable applications etc... I didn't found any.
    This helped me a little bit, but I want more:
    /people/chris.whealy/blog/2006/01/13/when-creating-a-java-web-dynpro-application-dont-use-the-project-type-quotweb-dynpro-projectquot
    A bit of (impractical) scripting for Web Dynpro
    Thanks,
    Martin

  • Sorting a list of different class objects

    Hi All ,
    How to sort a List a.which contains objects of different Classes, b. objects of same class . Is it possible to sort these by implementing Comparable interface .
    Thanks ,
    Rajesh Reddy

    rajeshreddyk wrote:
    Hi All ,
    How to sort a List a.which contains objects of different Classes, b. objects of same class . Is it possible to sort these by implementing Comparable interface .Well, if objects of different classes are kept in the same List and you want to sort them together they at least have that in common. They're Comparable-able. -:) To manifest that the different classes could all implement a Comparableable interface (or maybe Intercomparable would be a better choise of name.)

  • Problem in importing two different classes with same name...

    I have to import two different classes in my program with the same name....
    import org.apache.lucene.document.Document;
    import org.w3c.dom.Document;
    //    I AM USING THE DOCUMENT FROM W3C PACKAGE HERE....
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                     DocumentBuilder builder = factory.newDocumentBuilder();
                     InputSource is = new InputSource( new StringReader( tempString ) );
                     d = builder.parse( is );
                     NodeList images = d.getElementsByTagName("img");
                     int length = images.getLength();
                     for(int i = 0;i<length;i++)
                         Node image = images.item(i);
                         String tempAltText = image.getAttributes().getNamedItem("alt").getNodeValue();
                         altText = altText.concat(" ").concat(tempAltText);
                     }and the error i am getting is
    [javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:20: org.apache.lucene.document.Document is already defined in a single-type import
        [javac] import org.w3c.dom.Document;
        [javac] ^
        [javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:132: incompatible types
        [javac] found   : org.w3c.dom.Document
        [javac] required: org.apache.lucene.document.Document
        [javac] d = builder.parse( is );
        [javac] ^
        [javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:133: cannot find symbol
        [javac] symbol  : method getElementsByTagName(java.lang.String)
        [javac] location: class org.apache.lucene.document.Document
        [javac] NodeList images = d.getElementsByTagName("img");
        [javac] ^
        [javac] Note: Some input files use unchecked or unsafe operations.
        [javac] Note: Recompile with -Xlint:unchecked for details.
        [javac] 3 errorsany idea ..how to resolve it
    Edited by: ping.sumit on Jul 16, 2008 3:39 PM
    Edited by: ping.sumit on Jul 16, 2008 3:40 PM

    now i changed the code to
    import org.apache.lucene.document.Document;
    import org.w3c.dom.Document;
    org.w3c.dom.Document d = null;
    try{
         System.out.println("in author");
                   URL url = new java.net.URL(urlString);
                   java.net.URLConnection conn = url.openConnection();
                   BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                   while ((in.readLine()) != null)
                        //tempString = tempString.concat(in.readLine());
                        String temp = in.readLine();
                        tempString = tempString + " " + temp;
                   System.out.println("the string in author" + tempString);
                    in.close();
                    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                     DocumentBuilder builder = factory.newDocumentBuilder();
                     InputSource is = new InputSource( new StringReader( tempString ) );
                     d = builder.parse( is );
                     NodeList images = d.getElementsByTagName("img");and their is only one error i am getting ...and that is
    [javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:20: org.apache.lucene.document.Document is already defined in a single-type import
        [javac] import org.w3c.dom.Document;
        [javac] ^
        [javac] Note: Some input files use unchecked or unsafe operations.
        [javac] Note: Recompile with -Xlint:unchecked for details.
        [javac] 1 error

  • Different classes problems

    I posted a topic asking for feedback on a Vigenere Cipher program I made. It was said that I shouldn't have the entire program in one class, and should have different class... or methods?
    I've been reading the tutorial for different classes, but I just can't seem to pick it up. I anticipate I'm gonna get a few replies with people saying 'you should read this smelly student' but I've tried, so I figure this may be a way to break me in :).
    So, here's my code:
    public class VigenereCipherComplete
         public static void main(String[] args)
         String key, message;
         String encrMessage = "";
         String[] options = new String[] {"Encrypter", "Decrypter", "Cancel"};
         int progChoice, keyLength, length, encrCharValue;
         int index;
         int keyIndex = 0;
         char keyChar;
         char messageChar;
         char encrChar;
         boolean shouldEncrypt = true;
         // Choice of whether to use the encrypter of decrypter
            progChoice = JOptionPane.showOptionDialog(null, "Which would you like to run?", "Program choice",
                 JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
            if(progChoice == 0)
                 shouldEncrypt = true;
            else if(progChoice == 1)
                shouldEncrypt = false;
        else
           System.exit(0);
         // Input of key and converting it to upper case
         key = JOptionPane.showInputDialog(null, "Please input the key you wish to use:",
              "Key input", JOptionPane.QUESTION_MESSAGE);
         key = key.toUpperCase();
         // Input of message and converting it to upper case
         message = JOptionPane.showInputDialog(null, "Please input the plaintext you wish to use:",
              "Plaintext input", JOptionPane.QUESTION_MESSAGE);
         message = message.toUpperCase();     
         keyLength = key.length();
         length = message.length();
         // Encryption/decryption
         for(index = 0; index < length; index++)
              keyChar = key.charAt(keyIndex);
              messageChar = message.charAt(index);
              if(messageChar >= 'A' && messageChar <= 'Z')
                   // Encryption
                   if(shouldEncrypt)     
                        encrCharValue = (keyChar - 'A') + messageChar;
                   // Decryption
                   else
                        if(messageChar >= keyChar)
                             encrCharValue = (messageChar + 'A') - keyChar;
                        else
                             encrCharValue = ((('Z' - keyChar) + messageChar) + 1);
                   // Loops ascii char value larger than 90 so it stays within the 65-90 ascii char range
                   if(encrCharValue > 'Z')
                        encrCharValue = (encrCharValue - 'Z') + 'A' - 1;
                   // Converts the char value to a char and adds it to the converted string
                   encrChar = (char)encrCharValue;
                   encrMessage = encrMessage + encrChar;
                   keyIndex++;     
              // If the char is not a letter, it leaves it as it is and adds it to the converted string     
              else
                   encrCharValue = messageChar;
                   encrChar = (char)encrCharValue;
                   encrMessage = encrMessage + encrChar;
              // Resets key so it will loop for the full string wanting to be converted
              if (keyIndex >= keyLength)
                   keyIndex = 0;
         // Output for encryption
         if(shouldEncrypt)
              System.out.println("Plaintext:\t" + message + "\nKey:\t\t" + key + "\nCiphertext:\t" + encrMessage);
         // Outfor for decryption
         else
              System.out.println("Ciphertext:\t" + message + "\nKey:\t\t" + key + "\nPlaintext:\t" + encrMessage);
    }I just can't grasp how I'd do this... Sorry for the ambigious question.

    I'm not going to read all your code. However, it's reasonable to put the code for one encryption algorithm into one class. If you were writing an entire encryption library, you might find that several of your algorithms (each in their own class) are all using the same code, and you're copying it from one class to another. In this case, you might extract that common code out to a utility class that various algorithms make use of.
    Now, if we assume that your question is, "How can I break this code into smaller pieces?" here are a few suggestions, based on a cursory skimming of your code. Note that these are only guidelines, to give you an idea of the kinds of things that make sense to break out as pieces.
    1. Keep the GUI separate from the encryption. You should have a VigenereEncryption or somesuch class that actually does the work of encrypting and decrypting, and this class should not know or care if there even is a GUI.
    2. In the VE class, I would imagine you'd want an encrypt() method and a decrypt() method.
    3. Anywhere you see multiple levels of nesting, one or more of those levels might be a candidate to pull out into its own method.
    4. Anywhere you have repeated code that's more than a couple lines, put it in its own method.
    5. Anywhere you have a comment like // perform such and such step above a block of code, that block is a good candidate to get pulled out into its own method, named similar to whatever that step is in your comments.
    6. Similarly, when you learn what the high-level algorithm is that you're to be implementing, the steps of that algorithm are candidates to be their own methods.
    Again, note that this is not carved in stone and is not meant to be taken literally as "do exactly all of these things." Rather, it is to give you ideas about the kinds of things that make for separation of classes and methods.

  • Problem with inputText in my custom component

    Hi, I have a custom dataTable component that I'm trying to get to work. It has to be a custom component because dataTable doesn't support rowspan, colspan, multi line headers, and a rendered attribute for rows. The problem is, that when I wrap the column tag inside my row tag then the method for the inputText tag never gets called in the UPDATE_MODEL_VALUES phase.
    I'm starting to think that JSF doesn't support 2 levels of tags between the inputText and dataTable. I'm hoping that someone can tell me what I have wrong with my components.
    Here is the JSP snippet.
    <cjsf:rptTable>
         <cjsf:data id="dataTable1" value="#{allAuthUser.tableRows}" var="myTableRow1">
              <cjsf:row>
                   <cjsf:col>
                        <h:inputText id="tableTestFld" value="#{myTableRow1.testFld}" size="5" maxlength="5"/>
                   </cjsf:col>
              </cjsf:row>
         </cjsf:data>
    </cjsf:rptTable>Here is what it renders. It looks to me like everything renders fine. So I'm guessing that there is something in a component that is causing JSF during the life cycle to not be able to process correctly.
    <table>
         <tbody>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_0:tableTestFld" name="tblmaintForm:body:dataTable1_0:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_1:tableTestFld" name="tblmaintForm:body:dataTable1_1:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
              <tr>
                   <td><input id="tblmaintForm:body:dataTable1_2:tableTestFld" name="tblmaintForm:body:dataTable1_2:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
              </tr>
         </tbody>
    </table>Note: If I leave off the row tag it renders the same way except of course the <tr> and </tr> tags are missing. If I do this, then the backing method for the inputText tag is called and everything works fine. Why doesn't it work with the row tag in place?
    Here are the components:
    public class UIRptTable extends UIComponentBase {
         public UIRptTable() {
              setRendererType("tblmaint.rptTableRenderer");
         public String getFamily() {
              return "javax.faces.Output";
    public class UIRptTableData extends HtmlDataTable {
         public UIRptTableData() {
              setRendererType("tblmaint.rptTableDataRenderer");
         public String getFamily() {
              return "javax.faces.Data";
    public class UIRptTableRow extends UIOutput {
         public UIRptTableRow() {
              setRendererType("tblmaint.rptTableRowRenderer");
         public String getFamily() {
              return "javax.faces.Output";
    public class UIRptTableCol extends UIColumn {
         public UIRptTableCol() {
              setRendererType("tblmaint.rptTableColRenderer");
         public String getFamily() {
              return "javax.faces.Column";
    }Here is part of the faces-config file in case you need it.
    <!-- Components -->
    <component>
         <component-type>tblmaint.rptTable</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTable</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableData</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableData</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableRow</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableRow</component-class>
    </component>
    <component>
         <component-type>tblmaint.rptTableCol</component-type>
         <component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableCol</component-class>
    </component>
    <!-- Render Kits -->
    <render-kit>
         <renderer>
              <component-family>javax.faces.Output</component-family>
              <renderer-type>tblmaint.rptTableRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Data</component-family>
              <renderer-type>tblmaint.rptTableDataRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableDataRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Output</component-family>
              <renderer-type>tblmaint.rptTableRowRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableRowRenderer</renderer-class>
         </renderer>
    </render-kit>
    <render-kit>
         <renderer>
              <component-family>javax.faces.Column</component-family>
              <renderer-type>tblmaint.rptTableColRenderer</renderer-type>
              <renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableColRenderer</renderer-class>
         </renderer>
    </render-kit>I sure hope that someone can help me out. Please let me know if you need any additional information.
    Thanks,
    Ray

    Hi, Ray!
    1) I was trying to put a button in the column header (for sorting) and I couldn't get that to work. That involved the >colhdr tag. I got that to work but I don't remember the fix. I'll look it up and reply back with that when I can.Dealing the first part of your trouble, you need NOT a custom component.
    I have looked through the implementation of RepeaterRenderer, as you advised me, and found that the multi-header possibility is included in the implementation of dataTable control.
    The code below is the part of source of repeater.jsp with only change:
    <d:data_repeater> &#61664; <h:dataTable>
    And it works fine.
    <h:dataTable id="table"
    binding="#{RepeaterBean.data}"
         rows="5"
    value="#{RepeaterBean.customers}"
    var="customer">
    <f:facet name="header">
    <h:outputText value="Customer List"/>               <!� First Header row -- >
    </f:facet>
    <h:column>
    <%-- Visible checkbox for selection --%>
    <h:selectBooleanCheckbox
    id="checked"
    binding="#{RepeaterBean.checked}"/>
    <%-- Invisible checkbox for "created" flag --%>
    <h:selectBooleanCheckbox
    id="created"
    binding="#{RepeaterBean.created}"
    rendered="false"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Account Id"/>               <!�Second Header row -- >
    </f:facet>
    <h:inputText id="accountId"
    binding="#{RepeaterBean.accountId}"
    required="true"
    size="6"
    value="#{customer.accountId}">
    </h:inputText>
    <h:message for="accountId"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Customer Name"/>               <!�Second Header row -- >
    </f:facet>
    <h:inputText id="name"
    required="true"
    size="50"
    value="#{customer.name}">
    </h:inputText>
    <h:message for="name"/>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Symbol"/>
    </f:facet>
    <h:inputText id="symbol"
    required="true"
    size="6"
    value="#{customer.symbol}">
    <f:validateLength
    maximum="6"
    minimum="2"/>
    </h:inputText>
    <h:message for="symbol"/>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Total Sales"/>
    </f:facet>
    <h:outputText id="totalSales"
    value="#{customer.totalSales}">
    <f:convertNumber
    type="currency"/>
    </h:outputText>
    </h:column>
    <h:column>
    <f:facet name="header">                    <!�Second Header row -- >
    <h:outputText value="Commands"/>
    </f:facet>
    <h:commandButton id="press"
    action="#{RepeaterBean.press}"
    immediate="true"
    value="#{RepeaterBean.pressLabel}"
    type="SUBMIT"/>
    <h:commandLink id="click"
    action="#{RepeaterBean.click}"
    immediate="true">
    <h:outputText
    value="Click"/>
    </h:commandLink>
    </h:column>
    </h:dataTable>
    You may have a look at HTML source to prove that dataTable is already what you need:
    <table id="myform:table">
    <thead>
    <tr><th colspan="6" scope="colgroup">Customer List</th></tr>
    <tr>
    <th scope="col"></th>
    <th scope="col">Account Id</th>
    <th scope="col">Customer Name</th>
    <th scope="col">Symbol</th>
    <th scope="col">Total Sales</th>
    <th scope="col">Commands</th>
    </tr>
    </thead>
    <tbody>
    2.) The second trouble is still unsettled as previously. Right now I have different task at my job, and I can�t continue investigation of this problem.
    But when you find smth., please let me know. I�ll be very grateful.
    Regards,
    Oleksa Stelmakh

  • Can't call or execute of different class files in a main program

    Hi, I got a main program which can call 3 different classes. The main program have an implicit-choice List as a starting menu. If one of the file is selected, the files will call out and display it. However, i managed to call the 1st 2 files, and the 3rd files can't display anything after selected.
    I enclosed my code as below:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class Catalogues extends Form implements CommandListener {
         private Displayable parent;
         private Display display;
         private List Cata;
         private Boots bo;
         private Higheels hHeels;
         private Sandals sand;
         private Slippers sp;
        private Command backCommand = new Command("Back", Command.BACK, 1);
        private Command viewCommand = new Command("View", Command.SCREEN, 1);
        private String[] options = {"Boots", "High Heels","Sandals", "Slippers"};
         public Catalogues(Display d, Displayable p) {
              super("Welcome to Footwear World");
              Cata = new List("Select Option", List.IMPLICIT, options, null);
              display = d;
            parent = p;
              addCommand(backCommand);
              addCommand(viewCommand);
              setCommandListener(this);
         public void commandAction(Command c, Displayable d) {
         if(d==parent && c==List.SELECT_COMMAND){
              switch(parent.getSelectedIndex()){
                   case 0:
                           if(bo==null){
                              bo = new Boots(display,parent);
                             display.setCurrent(bo);
                              break;
                   case 1:
                           if(hHeels==null){
                              hHeels = new Higheels(display,parent);
                             display.setCurrent(hHeels);
                              break;
                   case 2:
                           if(sand==null){
                              sand = new Sandals(display,parent);
                             display.setCurrent(sand);
                              break;
                   case 3:
                           if(sp==null){
                              sp = new Slippers(display,parent);
                             display.setCurrent(sp);
                              break;
                   default:
             else if (c==backCommand) {
                       display.setCurrent(parent);
    }If the 3rd option is selected, i'll display above mentioned layout which contain a list to select too.
    After build this project on WToolkit. It shown an error message which is as below:
    Project settings saved
    Building "SelectCustest"
    C:\WTK22\apps\SelectCustest\src\Catalogues.java:29: cannot resolve symbol
    symbol : method getSelectedIndex ()
    location: class javax.microedition.lcdui.Displayable
    switch(parent.getSelectedIndex()){
    ^
    1 error
    com.sun.kvem.ktools.ExecutionException
    Build failed
    May i know what is problem am i facing now? And how to solve it.
    Thanks.

    Thanks to all for your thoughts and replies. I liked the xargs suggestion, so I tried that first. I would have (may still) try the stdin suggestion, followed by writing the grep output to a file.
    xargs does work, in a way I didn't expect it to, but that could be due to my inexperience with the workings of the shell.
    here's a line from my test script
    cat file | grep foo | xargs java com.company.test.TEchoArghere's the contents of 'file'
    123foo
    abc
    qafoozv
    qaz
    wsx
    qwefoort
    zxcfooh
    sdfghhere's the output from the test class, which just echos any arguments
    ::number of args: 4
    ::args[0] 123foo
    ::args[1] qafoozv
    ::args[2] qwefoort
    ::args[3] zxcfoohso xargs appends all the values from grep into an argument list and call the java class once.
    when I took xargs out of the script, nothing was passed to the class:
    ::number of args: 0this was really interesting and something to keep in my back pocket for future use.
    Thanks again to all.
    Tom

  • SP Designer 2010 - Saving custom list form impacts other list and other custom list form

    Hi,
    I have a source list, with custom display, edit and new forms all of them created in SP Designer 2010. These do nothing fancy, just for presentation purposes, fields were re-arranged in 2 columns.
    Then I created a target list by saving the source list as template, the template brought over all customizations, all seemed to work fine. So I started to modify the target custom list forms.
    Now here's the problem:
    After a while making changes to the target list I realized that somehow the custom list forms on the source list had been modified... so I opened the source list in designer and noticed that the out of the box forms: NewForm.aspx, DispForm.aspx, EditForm.aspx
    were now the default forms for the source list, and I couldn't pick my custom list forms to be the default forms for the source list anymore, they were not on the listbox. I could still see them by going in designer to All Files > Lists > SourceList
    > and if I previewed them, they were empty. 
    I believe that somehow source and target list are linked, but why would designer allow making changes to the source list? like resetting the default forms, and breaking up the custom list forms that were in place?
    I've verified list id's in the custom list forms of the target list and they belong to the GUID of the target list. I don't see anything else that could potentially point to the source list.
    SharePoint Designer 2010 version: 14.0.7007.1000 SP2 14.0.7015.1000 I don't think this matters much because I've tried with other SP Designer 2010 versions and the error is the same.
    thanks for your reply!

    Hi alec,
    When I create a custom EditForm1.aspx and set as default for a source list, then save this list as a template, then the newly created the target list based off this saved template, the source list still uses the custom EditForm1.aspx form as default
    form, from SharePoint designer, I can see these two lists have different listID, so they have no connection when I edit any one of them.
    Please recreate a new list with custom form page and save as template, then create a new list see if this issue could be reproduced, or we can create a new list instead if it is an isolate issue.
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Daniel Yang
    TechNet Community Support

  • Help sought customizing a SP 2010 custom list template

    I am forced to use InfoPath 2010 to edit and then publish the form for a custom list, due to problems that SP 2010 has displaying a set of lookup columns on the form.
    Now that I have made the initial change, there are some other customizations that the users would like.
    I have a source list for a look up column.
    The source list has:
    Department number - ie 27
    Department name - ie Standards
    Department division - ie Technical
    as individual columns.
    The current column is defined to use Department name. The users have asked if the dropdown could instead display the data as:
    D27 - Standards - Technical
    When I tried to create a calculated column that concatenated all of those on the source list, I found myself unable to submit new items for the list - SharePoint kept reporting that I needed a positive integer as a selection value for the dropdown.
    Ideally what I want is the department number as the value for the dropdown, but the concatenated parts to be used as the display value of the lookup.
    I have not been able to figure out how to do that.
    Is there something simple that I am missing? When I look at the property of the dropdown, there isn't a way to add a formula to the display name of the data source/entries portion of the properties.

    So after some work, I changed the number column to a text column in the list.
    The control for selecting information on that control is not working properly now.
    It is a drop down listbox control.
    Its properties are:
    cannot be blank
    get choices from an external data source
    data source is my sharepoint list that contains department number (text field now), department name, division name
    entries is set to myFields->dataFields->d:SharePointListItem_RW - that is how it came out of the box, so I am assuming that it is correct
    Value is set to d:SharePointListItem_RW->Department Number
    Display name is set to d:SharePointListITem_RW->Department Name
    When I attempt to use the form, the control is populated with the department names.
    However, the last entry of the list is selected. Normally there would be nothing selected.
    Even worse, if I select something else in the control, something causes the last entry in the list to be selected.
    I don't know why something is causing a different item to be selected. There are no rules set on this form as far as I am aware.

  • So this is new... InfoPath 2013 on SharePoint 2013: Create a New Custom List, Edit Form in InfoPath, Attempt to Publish and...

    InfoPath blows up with an error message saying "Invalid form template"...
    No, I do not have any added data connections in the form.
    No, I have not added any fields or done any modifications of any kind to the form.
    I am doing exactly these steps:
    Open SPD
    Create a New Custom List
    Open List in SPD
    Click "Design Forms in InfoPath" (Item)
    Form opens in InfoPath 2013
    Click Publish (or Quick Publish...doesn't matter)
    See error message
    This wasn't a problem in my environment liiike, a week ago..? The only thing that's different is that I installed some security patches on the servers this morning...
    KB2737989
    KB2956153
    KB2956180
    KB2881078
    KB2760361
    KB2956175
    KB2956183
    KB2956143
    KB2920731
    KB2956181
    KB2760554
    KB2760508
    KB2880473
    KB3048778

    Hi ramz,
    Also you can try to check if there are more useful ULS logs related to InfoPath issue according to the time of this error "Invalid form template" occured, it could help troubleshoot the issue.
    http://blogs.msdn.com/b/opal/archive/2009/12/22/uls-viewer-for-sharepoint-2010-troubleshooting.aspx
    Thanks
    Daniel Yang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Create Custom List, store information and display the information on web part

    Hi,
    Working on a Custom visual web part in sharepoint 2010. Scenario is i would like to have two button on that web part, one is "I read it " button for users to tag the page and another one is "find the list of people who already tag/read that
    page". i have added a visual web part into my project and two buttons event within it. Now goal is once user click on "I read it button" it will create custom list to store urls and usersname. When click on "Find the list of people"
    get the username only for that specific page whoever read/tag it.
    1. How can i create the custom list to store all users information
    2. Retrieve the information from Custom List and Display the list of people based on specific page url who ever read/tag that page. 
    Any help will be greatly appreciated!

    Appreciated for your help!
    List has four columns Title, Hyperlink, Created by, and created. i just wanted to display Users and hyperlink column. i tried to retrieve the items from list but query is not returning any items and displaying. As you said in CAML query we can pass the page
    url to get the collection of user for that particular page. but is not something will be hard coded value, if we pass the page url into CAML query? is there something we can dynamically retrieve the users based on page url.  for example, if users visits
    30 different page url, i need to put all those urls into CAML Query. do i need to create custom user field or i can use Created by field to get the users? please correct me if i am wrong. Below is the code:
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using System.Data;
    namespace CustomUserControl.VisualWebPart1
        public partial class VisualWebPart1UserControl : UserControl
            protected void Page_Load(object sender, EventArgs e)
            protected void btnRead_Click(object sender, EventArgs e)
                using (SPSite site = new SPSite(SPContext.Current.Web.Site.ID))
                    using (SPWeb web = site.OpenWeb())
                        web.AllowUnsafeUpdates = true;
                        SPList list = web.Lists["UserInformation"];
                        SPListItem newItem = list.Items.Add();
                        SPFieldUrlValue hyper = new SPFieldUrlValue();
                        //hyper.Description = "Google";
                        hyper.Url = System.Web.HttpContext.Current.Request.Url.AbsoluteUri.ToString();
                        newItem["Hyperlink"] = hyper;
                        newItem.Update();
                        web.AllowUnsafeUpdates = false;
            protected void btnDisplay_Click(object sender, EventArgs e)
                SPWeb web = SPContext.Current.Web;
                SPList list = web.Lists["UserInformation"];
                SPQuery query = new SPQuery ();           
                query.Query = "<Where><Eq><FieldRef Name='Hyperlink' Type='URL' /><Value>http://nyc01d1sptmp01:8080/diligent/wiki/cft/Pages/home.aspx</Value></Eq></Where>";
                DataGrid grdList = new DataGrid();
                SPListItemCollection items = list.GetItems(query);
                DataTable table;
                table = new DataTable();
                table.Columns.Add("Title", typeof(string));
                table.Columns.Add("Hyperlink", typeof(string));
           table.Columns.Add("Created by", typeof(string));
                DataRow row;
                foreach (SPListItem result in items)
                    row = table.Rows.Add();
                    row["Title"] = result.Title;
                    row["Hyperlink"] = result.Name;
           SPFieldUser userField = (SPFieldUser)result.Fields.GetField("Users");
                    SPFieldUserValue userFieldValue = (SPFieldUserValue)userField.GetFieldValue(result["Users"].ToString());
                    SPUser user = userFieldValue.User;
                    string name = user.LoginName;
           row["Created by"] = name;
                grdList.DataSource = table.DefaultView;
                grdList.DataBind();

  • Integration between Custom list and task list

    Is it advisable to provide solutions for the integration between custom list and tasks list in SharePoint?
    I am working on a scenario where the data has to be segregated between multiple lists and there will be transactions among these lists using workflow. Some of the capabilities in Tasks list like due date notifications, calendar, tracking are needed
    on the transaction. Since these lists are based out of different content types, is it advisable to choose these lists for solutions?
    When we have to make few updates through workflow from custom list to tasks, will there be any problem in the transactions as it is two different content type?
    Vijayaragavan, MCTS

    Since SPLists and SharePoint workflows don't provide inherent
    support for transactions, you have to handle rollback operations yourself.
    The easiest way to simulate a transaction is to read in the state of any list item you are changing prior to executing an update, and then write that state back should you detect a failure. It's not a perfect solution, since a sufficiently severe error might
    prevent your rollback updates as well. That's the price you pay for not having the data store support transactions.
    That being said, while it's true many clients will ask for business critical data to be stored in SPLists, I would argue that it's your job to convince them that it's not a good idea, and that transactional databases accessed over webservices are a much safer
    SP compatible way to store important data - from
    stackoverflow
    [custom.development]

  • Swc problem with flex from my custom fla

    I have an fla which has several library items with a class linkage to a GenericButton.as file. I am exporting this fla as an swc file, and linking that swc into flex.
    My problem is that when flex builds the code for GenericButton it gets undefined property for anything it tries to reference that is part of the library item.
    Example:
    GenericButton.as does libLabel.text = "something"; where libLabel is a textfield, instantiated in the library clip which is bound to GenericButton in it's class linkage.
    The field exists in the clip, but when I compile in Flex with the swc in there, it cant find it. It says libLabel doesnt exist, undefined property.
    What am I missing here? I want to allow the fla author to bind some of his items to low-level component classes like that, and it's his job to ensure that all the necessary items are part of it. So if he makes a new button, he must just ensure he has a libLabel textfield somewhere in the clip.
    Why cant flex see that the items it's trying to compile have a libLabel in there? Is there a work around?

    Thx for the reply Greg, but no, that's not the problem.  If you re-read my post you'll probably see my problem is a little more involved than that.
    I have symbols exported for actionscript and I can instantiate them in Flex, that's not a problem.  The problem is symbols that are exported for actionscript and bound to a base class that contains custom code.  That custom code, when it uses it to type-check in flex builder (during the swc link stage), causes undefined properties.
    For some reason Flex is not seeing that the exported library item has the things the .as file is looking for.
    Does that make sense?
    I could probalby put together a simple example project but I'd have to find somewhere to upload it so that others could see.
    This problem is hard to describe, you have to read what I'm saying very carefully.

  • Problem with iChat changing my custom away message after 30 minutes

    Lately, I've been having a big problem with iChat changing any custom away message that I put up to "Away" after 30 minutes or so. Is there anything I can do to make it stop? Another issue I'm having is that sometimes when people on my buddy list change their away message, it doesn't show up on iChat unless I go offline and then sign back on. Any idea why it's doing that, and what I can do to get it to stop?
    Thanks.
    - Danielle
    G3 iMac   Mac OS X (10.3.9)  

    Hi ienjoyanime,
    Go to the General Section of iChat Preferences.
    Does it say you are set to Go to Away when you log off/QUit iChat ?
    is the computer going to Sleep at this point ?
    10:59 PM Saturday; April 1, 2006

  • Two equal objects, but different classes?

    When programming on binding Referenceable object with JDK version 1.5.0_06, I have encountered a very strange phenomenon: two objects are equal, but they belong to different classes!!!
    The source codes of the program bind_ref.java are listed as below:
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++
    import java.lang.*;
    import java.io.*;
    import java.util.*;
    import javax.naming.*;
    import javax.naming.spi.ObjectFactory;
    import java.util.Hashtable;
    public class bind_ref {
    public static void main( String[] args ) {
    // Set up environment for creating the initial context
    Hashtable env = new Hashtable();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory" );
    env.put( Context.PROVIDER_URL, "file:/daniel/" );
    Context ctx = null;
    File f = null;
    Fruit fruit1 = null, fruit2 = null;
    byte [] b = new byte[10];
    try {
    ctx = new InitialContext( env );
    Hashtable the_env = ctx.getEnvironment();
    Object [] keys = the_env.keySet().toArray();
    int key_sz = keys.length;
    fruit1 = new Fruit( "Orange" );
         SubReference ref1 = fruit1.getReference();
    ctx.rebind( "reference", fruit1 );
         fruit2 = ( Fruit )ctx.lookup( "reference" );
         System.out.println( "ref1's class = (" + ref1.getClass().toString() + ")" );
         System.out.println( "fruit2.myRef's class = (" + fruit2.myRef.getClass().toString() + ")" );
         System.out.println( "( ref1 instanceof SubReference ) = " + ( ref1 instanceof SubReference ) );
         System.out.println( "( fruit2.myRef instanceof SubReference ) = " + ( fruit2.myRef instanceof SubReference ) );
         System.out.println( "ref1.hashCode = " + ref1.hashCode() + ", fruit2.myRef.hashCode = " + fruit2.myRef.hashCode() );
         System.out.println( "ref1.equals( fruit2.myRef ) = " + ref1.equals( fruit2.myRef ) );
    } catch( Exception ne ) {
    System.err.println( "Exception: " + ne.toString() );
    System.exit( -1 );
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++
    All the outputs are shown as below:
    =======================================================
    Fruit: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
    SubReference: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
    --------- (i)subref.hashCode() = (-1759114666)
    SubReference: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
    --------- (i)subref.hashCode() = (-1759114666)
    FruitFactory: obj's class = (class javax.naming.Reference)
    FruitFactory: obj's hashCode = -1759114666
    FruitFactory: obj = (Reference Class Name: Fruit
    Type: fruit
    Content: Orange
    FruitFactory: ( obj instanceof SubReference ) = false
    FruitFactory: subref_class_name = (Fruit)
    Fruit: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
    ref1's class = (class SubReference)
    fruit2.myRef's class = (class javax.naming.Reference)
    ( ref1 instanceof SubReference ) = true
    ( fruit2.myRef instanceof SubReference ) = false
    ref1.hashCode = -1759114666, fruit2.myRef.hashCode = -1759114666
    ref1.equals( fruit2.myRef ) = true
    ========================================================
    I hightlight the critical codes and outputs related to the strangeness with bold texts.
    Who can tell me what happens? Is it really possible that two objects belonging to different classes are equal? If so, why that?

    It can also depend on how you implement the equals method.
    class Cat {
        String name;
        Cat(String n) {
            name = n;
    class Dog {
        String name;
        Dog(String n) {
            name = n;
        public boolean equals(Object o) {
            return name.equals(o.name);
        public static void main(String[] args) {
            Dog d = new Dog("Fred");
            Cat c = new Cat("Fred");
            System.out.println(d.equals(c));
    }

Maybe you are looking for

  • How can I navigate to a new page when after-submit process running proc

    I have a long running procedure and would like to provide the users with an animated gif to indicate progress that updates a description line to indicate the current step in the process. Currently I have a couple pages in this application in which a

  • Open purchase order list by user id

    Hi Experts, My job requirement is to pull a list of all open SRM purchase orders in backend ECC system by user id. In ME2N, I entered following information: -Scope of list=BEST -Selection parameters=WE101 -Document type=ECPO (for SRM purchase orders)

  • Need a form filling program for firefox that works like roboform

    when i use internet explorer i have roboform to fill the open data fields but in Firefox i use the automatic form filler, but it seems to only save data and want to reuse it if i have at least been on the site and filled out the fields at least once.

  • How to display time duration (NOT dates) with an input mask in a JTable?

    Background: I am trying to display in a JTable, in two columns, the start position and time duration of an audio clip. They are stored as type float internally eg. startPosition = 72.7 seconds. However I wish to display on screen in the table in HH:m

  • Dyanamic form generation based on list columns

    Hello all , How can i create a Sharepoint webpart for List form which is dyanamically create controls based on Selected field in view ... Suppose I am having one Sharepoint list ... In that there are 4 columns ... A -- as text box , B - Dropdown , C