Re: [Wicket-user] Repaint single row of a DataTable

2007-07-23 Thread Timo Rantalaiho
On Thu, 19 Jul 2007, ChuckDeal wrote:
 I am not locked into the DataTable, but I think the repeater is the best
 component for what I am trying to do.  Is that correct?

My general feeling, based on the couple of Wicket projects 
that I've been involved in, is that DataTable is best suited
for a case where you want a fairly finished out-of-the-box 
implementation without a lot of custom tweaking or extra
functionality. 

To make a grid in which you can repaint single rows I would
try something that starts from more bare-bones components
such as DataView and finding the relevant Items with
IVisitor (operating e.g. on the DataView during the ajax
request processing). We have done something similar but a
bit simpler as we didn't allow editing the grid directly. 

Note the potential for race conditions if the user enters
text and then, while the ajax request is being processed,
clicks a row to be updated = boom. We worked around this by
disabling the grid during ajax request processing (by using
a layover being toggled by IAjaxIndicatorAware), but that
cannot really be used if the grid itself is being edited and
precisely editing it will toggle ajax events updating it.

HTH, YMMV :)

- Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Repaint single row of a DataTable

2007-07-19 Thread ChuckDeal

I searched for answers to this problem, but most responses were to repaint
the whole table (or more specifically, the container holding the table).

I am trying to make an editable grid.  In addition to that, when some cell
contents change, other cells may need to be repainted (they might contain
computed values based upon values of one or more other cells).  For
performance, I don't want to repaint the entire table on each keypress, but
repainting the single row won't be so bad.

What could I do to repaint a single row of a DataTable?  Don't use
DataTable?  but I think I still want a repeater and ultimatley it is the
repeater's fault that I can't repaint because the MarkupFragmentFinder can't
grab the markup because it uses the component's id to match up to the
markup it finds and the id of repeater children will never match.  It would
need to know that it is a repeater child and use it's parent it to match the
markup.  Component.renderComponent is final and new MArkupFragmentFinder is
hardcoded in there, so it doesn't look like I can create a custom
MarkupFragmentFinder impl for this special case.

Maybe I am seeing this from the wrong perspective?  Could someone suggest an
alternative to this approach?  Basically, I like Datatable because it allows
me to define each cell (and any number of them), but I want the ability to
repaint only PART of the table...

Thanks
Chuck
-- 
View this message in context: 
http://www.nabble.com/Repaint-single-row-of-a-DataTable-tf4111859.html#a11691581
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Repaint single row of a DataTable

2007-07-19 Thread Peter Thomas
On 7/19/07, ChuckDeal [EMAIL PROTECTED] wrote:


 I searched for answers to this problem, but most responses were to repaint
 the whole table (or more specifically, the container holding the table).

 I am trying to make an editable grid.  In addition to that, when some cell
 contents change, other cells may need to be repainted (they might contain
 computed values based upon values of one or more other cells).  For
 performance, I don't want to repaint the entire table on each keypress,
 but
 repainting the single row won't be so bad.

 What could I do to repaint a single row of a DataTable?  Don't use
 DataTable?  but I think I still want a repeater and ultimatley it is the
 repeater's fault that I can't repaint because the MarkupFragmentFinder
 can't
 grab the markup because it uses the component's id to match up to the
 markup it finds and the id of repeater children will never match.  It
 would
 need to know that it is a repeater child and use it's parent it to match
 the
 markup.  Component.renderComponent is final and new MArkupFragmentFinder
 is
 hardcoded in there, so it doesn't look like I can create a custom
 MarkupFragmentFinder impl for this special case.

 Maybe I am seeing this from the wrong perspective?  Could someone suggest
 an
 alternative to this approach?  Basically, I like Datatable because it
 allows
 me to define each cell (and any number of them), but I want the ability to
 repaint only PART of the table...

 Thanks
 Chuck
 --


How about this thread:

http://www.nabble.com/Adding-item-to-ListView-over-Ajax---refresh-only-newest-row-t3971491.html#a11572531

Does this help?

Thanks,

Peter.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Repaint single row of a DataTable

2007-07-19 Thread ChuckDeal


ptrthomas wrote:
 
 How about this thread:
 
 http://www.nabble.com/Adding-item-to-ListView-over-Ajax---refresh-only-newest-row-t3971491.html#a11572531
 
 Does this help?
 
 Thanks,
 
 Peter.
 

Not quite, I want to be able to repaint a row that has already been output. 
Although, this does give me some insight on the next feature that I have to
add to the grid...

Chuck
-- 
View this message in context: 
http://www.nabble.com/Repaint-single-row-of-a-DataTable-tf4111859.html#a11693796
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Repaint single row of a DataTable

2007-07-19 Thread Igor Vaynberg
this is tricky because datatable encapsulates a lot of this stuff so it will
probably need something exposed for this usecase. if you create a quickstart
that has a datatable, some bogus data, and some links in columns that should
trigger a refresh i can play around with it and see what needs to be done.

-igor


