RE: [Wicket-user] Replacing Page components in response to user input

2006-03-03 Thread Frank Silbermann

Me:
 However, at any time the user can re-set the options and re-submit,
 causing a completely different DataTable based on a new DataProvider.

Eelco Hillenius:
 First of all, ask yourself whether it is a completely different
 datatable, or whether the it's just a different model.

Suppose it's just a different model.  DataTable seems to have no
constructor that takes a PropertyModel so that the IDataProvider can
change dynamically, nor a method in DataTable to replace the
IDataProvider manually.

In this case, would you recommend simply to changing the state of my
IDataProvider so that IDataProvider.iterator(first, count) method
returns the new data, and call DataTable.setCurrentPage(1)?


Me:
 How do I code a page to replace one component with a new one
 in response to user input?  (I see plenty of examples of adding
 a component to a page, but only in the constructor -- and no
 examples of removing/replacing a component.)

Eelco Hillenius:
 If it *is* a completely different datatable and you want to
 replace it with something completely different, use panels.
 Put your different options in different panels, and use
 'replace' to replace one component with the other.

Would that be the MarkupContainer.replace(component) method?  This
method returns a MarkupContainer -- is the return value merely self --
a convenience in case you want to replace several components in one
line?

I can see the motivation for putting my replaceable components in a
Panel if the HTML requirements differ.  Likewise, if I have enough
components to replace that I'd rather not have to replace them one at a
time.  But if it's just a single component that I'm replacing, is there
really any need to put it in its own panel? 


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] Replacing Page components in response to user input

2006-03-03 Thread Frank Silbermann












I can see the motivation for putting my replaceable
components in a 
Panel if the HTML requirements differ.Likewise, if I have enough
components to replace that I'd rather not have to replace them one at a
time.But if it's just a single component that I'm replacing, is
there
really any need to put it in its own panel?






panel is the basic piece of wicket composition. so you will use them often. for
some situation (when the panel is not really reusable outside the page) you
might want to use Fragments because they make things tidier and easier. 
-Igor







Yes, but if I have but a single span
wicket:id=myDataTable in my HTML, and my Page is to replace
my DataTable component with another, couldnt I do without a separate
Panel _or_ Fragment? Why would I need _any_ special HTML container for my
DataTable?



(Or are we saying the same thing in that,
in its implementation, a DataTable _is_
a Panel?)








Re: [Wicket-user] Replacing Page components in response to user input

2006-03-03 Thread Igor Vaynberg
if the /only/ thing you are replacing is a datatable which is /already/ a panel then you dont need to do anything extra.-IgorOn 3/3/06, Frank Silbermann
 [EMAIL PROTECTED] wrote:






















I can see the motivation for putting my replaceable
components in a 
Panel if the HTML requirements differ.Likewise, if I have enough
components to replace that I'd rather not have to replace them one at a
time.But if it's just a single component that I'm replacing, is
there
really any need to put it in its own panel?






panel is the basic piece of wicket composition. so you will use them often. for
some situation (when the panel is not really reusable outside the page) you
might want to use Fragments because they make things tidier and easier. 
-Igor







Yes, but if I have but a single span
wicket:id="myDataTable" in my HTML, and my Page is to replace
my DataTable component with another, couldn't I do without a separate
Panel _or_ Fragment? Why would I need _any_ special HTML container for my
DataTable?



(Or are we saying the same thing in that,
in its implementation, a DataTable _is_
a Panel?)









[Wicket-user] Replacing Page components in response to user input

2006-03-02 Thread Frank Silbermann

I have a form which provides the user with a number of options.  Based
on those options chosen, I will display a DataTable.  The user can play
with the DataTable in terms of paging through it, re-sorting the
columns, and so on.

However, at any time the user can re-set the options and re-submit,
causing a completely different DataTable based on a new DataProvider.

What tools does Wicket provide to allow me to replace one DataTable with
a new one?  Or, to be more general, how do I code a page to replace one
component with a new one in response to user input?  (I see plenty of
examples of adding a component to a page, but only in the constructor --
and no examples of removing/replacing a component.)

For simplity, assume that the replacement component can use the same
Page mark-up, e.g. replacing one Panel with another.  Putting all the
possible components on the page and disabling/hiding all but one at a
time is not an option for me.
 


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Replacing Page components in response to user input

2006-03-02 Thread Eelco Hillenius
 However, at any time the user can re-set the options and re-submit,
 causing a completely different DataTable based on a new DataProvider.

First of all, ask yourself whether it is a completely different
datatable, or whether the it's just a different model.

 What tools does Wicket provide to allow me to replace one DataTable with
 a new one?  Or, to be more general, how do I code a page to replace one
 component with a new one in response to user input?  (I see plenty of
 examples of adding a component to a page, but only in the constructor --
 and no examples of removing/replacing a component.)

If it *is* a completely different datatable and you want to replace it
with something completely different, use panels. Put your different
options in different panels, and use 'replace' to replace one
component with the other.

Deleting is not allowed as that would result in an inconsistence
between the component hierarchy and the markup. However, you can
always replace with an empty panel.

Eelco


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Replacing Page components in response to user input

2006-03-02 Thread Igor Vaynberg
TabbedPanel is a good example of replacing panels. it lives in wicket-extensions.-IgorOn 3/2/06, Eelco Hillenius 
[EMAIL PROTECTED] wrote: However, at any time the user can re-set the options and re-submit,
 causing a completely different DataTable based on a new DataProvider.First of all, ask yourself whether it is a completely differentdatatable, or whether the it's just a different model. What tools does Wicket provide to allow me to replace one DataTable with
 a new one?Or, to be more general, how do I code a page to replace one component with a new one in response to user input?(I see plenty of examples of adding a component to a page, but only in the constructor --
 and no examples of removing/replacing a component.)If it *is* a completely different datatable and you want to replace itwith something completely different, use panels. Put your differentoptions in different panels, and use 'replace' to replace one
component with the other.Deleting is not allowed as that would result in an inconsistencebetween the component hierarchy and the markup. However, you canalways replace with an empty panel.Eelco
---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user