Re: How to add a TextField in a Dynamically created DefaultDataTable

2008-06-12 Thread Igor Vaynberg
your textfield doesnt have a model

-igor

On Thu, Jun 12, 2008 at 11:06 AM, galbelli <[EMAIL PROTECTED]> wrote:
>
> Thanks, the Fragment example did help in that I have the table rendering
> properly. When I attempt to submit the form I get the following error:
>
> WicketMessage: Method onFormSubmitted of interface
> org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component
> [MarkupContainer [Component id = form, page =
> com.apollo.pricing.ui.HomePage, path =
> 0:tabs:panel:form.PricingBySourcePanel$1, isVisible = true, isVersioned =
> true]] threw an exception
>
> Root cause:
>
> java.lang.IllegalStateException: Attempt to set model object on null model
> of component: tabs:panel:form:table:rows:4:cells:11:cell:edit
> at org.apache.wicket.Component.setModelObject(Component.java:2510)
> at
> org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1002)
> at org.apache.wicket.markup.html.form.Form$14.validate(Form.java:1642)
> at
> org.apache.wicket.markup.html.form.Form$ValidationVisitor.formComponent(Form.java:160)
> at
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:403)
>
> Any ideas?
>
>
>
>
>
> jwcarman wrote:
>>
>> The markup for the datatable uses  (or maybe span) for each
>> cell's item.  So, you need to give it something that it can put on a
>> span.  That would be a panel or fragment (as suggested).  Did you see
>> my earlier post about a FragmentColumn class?  It might be useful in
>> your case.
>>
>> On Thu, Jun 12, 2008 at 12:50 PM, galbelli <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> Not sure I understand how to accomplish this. Even if I wrap it in a
>>> panel
>>> won't it be looking for markup?
>>>
>>> My current markup for the dynamic table is as follows:
>>>
>>> http://wicket.apache.org/";>
>>>
>>>
>>>Prices by Source
>>>
>>>
>>>
>>>
>>>
>>>Portfolio: >> wicket:id="portfolioSelect">
>>>
>>>>> wicket:id="table">
>>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>> And the code"
>>>
>>>
>>>List columns = new ArrayList();
>>>
>>>columns.add(new PropertyColumn(new Model("CUSIP"), "cusip",
>>> "cusip"));
>>>columns.add(new PropertyColumn(new Model("Description"),
>>> "description", "description"));
>>>
>>>PropertyColumn aPropertyColumn = new PropertyColumn(new
>>> Model("Override"), "overridePrice", "overridePrice")
>>>{
>>>public void populateItem(Item item, String componentId, IModel
>>> model)
>>>{
>>>TextField aTextField = new TextField(componentId);
>>>item.add(aTextField );
>>>}
>>>
>>>};
>>>columns.add(aPropertyColumn);
>>>
>>>   DefaultDataTable aDefaultDataTable = new DefaultDataTable("table",
>>> columns, portfolioProvider, 8);
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> wrap the textfield in a fragment or a panel
>>>>
>>>> -igor
>>>>
>>>> On Wed, Jun 11, 2008 at 3:39 PM, galbelli <[EMAIL PROTECTED]>
>>>> wrote:
>>>>>
>>>>> I am creating a DefaultDataTable dynamically as I only know the number
>>>>> of
>>>>> columns at runtime. All is working nicely but I now need to have one of
>>>>> the
>>>>> columns contain a TextField and not a Label. I am receiving the
>>>>> following
>>>>> error:
>>>>>
>>>>> WicketMessage: Component cell must be applied to a tag of type 'input',
>>>>> not
>>>>> '' (line 0, column 0)
>>>>>
>>>>> How can I control the markup so I may change the HTML from span to
>>>>> input?
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/How-to-add-a-

Re: How to add a TextField in a Dynamically created DefaultDataTable

2008-06-12 Thread galbelli

Thanks, the Fragment example did help in that I have the table rendering
properly. When I attempt to submit the form I get the following error: 

WicketMessage: Method onFormSubmitted of interface
org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component
[MarkupContainer [Component id = form, page =
com.apollo.pricing.ui.HomePage, path =
0:tabs:panel:form.PricingBySourcePanel$1, isVisible = true, isVersioned =
true]] threw an exception

