Have you followed the tutorial here
http://tacos.sourceforge.net/userguide/Debugging.html on installing and
using the debug console?

It is very hard to be completely sure without more information, but I would
definitely start with that..I also noticed your code pasted earlier had a
selectItem binding, but your currSelected method was checking a set or map
instance instead. Maybe you are setting the selectItem manually into the set
from another method but I would double check.

The debug console will reveal everything on the client side for you though,
so hopefully all doubt will be eliminated once you have debugging on the
client & server covered.

On 1/10/06, Chris Chiappone <[EMAIL PROTECTED]> wrote:
>
> Jesse,
> Thanks for the input.  You were correct in that by wrapping my
> currCase.id in a String would fix the problem.  So currently it seems
> to be working except for the linkToggle listener.
>
> I have been staring for hours at this code and still cannot under
> stand why my currSelected never returns true.  My page correctly
> displays the selectedItems since its notempty so I know that the
> collection should contain my object, but It doesn't seem to.  I know
> i'm probably missing something simple but i can't seem to find it.
>
> Here is my html page just so you can see whats going on, and where I
> may be having my issue.  Thanks for the help.
>
>                 <div jwcid="[EMAIL PROTECTED]" id="selectedCases"><span
>                                                                 jwcid="@If"
> condition="ognl:not selectedItems.empty">
>                                                         <h3>Selected
> Cases</h3>
>                                                         <ul>
>                                                                 <li
> jwcid="@tacos:PartialFor" source="ognl:selectedItems"
>                                                                         
> value="ognl:selectItem"
> element="li"><span jwcid="@Insert"
>
>                                                                         
> value="ognl:
> selectItem.id" /></li>
>                                                         </ul>
>                                                         </span></div>
>                                                         <div
> id="status"></div>
>                                                         <div
> id="cases"><span jwcid="foreachCase">
>                                                         <div jwcid="@Any"
> class="ognl:beans.evenOdd.next"
>                                                                 id="ognl:
> currCase.id">
>
>                                                         <div><a
> jwcid="linkToggle" class="toggle"> <span jwcid="@Insert"
>                                                                 
> value="ognl:currSelected
> ? 'Hide' : 'Details'" /></a> <span
>                                                                 
> jwcid="@Insert"
> value="ognl:currCase.id"
>                                                                 
> class="ognl:currSelected
> ? 'detailHeading' : 'heading'" /></div>
>
>                                                         <span jwcid="@If"
> condition="ognl:currSelected">
>                                                         <div
> class="caseDetail">
>                                                         <div
> class="acase"><!-- <img jwcid="flagImage" width="34"
> height="18" />--><br />
>                                                         <span
> jwcid="@Insert" value="ognl:currCase.id" /></div>
>           Show stuff...                                         </div>
>                                                         </span></div>
>                                                         </span></div>
>
>                                                         <div
> id="partialWait">Processing...</div>
>
>
> On 1/10/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
> > Hmm...That is a weird exception..Javadocs says it's because two
> different
> > types of objects are being bound into the array. It may be an oversight
> on
> > my part for the updateComponents binding, but I am guessing that
> > currCase.idis an integer or some other none string data that isn't
> > getting interpreted
> > properly.
> >
> > For the time being can you wrap java.lang.String.valueOf(currCase.id) to
> see
> > if it fixes it? I'll revisit the way I'm taking updateComponents
> parameter
> > in if that is the case.
> >
> > On 1/10/06, Chris Chiappone <[EMAIL PROTECTED]> wrote:
> > >
> > > Sorry I wrote too soon, I didn't put '{ }' around the updateComponents
> > > binding.
> > > Unfortunately I still get an exception.  This time without much debug
> > > that I can make sense of:
> > >
> > > org.apache.hivemind.ApplicationRuntimeException
> > >
> > > component: [EMAIL PROTECTED]
> > > location: context:/InvestigationsConsole.html
> > >
> > > java.lang.ArrayStoreException
> > >
> > > Stack Trace:
> > > java.lang.System.arraycopy(Native Method)
> > > java.util.ArrayList.toArray(ArrayList.java:305)
> > > net.sf.tacos.ajax.components.AjaxDirectLink.getLink(
> AjaxDirectLink.java
> > > :69)
> > > org.apache.tapestry.link.DefaultLinkRenderer.constructURL(
> > > DefaultLinkRenderer.java:112)
> > > org.apache.tapestry.link.DefaultLinkRenderer.renderLink(
> > > DefaultLinkRenderer.java:62)
> > > org.apache.tapestry.link.AbstractLinkComponent.renderComponent(
> > > AbstractLinkComponent.java:95)
> > > org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :617)
> > > org.apache.tapestry.AbstractComponent.renderBody(
> AbstractComponent.java
> > > :434)
> > > net.sf.tacos.ajax.components.PartialForBean.renderComponent(
> > > PartialForBean.java:201)
> > > $PartialForBean_21.renderComponent($PartialForBean_21.java)
> > > org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :617)
> > > org.apache.tapestry.AbstractComponent.renderBody(
> AbstractComponent.java
> > > :434)
> > > org.apache.tapestry.components.IfBean.renderComponent(IfBean.java:86)
> > > $IfBean_5.renderComponent($IfBean_5.java)
> > > org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :617)
> > > org.apache.tapestry.AbstractComponent.renderBody(
> AbstractComponent.java
> > > :434)
> > > org.apache.tapestry.components.RenderBody.renderComponent(
> RenderBody.java
> > > :44)
> > > $RenderBody_17.renderComponent($RenderBody_17.java)
> > > org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :617)
> > > org.apache.tapestry.AbstractComponent.renderBody(
> AbstractComponent.java
> > > :434)
> > > org.apache.tapestry.html.Body.renderComponent(Body.java:129)
> > > $Body_15.renderComponent($Body_15.java)
> > > org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :617)
> > > org.apache.tapestry.AbstractComponent.renderBody(
> AbstractComponent.java
> > > :434)
> > > org.apache.tapestry.html.Shell.renderComponent(Shell.java:114)
> > >
> > >
> > >
> > > On 1/10/06, Chris Chiappone <[EMAIL PROTECTED]> wrote:
> > > > Hi I am trying to get the use the tacos AjaxDirectLink component.  I
> > > > pretty much using the example given on the website except
> substituting
> > > > the .page specs in annotations.
> > > > Here is the following exception I am getting:
> > > >
> > > > org.apache.tapestry.BindingException
> > > > Error converting value for parameter updateComponents: No type
> > > > converter for type java.util.Collection is available.
> > > > binding:ExpressionBinding[InvestigationsConsole 'selectedCases',
> > > currCase.id]
> > > > component:[EMAIL PROTECTED]
> > > > location:
> > > >
> > > > Annotation @org.apache.tapestry.annotations.Component
> > > (inheritInformalParameters=false,
> > > > bindings=[listener=listener:toggleCase, parameters=ognl:currCase.id,
> > > > updateComponents=ognl:'selectedCases', currCase.id,
> > > > effects=template:{highlight:{selectedCases:'[255,255,184], 500,
> > > > 500','${currCase}':'[255,255,184], 500, 500'}},
> > > > statusElement=literal:status], id=linkToggle,
> > > > type=tacos:AjaxDirectLink) of public abstract
> > > > net.sf.tacos.ajax.components.AjaxDirectLink
> > > > view.pages.InvestigationsConsole.getLinkToggle()
> > > >
> > > > Here is my code for my page:
> > > >
> > > > public abstract class InvestigationsConsole extends SecuredPage
> > > implements
> > > >                PageBeginRenderListener {
> > > >
> > > >        public void pageBeginRender(PageEvent arg0) {
> > > >                ICaseHome caseHome = getCaseHome();
> > > >
> > > >                Collection<TrCase> cases = caseHome
> > >
> > >
> >                                
> > .findCasesBySupportId(getVisitObject().getPortaluser()
> > > >                                                .getSupportid());
> > > >
> > > >                if (cases.size() > 0) {
> > > >                        setOpenCases(true);
> > > >                } else {
> > > >                        setOpenCases(false);
> > > >                }
> > > >        }
> > > >
> > > >        protected void finishLoad(){
> > > >                log.info("Setting selected Items");
> > > >                setSelectedItems(new HashSet());
> > > >        }
> > > >
> > > >        public void toggleCase(IRequestCycle irc) {
> > > >                long caseid = (Long) irc.getListenerParameters()[0];
> > > >                TrCase trCase = getCaseHome().findCaseById(caseid);
> > > >                Set c = getSelectedItems();
> > > >                if (c.contains(trCase)) {
> > > >                        c.remove(trCase);
> > > >                } else {
> > > >                        c.add(trCase);
> > > >                }
> > > >                setSelectedItems(c);
> > > >                AjaxWebRequest ajax = (AjaxWebRequest) irc
> > > >                                .getAttribute(
> AjaxWebRequest.AJAX_REQUEST
> > > );
> > > >                if (ajax != null)
> > > >                        ajax.addStatusResponse("Case selected..");
> > > >
> > > >        }
> > > >
> > > >        public List getCases(){
> > > >                return new ArrayList(getCaseHome()
> > >
> >                .findCasesBySupportId(getVisitObject().getPortaluser()
> > > >                                .getSupportid()));
> > > >        }
> > > >
> > > >
> > > >        //public abstract Collection<TrCase> getCases();
> > > >        //public abstract void setCases(Collection<TrCase> cases);
> > > >        @Persist
> > > >        public abstract Set getSelectedItems();
> > > >        public abstract void setSelectedItems(Set selectedItems);
> > > >
> > > >
> > > >        public void openCaseListener(IRequestCycle cycle) {
> > > >                cycle.activate(getOpenCasePage());
> > > >        }
> > > >
> > > >        public abstract boolean isOpenCases();
> > > >        public abstract void setOpenCases(boolean openCases);
> > > >        public boolean isCurrSelected() {
> > > >                return getSelectedItems().contains(getCurrCase());
> > > >        }
> > > >        public abstract TrCase getCurrCase();
> > > >        public abstract void setSelectItem(Object selectItem);
> > > >        public abstract Object getSelectItem();
> > > >
> > > >        // Annotations
> > > >        @InjectState("visit")
> > > >        public abstract Visit getVisitObject();
> > > >
> > > >        @InjectPage("OpenCase")
> > > >        public abstract IPage getOpenCasePage();
> > > >
> > > >        @InjectObject("service:trustedresponse.CaseHome")
> > > >        public abstract ICaseHome getCaseHome();
> > > >
> > > >        @InjectObject("service:tacos.AjaxWebRequest")
> > > >        public abstract AjaxWebRequest getAjaxRequest();
> > > >
> > > >        @Component(id="foreachCase", type="tacos:PartialFor",
> bindings =
> > > {
> > > >                "source=cases", "value=currCase"})
> > > >        public abstract PartialForBean getForeachCase();
> > > >
> > > >        @Component(id="linkToggle", type="tacos:AjaxDirectLink",
> > > >                        bindings = {"listener=listener:toggleCase",
> > > >                        "parameters=ognl:currCase.id",
> > > >                        "updateComponents=ognl:'selectedCases',
> > > currCase.id",
> > >
> >                        
> > "effects=template:{highlight:{selectedCases:'[255,255,184],
> > > 500,
> > > > 500','${currCase}':'[255,255,184], 500, 500'}}",
> > > >                        "statusElement=literal:status"})
> > > >        public abstract AjaxDirectLink getLinkToggle();
> > > >
> > > >
> > > > --
> > > > ~chris
> > > >
> > >
> > >
> > > --
> > > ~chris
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
>
>
> --
> ~chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to