I've run into this error before. This usually means that some
function used is a Javascript builtin function (or statement). So
odds are, either add() or eq() are functions or statements in
Javascript.
I ran into this problem with a Java method I called delete(). So I'm
guessing that your add() call is the problem. Change the call to
something like this and see if it works:
criteria["add"](Expression.eq("status", "UNCONFIRMED"));
- Brent
On Wed, 26 Jan 2005 10:14:12 -0500, JD Daniels <[EMAIL PROTECTED]> wrote:
> 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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]