Root cause:

java.lang.IllegalStateException: Attempt to set model object on null model
of component: tabs:panel:form:table:rows:4:cells:11:cell:edit
at org.apache.wicket.Component.setModelObject(Component.java:2510)
at
org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1002)
at org.apache.wicket.markup.html.form.Form$14.validate(Form.java:1642)
at
org.apache.wicket.markup.html.form.Form$ValidationVisitor.formComponent(Form.java:160)
at
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:403)

Any ideas?





jwcarman wrote:
> 
> The markup for the datatable uses  (or maybe span) for each
> cell's item.  So, you need to give it something that it can put on a
> span.  That would be a panel or fragment (as suggested).  Did you see
> my earlier post about a FragmentColumn class?  It might be useful in
> your case.
> 
> On Thu, Jun 12, 2008 at 12:50 PM, galbelli <[EMAIL PROTECTED]>
> wrote:
>>
>> Not sure I understand how to accomplish this. Even if I wrap it in a
>> panel
>> won't it be looking for markup?
>>
>> My current markup for the dynamic table is as follows:
>>
>> http://wicket.apache.org/";>
>>
>>
>>Prices by Source
>>
>>
>>
>>
>>
>>Portfolio: > wicket:id="portfolioSelect">
>>
>>> wicket:id="table">
>>
>>
>>
>>
>>
>> 
>>
>> And the code"
>>
>>
>>List columns = new ArrayList();
>>
>>columns.add(new PropertyColumn(new Model("CUSIP"), "cusip",
>> "cusip"));
>>columns.add(new PropertyColumn(new Model("Description"),
>> "description", "description"));
>>
>>PropertyColumn aPropertyColumn = new PropertyColumn(new
>> Model("Override"), "overridePrice", "overridePrice")
>>{
>>public void populateItem(Item item, String componentId, IModel
>> model)
>>{
>>TextField aTextField = new TextField(componentId);
>>item.add(aTextField );
>>}
>>
>>};
>>columns.add(aPropertyColumn);
>>
>>   DefaultDataTable aDefaultDataTable = new DefaultDataTable("table",
>> columns, portfolioProvider, 8);
>>
>>
>>
>>
>>
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> wrap the textfield in a fragment or a panel
>>>
>>> -igor
>>>
>>> On Wed, Jun 11, 2008 at 3:39 PM, galbelli <[EMAIL PROTECTED]>
>>> wrote:
>>>>
>>>> I am creating a DefaultDataTable dynamically as I only know the number
>>>> of
>>>> columns at runtime. All is working nicely but I now need to have one of
>>>> the
>>>> columns contain a TextField and not a Label. I am receiving the
>>>> following
>>>> error:
>>>>
>>>> WicketMessage: Component cell must be applied to a tag of type 'input',
>>>> not
>>>> '' (line 0, column 0)
>>>>
>>>> How can I control the markup so I may change the HTML from span to
>>>> input?
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17788822.html
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> -
>>>> 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]
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17804562.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17806187.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How to add a TextField in a Dynamically created DefaultDataTable

2008-06-12 Thread James Carman
The markup for the datatable uses  (or maybe span) for each
cell's item.  So, you need to give it something that it can put on a
span.  That would be a panel or fragment (as suggested).  Did you see
my earlier post about a FragmentColumn class?  It might be useful in
your case.

