Hi all,

I am trying to add criteria inside a flowscript. Here is what i think should work:

1        var criteria = hs.createCriteria(Bug.class);
2       criteria.add(Expression.eq("status", "UNCONFIRMED"));
3        var bug = criteria.list();

this spits out : missing name after . operator on line 1

I have tried variations of switching to the the [""] syntax of calling methods, but while they fix the error, criteria is always undefined.

Anyone have insight into how i can call these methods in flow?

full function:

function search_bug()
{
       // Create The Form
       var form = new Form("forms/bugSearchModel.xml");

       // Set Some Form Specific Text Fields
       var model = form.getWidget();
       model.buttonText = "Search";
       model.title = "Search Bug Database";

       form.showForm("internal/show-form/bugSearch");

// Create Hibernate Session
var factory = cocoon.getComponent(Packages.com.kismetsoftware.insecticide.PersistenceFactory.ROLE);
var hs = factory.createSession();


// Might as well quit now if the session is no good :(
if (hs == null){throw new Packages.org.apache.cocoon.ProcessingException("Hibernate session is null ");}


       // This is problem Line:
       var criteria = hs.createCriteria(Bug.class);
       criteria.add(Expression.eq("status", "UNCONFIRMED"));
       var bug = criteria.list();

       // Clean Up Our Mess :)
       hs.flush();
       hs.close();
       cocoon.releaseComponent(factory);

// Send The User Their Result
cocoon.sendPage("internal/generate-view/bug_summary", {title : "Bugs",bug : bug});
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to