Hello again,

I am trying to setup a Grid with checkboxes where the user can select several items and submit.

I wrote a CheckboxGroup/Checkbox set of components derived from the RadioGruop/Radio which enables me to render any number of checkboxes *all with the same name attribute*. The CheckboxGroup control has a value parameter (collection) and will put there all the selected items.

Say the page has the following

public ItemChooser {

private List<Item> avilableItems; // assume proper init, getters and setters
  private Set<Item> collectedItems; // here too
}

in ItemChooser.html:

<t:form>
  <t:checkboxgroup value="selectedItems">
    <t:grid source="availableItems" row="currentItem">
<t:parameter name="idCell" <!-- I render the checkbox instead of the item.id -->
        <t:checkbox value="currentItem" />
      </t:parameter>
    </t:grid>
  </t:checkboxgroup>
</t:form>

The problem is - it doesn't work. I get a NullPointerException inside the Loop while it's reading its source parameter.

After digging a while I discovered that The Loop component stores some events in the form and one of them (SETUP_FOR_VOLATILE) is trying to access the columnNames property of the GridColumns (which is bound to the source of the Loop), which in turn accesses the dataModel of the dataProvider (the Grid).

However, the Grid doesn't store any initialization events in the form at all so the NPE is obvious - the data model isn't

Is this a bug or am I doing something wrong?

Ognen

P.S. Log of the error:

[ERROR] RequestExceptionHandler Processing of request failed with uncaught exception: Failure reading parameter source of component Page2Role:permissiondisplay.grid.columns.loop: Failure reading parameter model of component Page2Role:permissiondisplay.grid: java.lang.NullPointerException org.apache.tapestry.ioc.internal.util.TapestryException: Failure reading parameter source of component Page2Role:permissiondisplay.grid.columns.loop: Failure reading parameter model of component Page2Role:permissiondisplay.grid: java.lang.NullPointerException at org.apache.tapestry.corelib.components.Form.onAction(Form.java: 375) at org.apache.tapestry.corelib.components.Form.handleComponentEvent (Form.java) at org.apache.tapestry.internal.structure.ComponentPageElementImpl.handleEv ent(ComponentPageElementImpl.java:893) at org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerE vent(ComponentPageElementImpl.java:998) at org.apache.tapestry.internal.services.ComponentActionRequestHandlerImpl. handle(ComponentActionRequestHandlerImpl.java:81) at org.apache.tapestry.internal.services.InternalModule$11.handle (InternalModule.java:541) at $ComponentActionRequestHandler_1149850824d.handle ($ComponentActionRequestHandler_1149850824d.java) at $ComponentActionRequestHandler_114985081ce.handle ($ComponentActionRequestHandler_114985081ce.java) at org.apache.tapestry.internal.services.ComponentActionDispatcher.dispatch (ComponentActionDispatcher.java:116)
   at $Dispatcher_114985081d0.dispatch($Dispatcher_114985081d0.java)
   at $Dispatcher_114985081c3.dispatch($Dispatcher_114985081c3.java)
at org.apache.tapestry.services.TapestryModule$12.service (TapestryModule.java:1066) at com.telekurs.pass.online.permissiongui.services.AppModule $1.service(AppModule.java:75) at $RequestFilter_114985081c2.service ($RequestFilter_114985081c2.java) at $RequestHandler_114985081c4.service ($RequestHandler_114985081c4.java) at org.apache.tapestry.internal.services.LocalizationFilter.service (LocalizationFilter.java:43) at $RequestHandler_114985081c4.service ($RequestHandler_114985081c4.java) at org.apache.tapestry.services.TapestryModule$2.service (TapestryModule.java:657) at $RequestHandler_114985081c4.service ($RequestHandler_114985081c4.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service (StaticFilesFilter.java:63) at $RequestHandler_114985081c4.service ($RequestHandler_114985081c4.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:97) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:88) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead (ConcurrentBarrier.java:77) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service (CheckForUpdatesFilter.java:110) at $RequestHandler_114985081c4.service ($RequestHandler_114985081c4.java) at $RequestHandler_114985081bc.service ($RequestHandler_114985081bc.java) at org.apache.tapestry.services.TapestryModule$11.service (TapestryModule.java:1044) at $HttpServletRequestHandler_114985081bb.service ($HttpServletRequestHandler_114985081bb.java) at org.apache.tapestry.TapestryFilter.doFilter (TapestryFilter.java:135) at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter (WebApplicationHandler.java:334) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch (WebApplicationHandler.java:286) at org.mortbay.jetty.servlet.ServletHandler.handle (ServletHandler.java:567)
   at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
at org.mortbay.jetty.servlet.WebApplicationContext.handle (WebApplicationContext.java:526)
   at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
   at org.mortbay.http.HttpServer.service(HttpServer.java:879)
   at org.mortbay.http.HttpConnection.service(HttpConnection.java:789)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java: 960)
   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:806)
at org.mortbay.http.SocketListener.handleConnection (SocketListener.java:218)
   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:331)
   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:520)
Caused by: org.apache.tapestry.ioc.internal.util.TapestryException: Failure reading parameter source of component Page2Role:permissiondisplay.grid.columns.loop: Failure reading parameter model of component Page2Role:permissiondisplay.grid: java.lang.NullPointerException [at classpath:org/apache/tapestry/ corelib/components/GridColumns.html, line 3, column 116] at org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.re adParameter(InternalComponentResourcesImpl.java:210) at org.apache.tapestry.corelib.components.Loop._ $read_parameter_source(Loop.java) at org.apache.tapestry.corelib.components.Loop.setupForVolatile (Loop.java:265) at org.apache.tapestry.corelib.components.Loop.access$100 (Loop.java:46) at org.apache.tapestry.corelib.components.Loop$2.execute (Loop.java:69) at org.apache.tapestry.corelib.components.Loop$2.execute (Loop.java:70) at org.apache.tapestry.corelib.components.Form.onAction(Form.java: 364)
   ... 42 more
Caused by: org.apache.tapestry.ioc.internal.util.TapestryException: Failure reading parameter model of component Page2Role:permissiondisplay.grid: java.lang.NullPointerException [at classpath:org/apache/tapestry/corelib/components/GridColumns.html, line 3, column 116] at org.apache.tapestry.internal.bindings.PropBinding.get (PropBinding.java:58) at org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.re adParameter(InternalComponentResourcesImpl.java:204)
   ... 48 more
Caused by: org.apache.tapestry.ioc.internal.util.TapestryException: Failure reading parameter model of component Page2Role:permissiondisplay.grid: java.lang.NullPointerException at org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.re adParameter(InternalComponentResourcesImpl.java:210) at org.apache.tapestry.corelib.components.Grid._ $read_parameter_model(Grid.java) at org.apache.tapestry.corelib.components.Grid.getDataModel (Grid.java:228) at org.apache.tapestry.corelib.components.GridColumns.getColumnNames (GridColumns.java:122) at $PropertyConduit_1149850820d.get ($PropertyConduit_1149850820d.java) at org.apache.tapestry.internal.bindings.PropBinding.get (PropBinding.java:54)
   ... 49 more
Caused by: java.lang.NullPointerException
   at org.apache.tapestry.corelib.components.Grid$1.get(Grid.java:158)
at org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.re adParameter(InternalComponentResourcesImpl.java:204)
   ... 54 more
--
Ognen Ivanovski | [EMAIL PROTECTED]
phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk




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

Reply via email to