On Thu, Jun 12, 2008 at 12:50 PM, galbelli <[EMAIL PROTECTED]> wrote:
>
> Not sure I understand how to accomplish this. Even if I wrap it in a panel
> won't it be looking for markup?
>
> My current markup for the dynamic table is as follows:
>
> http://wicket.apache.org/";>
>
>
>Prices by Source
>
>
>
>
>
>Portfolio:  wicket:id="portfolioSelect">
>
>
>
>
>
>
>
> 
>
> And the code"
>
>
>List columns = new ArrayList();
>
>columns.add(new PropertyColumn(new Model("CUSIP"), "cusip",
> "cusip"));
>columns.add(new PropertyColumn(new Model("Description"),
> "description", "description"));
>
>PropertyColumn aPropertyColumn = new PropertyColumn(new
> Model("Override"), "overridePrice", "overridePrice")
>{
>public void populateItem(Item item, String componentId, IModel
> model)
>{
>TextField aTextField = new TextField(componentId);
>item.add(aTextField );
>}
>
>};
>columns.add(aPropertyColumn);
>
>   DefaultDataTable aDefaultDataTable = new DefaultDataTable("table",
> columns, portfolioProvider, 8);
>
>
>
>
>
>
>
>
> igor.vaynberg wrote:
>>
>> wrap the textfield in a fragment or a panel
>>
>> -igor
>>
>> On Wed, Jun 11, 2008 at 3:39 PM, galbelli <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> I am creating a DefaultDataTable dynamically as I only know the number of
>>> columns at runtime. All is working nicely but I now need to have one of
>>> the
>>> columns contain a TextField and not a Label. I am receiving the following
>>> error:
>>>
>>> WicketMessage: Component cell must be applied to a tag of type 'input',
>>> not
>>> '' (line 0, column 0)
>>>
>>> How can I control the markup so I may change the HTML from span to input?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17788822.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> 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]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17804562.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> 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]



Re: How to add a TextField in a Dynamically created DefaultDataTable

2008-06-12 Thread galbelli

Not sure I understand how to accomplish this. Even if I wrap it in a panel
won't it be looking for markup? 

My current markup for the dynamic table is as follows: 

http://wicket.apache.org/";>


Prices by Source





Portfolio: 



 
 




And the code"


List columns = new ArrayList();

columns.add(new PropertyColumn(new Model("CUSIP"), "cusip",
"cusip"));
columns.add(new PropertyColumn(new Model("Description"),
"description", "description"));

PropertyColumn aPropertyColumn = new PropertyColumn(new
Model("Override"), "overridePrice", "overridePrice")
{
public void populateItem(Item item, String componentId, IModel
model)
{
TextField aTextField = new TextField(componentId);
item.add(aTextField );
}  

};
columns.add(aPropertyColumn);

   DefaultDataTable aDefaultDataTable = new DefaultDataTable("table",
columns, portfolioProvider, 8);








igor.vaynberg wrote:
> 
> wrap the textfield in a fragment or a panel
> 
> -igor
> 
> On Wed, Jun 11, 2008 at 3:39 PM, galbelli <[EMAIL PROTECTED]>
> wrote:
>>
>> I am creating a DefaultDataTable dynamically as I only know the number of
>> columns at runtime. All is working nicely but I now need to have one of
>> the
>> columns contain a TextField and not a Label. I am receiving the following
>> error:
>>
>> WicketMessage: Component cell must be applied to a tag of type 'input',
>> not
>> '' (line 0, column 0)
>>
>> How can I control the markup so I may change the HTML from span to input?
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17788822.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17804562.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How to add a TextField in a Dynamically created DefaultDataTable

2008-06-11 Thread Igor Vaynberg
wrap the textfield in a fragment or a panel

-igor

On Wed, Jun 11, 2008 at 3:39 PM, galbelli <[EMAIL PROTECTED]> wrote:
>
> I am creating a DefaultDataTable dynamically as I only know the number of
> columns at runtime. All is working nicely but I now need to have one of the
> columns contain a TextField and not a Label. I am receiving the following
> error:
>
> WicketMessage: Component cell must be applied to a tag of type 'input', not
> '' (line 0, column 0)
>
> How can I control the markup so I may change the HTML from span to input?
> --
> View this message in context: 
> http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17788822.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> 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]



How to add a TextField in a Dynamically created DefaultDataTable

2008-06-11 Thread galbelli

I am creating a DefaultDataTable dynamically as I only know the number of
columns at runtime. All is working nicely but I now need to have one of the
columns contain a TextField and not a Label. I am receiving the following
error: 

WicketMessage: Component cell must be applied to a tag of type 'input', not
'' (line 0, column 0)

How can I control the markup so I may change the HTML from span to input? 
-- 
View this message in context: 
http://www.nabble.com/How-to-add-a-TextField-in-a-Dynamically-created-DefaultDataTable-tp17788822p17788822.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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