You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by hannes1608 <ha...@yahoo.de> on 2012/11/30 13:41:22 UTC
problem with editable datatable
Hi,
I am using Wicket 6.3. I have searched a lot, but somehow didn't find how to
solve this: I would like to have texfields and checkboxes in a datatable.
The following code is not working:
Java:
List<IColumn<Feststellung, String>> columns = new
ArrayList<IColumn<Feststellung, String>>();
columns.add(new PropertyColumn<Feststellung, String>(new
Model<String>("Status"), "status") {
@Override
public void populateItem(Item<ICellPopulator<Feststellung>> item,
String componentId, IModel<Feststellung> rowModel) {
super.populateItem(item, componentId, rowModel);
item.add(new CheckBox("status"));
}
});
this.table = new DefaultDataTable<Feststellung, String>("feststellungen",
columns, this.dataProvider, 10);
Html:
<form wicket:id="tableForm">
</form>
I get the following error message:
Last cause: The component(s) below failed to render. Possible reasons could
be that: 1) you have added a component in code but forgot to reference it in
the markup (thus the component will never be rendered), 2) if your
components were added in a parent container then make sure the markup for
the child container includes them in <wicket:extend>.
1. [CheckBox [Component id = status]]
2. [CheckBox [Component id = status]]
3. [CheckBox [Component id = status]]
Is it possible what I want to do?
Kind regards,
Hannes
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: problem with editable datatable
Posted by hannes1608 <ha...@yahoo.de>.
I didn't know about fragments so far, of course thats also a solution. But
with encapsulating in an own component, I can reuse my custom column
classes.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370p4654421.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: problem with editable datatable
Posted by William Speirs <ws...@apache.org>.
When I've had to do this, I usually use a fragment. It keeps all the HTML
on a single page and is a bit cleaner I think:
http://wicket.apache.org/learn/examples/usingfragments.html
Bill-
On Fri, Nov 30, 2012 at 8:14 AM, hannes1608 <ha...@yahoo.de> wrote:
> Just realized that I have to create a new component for this. That works,
> but
> it's not really a nice solution.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370p4654381.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: problem with editable datatable
Posted by hannes1608 <ha...@yahoo.de>.
Just realized that I have to create a new component for this. That works, but
it's not really a nice solution.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370p4654381.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: problem with editable datatable
Posted by hannes1608 <ha...@yahoo.de>.
Doing this I get the following error:
Last cause: Failed to find markup file associated. MyPanel: [MyPanel
[Component id = cell]]
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370p4654378.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: problem with editable datatable
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
It should be
item.add(new CheckBox(componentId));
But tht won't work because of the reasons I gave. You have to roll your own
CheckBoxPanel and do
item.add(new CheckBoxPanel(componentId));
On Fri, Nov 30, 2012 at 1:58 PM, hannes1608 <ha...@yahoo.de> wrote:
> thank you, but then I get the following error:
>
> Last cause: The component(s) below failed to render. Possible reasons could
> be that: 1) you have added a component in code but forgot to reference it
> in
> the markup (thus the component will never be rendered), 2) if your
> components were added in a parent container then make sure the markup for
> the child container includes them in <wicket:extend>.
>
> 1. [MyPanel [Component id = panel]]
> 2. [CheckBox [Component id = status]]
> 3. [MyPanel [Component id = panel]]
> 4. [CheckBox [Component id = status]]
> 5. [MyPanel [Component id = panel]]
> 6. [CheckBox [Component id = status]]
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370p4654375.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>
Re: problem with editable datatable
Posted by hannes1608 <ha...@yahoo.de>.
thank you, but then I get the following error:
Last cause: The component(s) below failed to render. Possible reasons could
be that: 1) you have added a component in code but forgot to reference it in
the markup (thus the component will never be rendered), 2) if your
components were added in a parent container then make sure the markup for
the child container includes them in <wicket:extend>.
1. [MyPanel [Component id = panel]]
2. [CheckBox [Component id = status]]
3. [MyPanel [Component id = panel]]
4. [CheckBox [Component id = status]]
5. [MyPanel [Component id = panel]]
6. [CheckBox [Component id = status]]
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370p4654375.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: problem with editable datatable
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
You can not add a checkbox or directly to the the column because
corresponding markup is <span wicket:id="cel"></span> (or maybe a div, it
doesn't matter). You have to place the checkbox in a panel and add that
panel instead.
On Fri, Nov 30, 2012 at 1:41 PM, hannes1608 <ha...@yahoo.de> wrote:
> Hi,
>
> I am using Wicket 6.3. I have searched a lot, but somehow didn't find how
> to
> solve this: I would like to have texfields and checkboxes in a datatable.
> The following code is not working:
>
> Java:
> List<IColumn<Feststellung, String>> columns = new
> ArrayList<IColumn<Feststellung, String>>();
> columns.add(new PropertyColumn<Feststellung, String>(new
> Model<String>("Status"), "status") {
> @Override
> public void populateItem(Item<ICellPopulator<Feststellung>> item,
> String componentId, IModel<Feststellung> rowModel) {
> super.populateItem(item, componentId, rowModel);
> item.add(new CheckBox("status"));
> }
> });
> this.table = new DefaultDataTable<Feststellung, String>("feststellungen",
> columns, this.dataProvider, 10);
>
> Html:
> <form wicket:id="tableForm">
>
>
> </form>
>
> I get the following error message:
> Last cause: The component(s) below failed to render. Possible reasons could
> be that: 1) you have added a component in code but forgot to reference it
> in
> the markup (thus the component will never be rendered), 2) if your
> components were added in a parent container then make sure the markup for
> the child container includes them in <wicket:extend>.
>
> 1. [CheckBox [Component id = status]]
> 2. [CheckBox [Component id = status]]
> 3. [CheckBox [Component id = status]]
>
> Is it possible what I want to do?
>
> Kind regards,
> Hannes
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>
Re: problem with editable datatable
Posted by Nick Pratt <nb...@gmail.com>.
Try putting a panel in the item that contains a Link etc - I don't think
you can add such components directly.
It would be nice if you could...
N
On Nov 30, 2012 7:41 AM, "hannes1608" <ha...@yahoo.de> wrote:
> Hi,
>
> I am using Wicket 6.3. I have searched a lot, but somehow didn't find how
> to
> solve this: I would like to have texfields and checkboxes in a datatable.
> The following code is not working:
>
> Java:
> List<IColumn<Feststellung, String>> columns = new
> ArrayList<IColumn<Feststellung, String>>();
> columns.add(new PropertyColumn<Feststellung, String>(new
> Model<String>("Status"), "status") {
> @Override
> public void populateItem(Item<ICellPopulator<Feststellung>> item,
> String componentId, IModel<Feststellung> rowModel) {
> super.populateItem(item, componentId, rowModel);
> item.add(new CheckBox("status"));
> }
> });
> this.table = new DefaultDataTable<Feststellung, String>("feststellungen",
> columns, this.dataProvider, 10);
>
> Html:
> <form wicket:id="tableForm">
>
>
> </form>
>
> I get the following error message:
> Last cause: The component(s) below failed to render. Possible reasons could
> be that: 1) you have added a component in code but forgot to reference it
> in
> the markup (thus the component will never be rendered), 2) if your
> components were added in a parent container then make sure the markup for
> the child container includes them in <wicket:extend>.
>
> 1. [CheckBox [Component id = status]]
> 2. [CheckBox [Component id = status]]
> 3. [CheckBox [Component id = status]]
>
> Is it possible what I want to do?
>
> Kind regards,
> Hannes
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/problem-with-editable-datatable-tp4654370.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>