• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
WOTable does not work for me with WO 5.4.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WOTable does not work for me with WO 5.4.2


  • Subject: WOTable does not work for me with WO 5.4.2
  • From: Francisc Simon <email@hidden>
  • Date: Tue, 8 Sep 2009 10:37:04 +0200

HIi @all,

i've followed this tutorial: http://wotutorial.furfly.com/downloads.html to create an WOTable but it does not show any results.
The results are in the NSArray object but they does not be displayed:

################ _MyTable #####################

package your.app.components;
// $LastChangedRevision: 5773 $ DO NOT EDIT.  Make changes to MyTable.java instead.
import com.webobjects.eoaccess.*;
import com.webobjects.eocontrol.*;
import com.webobjects.foundation.*;
import java.math.*;
import java.util.*;
import org.apache.log4j.Logger;

@SuppressWarnings("all")
public abstract class _MyTable extends  EOGenericRecord {
public static final String ENTITY_NAME = "MyTable";

// Attributes
public static final String ID_KEY = "id";
public static final String NAME_KEY = "name";

// Relationships

  private static Logger LOG = Logger.getLogger(_MyTable.class);

  public MyTable localInstanceIn(EOEditingContext editingContext) {
    MyTable localInstance = (MyTable)EOUtilities.localInstanceOfObject(editingContext, this);
    if (localInstance == null) {
      throw new IllegalStateException("You attempted to localInstance " + this + ", which has not yet committed.");
    }
    return localInstance;
  }

  public Long id() {
    return (Long) storedValueForKey("id");
  }

  public void setId(Long value) {
    if (_MyTable.LOG.isDebugEnabled()) {
     _MyTable.LOG.debug( "updating id from " + id() + " to " + value);
    }
    takeStoredValueForKey(value, "id");
  }

  public String name() {
    return (String) storedValueForKey("name");
  }

  public void setName(String value) {
    if (_MyTable.LOG.isDebugEnabled()) {
     _MyTable.LOG.debug( "updating name from " + name() + " to " + value);
    }
    takeStoredValueForKey(value, "name");
  }


  public static MyTable createMyTable(EOEditingContext editingContext, Long id
, String name
) {
    MyTable eo = (MyTable) EOUtilities.createAndInsertInstance(editingContext, _MyTable.ENTITY_NAME);    
eo.setId(id);
eo.setName(name);
    return eo;
  }

  public static NSArray<MyTable> fetchAllMyTables(EOEditingContext editingContext) {
    return _MyTable.fetchAllMyTables(editingContext, null);
  }

  public static NSArray<MyTable> fetchAllMyTables(EOEditingContext editingContext, NSArray<EOSortOrdering> sortOrderings) {
    return _MyTable.fetchMyTables(editingContext, null, sortOrderings);
  }

  public static NSArray<MyTable> fetchMyTables(EOEditingContext editingContext, EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings) {
    EOFetchSpecification fetchSpec = new EOFetchSpecification(_MyTable.ENTITY_NAME, qualifier, sortOrderings);
    fetchSpec.setIsDeep(true);
    NSArray<MyTable> eoObjects = (NSArray<MyTable>)editingContext.objectsWithFetchSpecification(fetchSpec);
    return eoObjects;
  }

  public static MyTable fetchMyTable(EOEditingContext editingContext, String keyName, Object value) {
    return _MyTable.fetchMyTable(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value));
  }

  public static MyTable fetchMyTable(EOEditingContext editingContext, EOQualifier qualifier) {
    NSArray<MyTable> eoObjects = _MyTable.fetchMyTables(editingContext, qualifier, null);
    MyTable eoObject;
    int count = eoObjects.count();
    if (count == 0) {
      eoObject = null;
    }
    else if (count == 1) {
      eoObject = (MyTable)eoObjects.objectAtIndex(0);
    }
    else {
      throw new IllegalStateException("There was more than one MyTable that matched the qualifier '" + qualifier + "'.");
    }
    return eoObject;
  }

  public static MyTable fetchRequiredMyTable(EOEditingContext editingContext, String keyName, Object value) {
    return _MyTable.fetchRequiredMyTable(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value));
  }

  public static MyTable fetchRequiredMyTable(EOEditingContext editingContext, EOQualifier qualifier) {
    MyTable eoObject = _MyTable.fetchMyTable(editingContext, qualifier);
    if (eoObject == null) {
      throw new NoSuchElementException("There was no MyTable that matched the qualifier '" + qualifier + "'.");
    }
    return eoObject;
  }

  public static MyTable localInstanceIn(EOEditingContext editingContext, MyTable eo) {
    MyTable localInstance = (eo == null) ? null : (MyTable)EOUtilities.localInstanceOfObject(editingContext, eo);
    if (localInstance == null && eo != null) {
      throw new IllegalStateException("You attempted to localInstance " + eo + ", which has not yet committed.");
    }
    return localInstance;
  }
}


################ MyTable ######################

package your.app.components;
import org.apache.log4j.Logger;

public class MyTable extends _MyTable {
  private static Logger log = Logger.getLogger(MyTable.class);
}

############## Main class ######################

// Generated by the WOLips Templateengine Plug-in at 07.09.2009 10:51:59
package your.app.components;

import com.webobjects.appserver.WOComponent;
import com.webobjects.appserver.WOContext;
import com.webobjects.eocontrol.EOFetchSpecification;
import com.webobjects.eocontrol.EOSortOrdering;
import com.webobjects.foundation.NSArray;
import com.webobjects.foundation.NSLog;

public class Main extends WOComponent {
private static final long serialVersionUID = 1L;
private NSArray fetchResult;
private MyTable aDisplayBoard;
public Main(WOContext context) {
super(context);
NSArray sortOrdering = new NSArray(new EOSortOrdering ("name", EOSortOrdering.CompareAscending)); 
EOFetchSpecification fs = new EOFetchSpecification ("MyTable", null, sortOrdering);
if(fs!=null){
fetchResult = session().defaultEditingContext().objectsWithFetchSpecification(fs);
NSLog.debug.appendln(fetchResult.toString());
}
}
public MyTable aDisplayBoard(){
return this.aDisplayBoard;
}
public void setADisplayBoard(MyTable newDisplayBoard) {
this.aDisplayBoard = newDisplayBoard;
}
public NSArray fetchResult(){
return fetchResult;
}
}

##################### WO ####################

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<webobject name="Table" />
<webobject name="Name"></webobject>:<br />
</body>
</html>

Table : WOTable { 
list = fetchResult; 
item = aDisplayBoard; 
maxColumns = 2; 
border = 1;
}

Name : WOString {
value = aDisplayBoard.name;
}

THX for help ..

Frank
:-)
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: WOTable does not work for me with WO 5.4.2
      • From: Ramsey Lee Gurley <email@hidden>
  • Prev by Date: Re: EOF inheritance
  • Next by Date: Re: WOTable does not work for me with WO 5.4.2
  • Previous by thread: FrontBase Error "Datatypes are not comparable or don't match"
  • Next by thread: Re: WOTable does not work for me with WO 5.4.2
  • Index(es):
    • Date
    • Thread