On 7/19/07, ChuckDeal [EMAIL PROTECTED] wrote:


 I searched for answers to this problem, but most responses were to repaint
 the whole table (or more specifically, the container holding the table).

 I am trying to make an editable grid.  In addition to that, when some cell
 contents change, other cells may need to be repainted (they might contain
 computed values based upon values of one or more other cells).  For
 performance, I don't want to repaint the entire table on each keypress,
 but
 repainting the single row won't be so bad.

 What could I do to repaint a single row of a DataTable?  Don't use
 DataTable?  but I think I still want a repeater and ultimatley it is the
 repeater's fault that I can't repaint because the MarkupFragmentFinder
 can't
 grab the markup because it uses the component's id to match up to the
 markup it finds and the id of repeater children will never match.  It
 would
 need to know that it is a repeater child and use it's parent it to match
 the
 markup.  Component.renderComponent is final and new MArkupFragmentFinder
 is
 hardcoded in there, so it doesn't look like I can create a custom
 MarkupFragmentFinder impl for this special case.

 Maybe I am seeing this from the wrong perspective?  Could someone suggest
 an
 alternative to this approach?  Basically, I like Datatable because it
 allows
 me to define each cell (and any number of them), but I want the ability to
 repaint only PART of the table...

 Thanks
 Chuck
 --
 View this message in context:
 http://www.nabble.com/Repaint-single-row-of-a-DataTable-tf4111859.html#a11691581
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft Visual Studio 2005.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Repaint single row of a DataTable

2007-07-19 Thread ChuckDeal


Matej Knopp-2 wrote:
 
 AjaxRequestTarget target;
 target.addComponent(item);
 
 where item is a repeater Item.
 
 This doesn't work for you? What wicket version are you using?
 
 -Matej
 

1.3.0-SNAPSHOT

Here's how the Column is created...  basically it is adding a custom
Fragment to the cellItem.  That Fragment represents a TextField onto which I
put the Ajax event.

columns.add(new AbstractColumn(new Model(Added)) {
public void populateItem(final Item cellItem, final String componentId,
final IModel rowModel) {
cellItem.add(new NumericTextFieldFragment(componentId, rowModel,
slocAdded, 6, 0) {
@Override
protected void decorateTextField(TextField tf) {
super.decorateTextField(tf);

tf.add(new 
AjaxFormComponentUpdatingBehavior(onkeyup) {
@Override
protected void 
onUpdate(AjaxRequestTarget target) {
MarkupContainer row = 
cellItem.findParent(Item.class);
target.addComponent(row);
}
});
}
});
}
});


which throws this exception

13:56:20,494 ERROR RequestCycle:1255 - Unable to find the markup for the
component. That may be due to transparent containers or components
implementing IComponentResolver: [MarkupContainer [Component id = id1, page
= com.csc.aims.specchange.wicket.SpecChangePage, path =
0:contentPanel:dataForm:romEvents:currentEvent:collapsibleBody:sections:current:nonemptyLanguage:subsections:romSlocData:collapsibleBody:sections:slocData:slocData:rows:id1.OddEvenItem,
isVisible = true, isVersioned = true]]
org.apache.wicket.WicketRuntimeException: Unable to find the markup for the
component. That may be due to transparent containers or components
implementing IComponentResolver: [MarkupContainer [Component id = id1, page
= com.csc.aims.specchange.wicket.SpecChangePage, path =
0:contentPanel:dataForm:romEvents:currentEvent:collapsibleBody:sections:current:nonemptyLanguage:subsections:romSlocData:collapsibleBody:sections:slocData:slocData:rows:id1.OddEvenItem,
isVisible = true, isVersioned = true]]
at
org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:111)
at org.apache.wicket.Component.renderComponent(Component.java:2024)
at
org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:762)
at
org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:662)
at
org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1038)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1108)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1177)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:500)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:257)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:127)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


during renderComponent(), a new MarkupFragmentFinder 

Re: [Wicket-user] Repaint single row of a DataTable

2007-07-19 Thread Matej Knopp
AjaxRequestTarget target;
target.addComponent(item);

where item is a repeater Item.

This doesn't work for you? What wicket version are you using?

-Matej

On 7/19/07, ChuckDeal [EMAIL PROTECTED] wrote:


 ptrthomas wrote:
 
  How about this thread:
 
  http://www.nabble.com/Adding-item-to-ListView-over-Ajax---refresh-only-newest-row-t3971491.html#a11572531
 
  Does this help?
 
  Thanks,
 
  Peter.
 

 Not quite, I want to be able to repaint a row that has already been output.
 Although, this does give me some insight on the next feature that I have to
 add to the grid...

 Chuck
 --
 View this message in context: 
 http://www.nabble.com/Repaint-single-row-of-a-DataTable-tf4111859.html#a11693796
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft Visual Studio 2005.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Repaint single row of a DataTable

2007-07-19 Thread ChuckDeal


igor.vaynberg wrote:
 
 this is tricky because datatable encapsulates a lot of this stuff so it
 will
 probably need something exposed for this usecase. if you create a
 quickstart
 that has a datatable, some bogus data, and some links in columns that
 should
 trigger a refresh i can play around with it and see what needs to be done.
 
 -igor
 

Alright, this should do it: 
http://www.nabble.com/file/p11695492/quickstart-singlerowrefresh.zip
quickstart-singlerowrefresh.zip 

This quickstart (minus the lib folder) has a simple DataTable with two
columns.  Column one contains a button designed to repaint the row, the
second column is a label representing the rowModel.

I am not locked into the DataTable, but I think the repeater is the best
component for what I am trying to do.  Is that correct?

Thanks for looking into this.

Chuck
-- 
View this message in context: 
http://www.nabble.com/Repaint-single-row-of-a-DataTable-tf4111859.html#a11695492
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user