Re: How to delete an item from List view.
Processing(false); >>> >>> add(addLink); >>> >>> >>> >>> >>> } >>> >>> Thanks >>> >>> Prati >>> >>> Johan Compagner wrote: >>>> >>>> You do use a delete button, so i guess the values are submitted. >>>> Then if you store those first in the model objects you won't loose >>>> anything >>>> >>>> johan >>>> >>>> >>>> >>>> On Feb 4, 2008 2:35 PM, pnerkar wrote: >>>> >>>>> >>>>> Hi Johan, >>>>> >>>>> Yes that will be quickest solution , >>>>> But this will clear the fields of all vehicles. >>>>> >>>>> -Pnerkar >>>>> >>>>> >>>>> Johan Compagner wrote: >>>>> > >>>>> > wasn't the quickest solution: >>>>> > >>>>> > public void onSubmit() { >>>>> >List vehicles = (List) >>>>> getParent().getParent().getModelObject(); >>>>> >vehicles.remove(index); >>>>> >listView.removeAll(); >>>>> > } >>>>> > >>>>> > Then if the list itself is stable on the server side (if other >>>>> persons >>>>> can >>>>> > also delete or add stuff to that list you really should do it >>>>> differently) >>>>> > that should work fine. After you alter the listviews model you have >>>>> to >>>>> > remove all the items so that it will rebuild >>>>> > >>>>> > johan >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > On Feb 1, 2008 12:49 AM, pnerkar wrote: >>>>> > >>>>> >> >>>>> >> Hi All, >>>>> >> >>>>> >> I have rendered a list view on a Web Page. >>>>> >> >>>>> >> vehicle1X >>>>> >> vehicle2X >>>>> >> vehicle3X >>>>> >> >>>>> >> when a person click on 'X', that item should be deleted. >>>>> >> But I'm facing an issue, when i click on 'X', last item get >>>>> deleted. >>>>> >> Actually when I delete vehicle2 from my list, it deletes vehicle2 >>>>> but >>>>> >> that >>>>> >> component is still there. >>>>> >> So while rendering it render vehicle1 & vehicle2. >>>>> >> >>>>> >> public void onSubmit() { >>>>> >>List vehicles = (List) >>>>> getParent().getParent().getModelObject(); >>>>> >>vehicles.remove(index); >>>>> >> } >>>>> >> >>>>> >> can please help out ?? >>>>> >> >>>>> >> >>>>> >> >>>>> >> -- >>>>> >> View this message in context: >>>>> >> >>>>> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html >>>>> >> Sent from the Wicket - User mailing list archive at >>>>> >> Nabble.com <http://nabble.com/><http://nabble.com/> >>>>> >> . >>>>> >> >>>>> >> >>>>> >> >>>>> - >>>>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> >> For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >> >>>>> >> >>>>> > >>>>> > >>>>> >>>>> -- >>>>> View this message in context: >>>>> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.html >>>>> Sent from the Wicket - User mailing list archive at >>>>> Nabble.com<http://nabble.com/> >>>>> . >>>>> >>>>> >>>>> - >>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p27933095.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to delete an item from List view.
Feb 4, 2008 2:35 PM, pnerkar wrote: >>> >>>> >>>> Hi Johan, >>>> >>>> Yes that will be quickest solution , >>>> But this will clear the fields of all vehicles. >>>> >>>> -Pnerkar >>>> >>>> >>>> Johan Compagner wrote: >>>>> >>>>> wasn't the quickest solution: >>>>> >>>>> public void onSubmit() { >>>>>List vehicles = (List) >>>> getParent().getParent().getModelObject(); >>>>>vehicles.remove(index); >>>>>listView.removeAll(); >>>>> } >>>>> >>>>> Then if the list itself is stable on the server side (if other persons >>>> can >>>>> also delete or add stuff to that list you really should do it >>>> differently) >>>>> that should work fine. After you alter the listviews model you have to >>>>> remove all the items so that it will rebuild >>>>> >>>>> johan >>>>> >>>>> >>>>> >>>>> >>>>> On Feb 1, 2008 12:49 AM, pnerkar wrote: >>>>> >>>>>> >>>>>> Hi All, >>>>>> >>>>>> I have rendered a list view on a Web Page. >>>>>> >>>>>> vehicle1X >>>>>> vehicle2X >>>>>> vehicle3X >>>>>> >>>>>> when a person click on 'X', that item should be deleted. >>>>>> But I'm facing an issue, when i click on 'X', last item get deleted. >>>>>> Actually when I delete vehicle2 from my list, it deletes vehicle2 but >>>>>> that >>>>>> component is still there. >>>>>> So while rendering it render vehicle1 & vehicle2. >>>>>> >>>>>> public void onSubmit() { >>>>>>List vehicles = (List) >>>> getParent().getParent().getModelObject(); >>>>>>vehicles.remove(index); >>>>>> } >>>>>> >>>>>> can please help out ?? >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> View this message in context: >>>>>> >>>> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html >>>>>> Sent from the Wicket - User mailing list archive at >>>>>> Nabble.com <http://nabble.com/><http://nabble.com/> >>>>>> . >>>>>> >>>>>> >>>>>> - >>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.html >>>> Sent from the Wicket - User mailing list archive at >>>> Nabble.com<http://nabble.com/> >>>> . >>>> >>>> >>>> - >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> >>> >>> >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to delete an item from List view.
e: >>> >>>> >>>> Hi Johan, >>>> >>>> Yes that will be quickest solution , >>>> But this will clear the fields of all vehicles. >>>> >>>> -Pnerkar >>>> >>>> >>>> Johan Compagner wrote: >>>> > >>>> > wasn't the quickest solution: >>>> > >>>> > public void onSubmit() { >>>> >List vehicles = (List) >>>> getParent().getParent().getModelObject(); >>>> >vehicles.remove(index); >>>> >listView.removeAll(); >>>> > } >>>> > >>>> > Then if the list itself is stable on the server side (if other >>>> persons >>>> can >>>> > also delete or add stuff to that list you really should do it >>>> differently) >>>> > that should work fine. After you alter the listviews model you have >>>> to >>>> > remove all the items so that it will rebuild >>>> > >>>> > johan >>>> > >>>> > >>>> > >>>> > >>>> > On Feb 1, 2008 12:49 AM, pnerkar wrote: >>>> > >>>> >> >>>> >> Hi All, >>>> >> >>>> >> I have rendered a list view on a Web Page. >>>> >> >>>> >> vehicle1X >>>> >> vehicle2X >>>> >> vehicle3X >>>> >> >>>> >> when a person click on 'X', that item should be deleted. >>>> >> But I'm facing an issue, when i click on 'X', last item get deleted. >>>> >> Actually when I delete vehicle2 from my list, it deletes vehicle2 >>>> but >>>> >> that >>>> >> component is still there. >>>> >> So while rendering it render vehicle1 & vehicle2. >>>> >> >>>> >> public void onSubmit() { >>>> >>List vehicles = (List) >>>> getParent().getParent().getModelObject(); >>>> >>vehicles.remove(index); >>>> >> } >>>> >> >>>> >> can please help out ?? >>>> >> >>>> >> >>>> >> >>>> >> -- >>>> >> View this message in context: >>>> >> >>>> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html >>>> >> Sent from the Wicket - User mailing list archive at >>>> >> Nabble.com <http://nabble.com/><http://nabble.com/> >>>> >> . >>>> >> >>>> >> >>>> >> >>>> - >>>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> >> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >> >>>> >> >>>> > >>>> > >>>> >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.html >>>> Sent from the Wicket - User mailing list archive at >>>> Nabble.com<http://nabble.com/> >>>> . >>>> >>>> >>>> - >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p27932749.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to delete an item from List view.
able on the server side (if other persons >>> can >>> > also delete or add stuff to that list you really should do it >>> differently) >>> > that should work fine. After you alter the listviews model you have to >>> > remove all the items so that it will rebuild >>> > >>> > johan >>> > >>> > >>> > >>> > >>> > On Feb 1, 2008 12:49 AM, pnerkar wrote: >>> > >>> >> >>> >> Hi All, >>> >> >>> >> I have rendered a list view on a Web Page. >>> >> >>> >> vehicle1X >>> >> vehicle2X >>> >> vehicle3X >>> >> >>> >> when a person click on 'X', that item should be deleted. >>> >> But I'm facing an issue, when i click on 'X', last item get deleted. >>> >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but >>> >> that >>> >> component is still there. >>> >> So while rendering it render vehicle1 & vehicle2. >>> >> >>> >> public void onSubmit() { >>> >>List vehicles = (List) >>> getParent().getParent().getModelObject(); >>> >> vehicles.remove(index); >>> >> } >>> >> >>> >> can please help out ?? >>> >> >>> >> >>> >> >>> >> -- >>> >> View this message in context: >>> >> >>> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html >>> >> Sent from the Wicket - User mailing list archive at >>> >> Nabble.com <http://nabble.com/><http://nabble.com/> >>> >> . >>> >> >>> >> >>> >> - >>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> >> For additional commands, e-mail: users-h...@wicket.apache.org >>> >> >>> >> >>> > >>> > >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.html >>> Sent from the Wicket - User mailing list archive at >>> Nabble.com<http://nabble.com/> >>> . >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p27932678.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to delete an item from List view.
Hi, I am also having similar issue, it all the time removes last row. I have attached code. OptionGroupPageForm(String id) { super(id); final MarkupContainer rowPanel = new WebMarkupContainer("rowPanel"); rowPanel.setOutputMarkupId(true); add(rowPanel); // List all rows rows.add(new String()); RefreshingView lv = new RefreshingView("rows") { @Override protected Iterator getItemModels() { List models = new ArrayList(); for(int i=0;i > You do use a delete button, so i guess the values are submitted. > Then if you store those first in the model objects you won't loose > anything > > johan > > > > On Feb 4, 2008 2:35 PM, pnerkar wrote: > >> >> Hi Johan, >> >> Yes that will be quickest solution , >> But this will clear the fields of all vehicles. >> >> -Pnerkar >> >> >> Johan Compagner wrote: >> > >> > wasn't the quickest solution: >> > >> > public void onSubmit() { >> >List vehicles = (List) getParent().getParent().getModelObject(); >> >vehicles.remove(index); >> >listView.removeAll(); >> > } >> > >> > Then if the list itself is stable on the server side (if other persons >> can >> > also delete or add stuff to that list you really should do it >> differently) >> > that should work fine. After you alter the listviews model you have to >> > remove all the items so that it will rebuild >> > >> > johan >> > >> > >> > >> > >> > On Feb 1, 2008 12:49 AM, pnerkar wrote: >> > >> >> >> >> Hi All, >> >> >> >> I have rendered a list view on a Web Page. >> >> >> >> vehicle1X >> >> vehicle2X >> >> vehicle3X >> >> >> >> when a person click on 'X', that item should be deleted. >> >> But I'm facing an issue, when i click on 'X', last item get deleted. >> >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but >> >> that >> >> component is still there. >> >> So while rendering it render vehicle1 & vehicle2. >> >> >> >> public void onSubmit() { >> >>List vehicles = (List) >> getParent().getParent().getModelObject(); >> >>vehicles.remove(index); >> >> } >> >> >> >> can please help out ?? >> >> >> >> >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html >> >> Sent from the Wicket - User mailing list archive at >> >> Nabble.com <http://nabble.com/><http://nabble.com/> >> >> . >> >> >> >> >> >> - >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.html >> Sent from the Wicket - User mailing list archive at >> Nabble.com<http://nabble.com/> >> . >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > -- View this message in context: http://old.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p27905777.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to delete an item from List view.
I've come to love listview, and use it all the time. Would be sad to see it go away.. Sure there are somethinges you need to be aware of when working with it but thats just life... -1 Eelco Hillenius wrote: On Feb 4, 2008 3:45 AM, Martijn Dashorst <[EMAIL PROTECTED]> wrote: On 2/3/08, Eelco Hillenius <[EMAIL PROTECTED]> wrote: How about a reconsideration of depreciating ListView? -1 If anytime someone comes along with a misunderstanding of a valid component we don't have a framework left: - models - drop down choice - urls - mounting All those things can be deprecated then. Not true. There are perfectly complete replacements for ListView, not for the other things you mention. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to delete an item from List view.
Hi Johan, Actually that's not a main button of my page. So default processing is set false, bcz of that the values will not be there in model objects. Regards, Pankaj... Johan Compagner wrote: > > You do use a delete button, so i guess the values are submitted. > Then if you store those first in the model objects you won't loose > anything > > johan > > > > On Feb 4, 2008 2:35 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> >> Hi Johan, >> >> Yes that will be quickest solution , >> But this will clear the fields of all vehicles. >> >> -Pnerkar >> >> >> Johan Compagner wrote: >> > >> > wasn't the quickest solution: >> > >> > public void onSubmit() { >> >List vehicles = (List) getParent().getParent().getModelObject(); >> >vehicles.remove(index); >> >listView.removeAll(); >> > } >> > >> > Then if the list itself is stable on the server side (if other persons >> can >> > also delete or add stuff to that list you really should do it >> differently) >> > that should work fine. After you alter the listviews model you have to >> > remove all the items so that it will rebuild >> > >> > johan >> > >> > >> > >> > >> > On Feb 1, 2008 12:49 AM, pnerkar <[EMAIL PROTECTED]> wrote: >> > >> >> >> >> Hi All, >> >> >> >> I have rendered a list view on a Web Page. >> >> >> >> vehicle1X >> >> vehicle2X >> >> vehicle3X >> >> >> >> when a person click on 'X', that item should be deleted. >> >> But I'm facing an issue, when i click on 'X', last item get deleted. >> >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but >> >> that >> >> component is still there. >> >> So while rendering it render vehicle1 & vehicle2. >> >> >> >> public void onSubmit() { >> >>List vehicles = (List) >> getParent().getParent().getModelObject(); >> >>vehicles.remove(index); >> >> } >> >> >> >> can please help out ?? >> >> >> >> >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html >> >> Sent from the Wicket - User mailing list archive at >> >> Nabble.com <http://nabble.com/><http://nabble.com/> >> >> . >> >> >> >> >> >> - >> >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.html >> Sent from the Wicket - User mailing list archive at >> Nabble.com<http://nabble.com/> >> . >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -- View this message in context: http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15275813.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 delete an item from List view.
you lose values that werent validated if you do that, because those are stored in components themselves... -igor On Feb 4, 2008 6:15 AM, Johan Compagner <[EMAIL PROTECTED]> wrote: > You do use a delete button, so i guess the values are submitted. > Then if you store those first in the model objects you won't loose anything > > johan > > > > > On Feb 4, 2008 2:35 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > > > > Hi Johan, > > > > Yes that will be quickest solution , > > But this will clear the fields of all vehicles. > > > > -Pnerkar > > > > > > Johan Compagner wrote: > > > > > > wasn't the quickest solution: > > > > > > public void onSubmit() { > > >List vehicles = (List) getParent().getParent().getModelObject(); > > >vehicles.remove(index); > > >listView.removeAll(); > > > } > > > > > > Then if the list itself is stable on the server side (if other persons > > can > > > also delete or add stuff to that list you really should do it > > differently) > > > that should work fine. After you alter the listviews model you have to > > > remove all the items so that it will rebuild > > > > > > johan > > > > > > > > > > > > > > > On Feb 1, 2008 12:49 AM, pnerkar <[EMAIL PROTECTED]> wrote: > > > > > >> > > >> Hi All, > > >> > > >> I have rendered a list view on a Web Page. > > >> > > >> vehicle1X > > >> vehicle2X > > >> vehicle3X > > >> > > >> when a person click on 'X', that item should be deleted. > > >> But I'm facing an issue, when i click on 'X', last item get deleted. > > >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but > > >> that > > >> component is still there. > > >> So while rendering it render vehicle1 & vehicle2. > > >> > > >> public void onSubmit() { > > >>List vehicles = (List) getParent().getParent().getModelObject(); > > >>vehicles.remove(index); > > >> } > > >> > > >> can please help out ?? > > >> > > >> > > >> > > >> -- > > >> View this message in context: > > >> > > http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html > > >> Sent from the Wicket - User mailing list archive at > > >> Nabble.com <http://nabble.com/><http://nabble.com/> > > >> . > > >> > > >> > > >> - > > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > > >> For additional commands, e-mail: [EMAIL PROTECTED] > > >> > > >> > > > > > > > > > > -- > > View this message in context: > > http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.html > > Sent from the Wicket - User mailing list archive at > > Nabble.com<http://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 delete an item from List view.
On Feb 4, 2008 3:45 AM, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > On 2/3/08, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > > > How about a reconsideration of depreciating ListView? > > > -1 > > If anytime someone comes along with a misunderstanding of a valid component > we don't have a framework left: > - models > - drop down choice > - urls > - mounting > > All those things can be deprecated then. Not true. There are perfectly complete replacements for ListView, not for the other things you mention. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to delete an item from List view.
You do use a delete button, so i guess the values are submitted. Then if you store those first in the model objects you won't loose anything johan On Feb 4, 2008 2:35 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > Hi Johan, > > Yes that will be quickest solution , > But this will clear the fields of all vehicles. > > -Pnerkar > > > Johan Compagner wrote: > > > > wasn't the quickest solution: > > > > public void onSubmit() { > >List vehicles = (List) getParent().getParent().getModelObject(); > >vehicles.remove(index); > >listView.removeAll(); > > } > > > > Then if the list itself is stable on the server side (if other persons > can > > also delete or add stuff to that list you really should do it > differently) > > that should work fine. After you alter the listviews model you have to > > remove all the items so that it will rebuild > > > > johan > > > > > > > > > > On Feb 1, 2008 12:49 AM, pnerkar <[EMAIL PROTECTED]> wrote: > > > >> > >> Hi All, > >> > >> I have rendered a list view on a Web Page. > >> > >> vehicle1X > >> vehicle2X > >> vehicle3X > >> > >> when a person click on 'X', that item should be deleted. > >> But I'm facing an issue, when i click on 'X', last item get deleted. > >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but > >> that > >> component is still there. > >> So while rendering it render vehicle1 & vehicle2. > >> > >> public void onSubmit() { > >>List vehicles = (List) getParent().getParent().getModelObject(); > >>vehicles.remove(index); > >> } > >> > >> can please help out ?? > >> > >> > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html > >> Sent from the Wicket - User mailing list archive at > >> Nabble.com <http://nabble.com/><http://nabble.com/> > >> . > >> > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.html > Sent from the Wicket - User mailing list archive at > Nabble.com<http://nabble.com/> > . > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: How to delete an item from List view.
Hi Johan, Yes that will be quickest solution , But this will clear the fields of all vehicles. -Pnerkar Johan Compagner wrote: > > wasn't the quickest solution: > > public void onSubmit() { >List vehicles = (List) getParent().getParent().getModelObject(); >vehicles.remove(index); >listView.removeAll(); > } > > Then if the list itself is stable on the server side (if other persons can > also delete or add stuff to that list you really should do it differently) > that should work fine. After you alter the listviews model you have to > remove all the items so that it will rebuild > > johan > > > > > On Feb 1, 2008 12:49 AM, pnerkar <[EMAIL PROTECTED]> wrote: > >> >> Hi All, >> >> I have rendered a list view on a Web Page. >> >> vehicle1X >> vehicle2X >> vehicle3X >> >> when a person click on 'X', that item should be deleted. >> But I'm facing an issue, when i click on 'X', last item get deleted. >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but >> that >> component is still there. >> So while rendering it render vehicle1 & vehicle2. >> >> public void onSubmit() { >> List vehicles = (List) getParent().getParent().getModelObject(); >>vehicles.remove(index); >> } >> >> can please help out ?? >> >> >> >> -- >> View this message in context: >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html >> Sent from the Wicket - User mailing list archive at >> Nabble.com<http://nabble.com/> >> . >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -- View this message in context: http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15268198.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 delete an item from List view.
wasn't the quickest solution: public void onSubmit() { List vehicles = (List) getParent().getParent().getModelObject(); vehicles.remove(index); listView.removeAll(); } Then if the list itself is stable on the server side (if other persons can also delete or add stuff to that list you really should do it differently) that should work fine. After you alter the listviews model you have to remove all the items so that it will rebuild johan On Feb 1, 2008 12:49 AM, pnerkar <[EMAIL PROTECTED]> wrote: > > Hi All, > > I have rendered a list view on a Web Page. > > vehicle1X > vehicle2X > vehicle3X > > when a person click on 'X', that item should be deleted. > But I'm facing an issue, when i click on 'X', last item get deleted. > Actually when I delete vehicle2 from my list, it deletes vehicle2 but that > component is still there. > So while rendering it render vehicle1 & vehicle2. > > public void onSubmit() { >List vehicles = (List) getParent().getParent().getModelObject(); >vehicles.remove(index); > } > > can please help out ?? > > > > -- > View this message in context: > http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html > Sent from the Wicket - User mailing list archive at > Nabble.com<http://nabble.com/> > . > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: How to delete an item from List view.
On 2/3/08, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > How about a reconsideration of depreciating ListView? -1 If anytime someone comes along with a misunderstanding of a valid component we don't have a framework left: - models - drop down choice - urls - mounting All those things can be deprecated then. Martijn -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
Re: How to delete an item from List view.
i dont think i was harsh. i simply stated that the excuse "i dont yet know enough" is not really an excuse but a cop out, because most users dont come back and contribute something. im not angry about it, but it is a fact. -igor On Feb 2, 2008 9:05 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > On Feb 2, 2008 2:19 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > well, thats the problem. you say you are not the right person because > > you dont know. and that is the excuse a lot of users give for not > > writing the wiki page. but guess what, after we help them here and > > they do understand how listview works - they still dont come back and > > write the wiki page. > > Don't be too harsh. There have been quite a few people who wrote for > the WIKI before, and to be honest, I haven't always shared my > experiences with e.g. Hibernate with the rest of the world either. > > How about a reconsideration of depreciating ListView? > > Eelco > > > - > 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 delete an item from List view.
On Feb 2, 2008 2:19 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > well, thats the problem. you say you are not the right person because > you dont know. and that is the excuse a lot of users give for not > writing the wiki page. but guess what, after we help them here and > they do understand how listview works - they still dont come back and > write the wiki page. Don't be too harsh. There have been quite a few people who wrote for the WIKI before, and to be honest, I haven't always shared my experiences with e.g. Hibernate with the rest of the world either. How about a reconsideration of depreciating ListView? Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to delete an item from List view.
;> >> >> > reuse old components > > > >> >> >> > > > > >> >> >> > -igor > > > >> >> >> > > > > >> >> >> > > > > >> >> >> > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > > >> >> >> >> > > > >> >> >> >> Hi, > > > >> >> >> >> > > > >> >> >> >> Following is my code for rendering vehicle list- > > > >> >> >> >> > > > >> >> >> >> final VehiclesList vehicles = new > > > >> >> >> >> VehiclesList("vehicledetails", > > > >> >> >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); > > > >> >> >> >> vehicles.setOutputMarkupId(true); > > > >> >> >> >> vehicles.setReuseItems(true); > > > >> >> >> >> add(vehicles); > > > >> >> >> >> > > > >> >> >> >> private static class VehiclesList extends ListView { > > > >> >> >> >> > > > >> >> >> >> > > > >> >> >> >> public VehiclesList (String id, List > > > >> >> >> >> vehicles) { > > > >> >> >> >> super (id, vehicles); > > > >> >> >> >> > > > >> >> >> >> } > > > >> >> >> >> > > > >> >> >> >> protected void populateItem(final ListItem > > > >> >> >> >> item) > > > >> >> >> >> { > > > >> >> >> >> > > > >> >> >> >> item.add(new TextField("vehicle.modelText", new > > > >> >> >> >> PropertyModel(vehicle, "model")).setRequired(true)); > > > >> >> >> >> TextField registrationnumber = new > > > >> >> >> >> TextField("vehicle.registrationnumber", new > > > >> PropertyModel(vehicle, > > > >> >> >> >> "registrationNumber")); > > > >> >> >> >> TextField engineNumber = new > > > >> >> >> >> TextField("vehicle.enginenumber", new > > > >> >> >> >> PropertyModel(vehicle, "engineNumber")); > > > >> >> >> >> > > > >> >> >> >> final int index = item.getIndex(); > > > >> >> >> >> Button remVehBtn = new > > > >> >> Button("btn_removeVeh", > > > >> >> >> >> new ResourceModel( > > > >> >> >> >> "removevehicle" )) { > > > >> >> >> >> public void onSubmit() { > > > >> >> >> >> List vehicles = (List) > > > >> >> >> >> getParent().getParent().getModelObject(); > > > >> >> >> >> > > > >> >> >> >> vehicles.remove(index); > > > >> >> >> >> } > > > >> >> >> >> }); > > > >> >> >> >> } > > > >> >> >> >> } > > > >> >> >> >> > > > >> >> >> >> Thanks a lot for ur reply :) > > > >> >> >> >> > > > >> >> >> >> > > > >> >> >> >> > > > >> >> >> >> > > > >> >> >> >> igor.vaynberg wrote: > > > >> >> >> >> > > > > >> >> >> >> > show us how you populate your listview... > > > >> >> >> >> > > > &
Re: How to delete an item from List view.
stview, use a refreshingview and provide an itemreuse > > >> > strategy. > > >> > > > >> > -igor > > >> > > > >> > > > >> > On Feb 1, 2008 1:51 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > >> >> > > >> >> Hi Igor, > > >> >> > > >> >> Finally I'm able to find out the exact issue. > > >> >> suppose There are 3 items in the list- > > >> >> wicket will assign id as 0, 1 & 2. to those items. > > >> >> So When we say item.getparent().remove(item) to item with id=1, > > >> >> them It'll remove that item from list but item with id=2 will not > > >> remain > > >> >> as > > >> >> it is.. > > >> >> i.e. Now list will have 2 items one with id=0 & id=2. > > >> >> So when we display list, it'll clears the fields for item with id=1. > > >> >> so we need to update id field of item object... But think there is no > > >> way > > >> >> to > > >> >> do that... > > >> >> > > >> >> is there...??? > > >> >> > > >> >> -Pnerkar > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> igor.vaynberg wrote: > > >> >> > > > >> >> > try this: > > >> >> > > > >> >> > onpopulate (final listitem item) { > > >> >> >add(new link("remove") { onclick() { > > >> >> > item.getparent().remove(item); }} > > >> >> > } > > >> >> > > > >> >> > -igor > > >> >> > > > >> >> > > > >> >> > On Jan 31, 2008 6:19 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > >> >> >> > > >> >> >> Hi igor, > > >> >> >> > > >> >> >> But If I remove setReuseItems(true), it'll remove all field values > > >> >> which > > >> >> >> user has entered will be removed. > > >> >> >> Bcz default processing is false for Remove button (Sorry forget to > > >> >> tell > > >> >> >> you) > > >> >> >> I just want to remove vehicle2, but the values entered for vehicle1 > > >> & > > >> >> >> vehicle3 should not be lost. > > >> >> >> > > >> >> >> > > >> >> >> - Pnerkar > > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> igor.vaynberg wrote: > > >> >> >> > > > >> >> >> > vehicles.setReuseItems(true); <== that is what is causing your > > >> list > > >> >> to > > >> >> >> > reuse old components > > >> >> >> > > > >> >> >> > -igor > > >> >> >> > > > >> >> >> > > > >> >> >> > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > >> >> >> >> > > >> >> >> >> Hi, > > >> >> >> >> > > >> >> >> >> Following is my code for rendering vehicle list- > > >> >> >> >> > > >> >> >> >> final VehiclesList vehicles = new VehiclesList("vehicledetails", > > >> >> >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); > > >> >> >> >> vehicles.setOutputMarkupId(true); > > >> >> >> >> vehicles.setReuseItems(true); > > >> >> >> >> add(vehicles); > > >> >> >> >> > > >> >> >> >> private static class VehiclesList extends ListView { > > >> >> >> >> > > >> >> >> >> > > >> >> >> >> public VehiclesList (String id, List vehicles) { > > >> >&g
Re: How to delete an item from List view.
isplay list, it'll clears the fields for item with id=1. > >> >> so we need to update id field of item object... But think there is no > >> way > >> >> to > >> >> do that... > >> >> > >> >> is there...??? > >> >> > >> >> -Pnerkar > >> >> > >> >> > >> >> > >> >> > >> >> igor.vaynberg wrote: > >> >> > > >> >> > try this: > >> >> > > >> >> > onpopulate (final listitem item) { > >> >> >add(new link("remove") { onclick() { > >> >> > item.getparent().remove(item); }} > >> >> > } > >> >> > > >> >> > -igor > >> >> > > >> >> > > >> >> > On Jan 31, 2008 6:19 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> >> >> > >> >> >> Hi igor, > >> >> >> > >> >> >> But If I remove setReuseItems(true), it'll remove all field values > >> >> which > >> >> >> user has entered will be removed. > >> >> >> Bcz default processing is false for Remove button (Sorry forget to > >> >> tell > >> >> >> you) > >> >> >> I just want to remove vehicle2, but the values entered for vehicle1 > >> & > >> >> >> vehicle3 should not be lost. > >> >> >> > >> >> >> > >> >> >> - Pnerkar > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> igor.vaynberg wrote: > >> >> >> > > >> >> >> > vehicles.setReuseItems(true); <== that is what is causing your > >> list > >> >> to > >> >> >> > reuse old components > >> >> >> > > >> >> >> > -igor > >> >> >> > > >> >> >> > > >> >> >> > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> >> >> >> > >> >> >> >> Hi, > >> >> >> >> > >> >> >> >> Following is my code for rendering vehicle list- > >> >> >> >> > >> >> >> >> final VehiclesList vehicles = new VehiclesList("vehicledetails", > >> >> >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); > >> >> >> >> vehicles.setOutputMarkupId(true); > >> >> >> >> vehicles.setReuseItems(true); > >> >> >> >> add(vehicles); > >> >> >> >> > >> >> >> >> private static class VehiclesList extends ListView { > >> >> >> >> > >> >> >> >> > >> >> >> >> public VehiclesList (String id, List vehicles) { > >> >> >> >> super (id, vehicles); > >> >> >> >> > >> >> >> >> } > >> >> >> >> > >> >> >> >> protected void populateItem(final ListItem item) > >> >> >> >> { > >> >> >> >> > >> >> >> >> item.add(new TextField("vehicle.modelText", new > >> >> >> >> PropertyModel(vehicle, "model")).setRequired(true)); > >> >> >> >> TextField registrationnumber = new > >> >> >> >> TextField("vehicle.registrationnumber", new > >> PropertyModel(vehicle, > >> >> >> >> "registrationNumber")); > >> >> >> >> TextField engineNumber = new > >> >> >> >> TextField("vehicle.enginenumber", new > >> >> >> >> PropertyModel(vehicle, "engineNumber")); > >> >> >> >> > >> >> >> >>
Re: How to delete an item from List view.
quot;) { onclick() { >> >> > item.getparent().remove(item); }} >> >> > } >> >> > >> >> > -igor >> >> > >> >> > >> >> > On Jan 31, 2008 6:19 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> Hi igor, >> >> >> >> >> >> But If I remove setReuseItems(true), it'll remove all field values >> >> which >> >> >> user has entered will be removed. >> >> >> Bcz default processing is false for Remove button (Sorry forget to >> >> tell >> >> >> you) >> >> >> I just want to remove vehicle2, but the values entered for vehicle1 >> & >> >> >> vehicle3 should not be lost. >> >> >> >> >> >> >> >> >> - Pnerkar >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> igor.vaynberg wrote: >> >> >> > >> >> >> > vehicles.setReuseItems(true); <== that is what is causing your >> list >> >> to >> >> >> > reuse old components >> >> >> > >> >> >> > -igor >> >> >> > >> >> >> > >> >> >> > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> Hi, >> >> >> >> >> >> >> >> Following is my code for rendering vehicle list- >> >> >> >> >> >> >> >> final VehiclesList vehicles = new VehiclesList("vehicledetails", >> >> >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); >> >> >> >> vehicles.setOutputMarkupId(true); >> >> >> >> vehicles.setReuseItems(true); >> >> >> >> add(vehicles); >> >> >> >> >> >> >> >> private static class VehiclesList extends ListView { >> >> >> >> >> >> >> >> >> >> >> >> public VehiclesList (String id, List vehicles) { >> >> >> >> super (id, vehicles); >> >> >> >> >> >> >> >> } >> >> >> >> >> >> >> >> protected void populateItem(final ListItem item) >> >> >> >> { >> >> >> >> >> >> >> >> item.add(new TextField("vehicle.modelText", new >> >> >> >> PropertyModel(vehicle, "model")).setRequired(true)); >> >> >> >> TextField registrationnumber = new >> >> >> >> TextField("vehicle.registrationnumber", new >> PropertyModel(vehicle, >> >> >> >> "registrationNumber")); >> >> >> >> TextField engineNumber = new >> >> >> >> TextField("vehicle.enginenumber", new >> >> >> >> PropertyModel(vehicle, "engineNumber")); >> >> >> >> >> >> >> >> final int index = item.getIndex(); >> >> >> >> Button remVehBtn = new >> >> Button("btn_removeVeh", >> >> >> >> new ResourceModel( >> >> >> >> "removevehicle" )) { >> >> >> >> public void onSubmit() { >> >> >> >> List vehicles = (List) >> >> >> >> getParent().getParent().getModelObject(); >> >> >> >> vehicles.remove(index); >> >> >> >> } >> >> >> >> }); >> >> >> >> } >> >> >> >> } >> >> >> >> >> >> >> >> Thanks a lot for ur reply :) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
Re: How to delete an item from List view.
ld not be lost. > >> >> > >> >> > >> >> - Pnerkar > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> igor.vaynberg wrote: > >> >> > > >> >> > vehicles.setReuseItems(true); <== that is what is causing your list > >> to > >> >> > reuse old components > >> >> > > >> >> > -igor > >> >> > > >> >> > > >> >> > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> >> >> > >> >> >> Hi, > >> >> >> > >> >> >> Following is my code for rendering vehicle list- > >> >> >> > >> >> >> final VehiclesList vehicles = new VehiclesList("vehicledetails", > >> >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); > >> >> >> vehicles.setOutputMarkupId(true); > >> >> >> vehicles.setReuseItems(true); > >> >> >> add(vehicles); > >> >> >> > >> >> >> private static class VehiclesList extends ListView { > >> >> >> > >> >> >> > >> >> >> public VehiclesList (String id, List vehicles) { > >> >> >> super (id, vehicles); > >> >> >> > >> >> >> } > >> >> >> > >> >> >> protected void populateItem(final ListItem item) > >> >> >> { > >> >> >> > >> >> >> item.add(new TextField("vehicle.modelText", new > >> >> >> PropertyModel(vehicle, "model")).setRequired(true)); > >> >> >> TextField registrationnumber = new > >> >> >> TextField("vehicle.registrationnumber", new PropertyModel(vehicle, > >> >> >> "registrationNumber")); > >> >> >> TextField engineNumber = new > >> >> >> TextField("vehicle.enginenumber", new > >> >> >> PropertyModel(vehicle, "engineNumber")); > >> >> >> > >> >> >> final int index = item.getIndex(); > >> >> >> Button remVehBtn = new > >> Button("btn_removeVeh", > >> >> >> new ResourceModel( > >> >> >> "removevehicle" )) { > >> >> >> public void onSubmit() { > >> >> >> List vehicles = (List) > >> >> >> getParent().getParent().getModelObject(); > >> >> >> vehicles.remove(index); > >> >> >> } > >> >> >> }); > >> >> >> } > >> >> >> } > >> >> >> > >> >> >> Thanks a lot for ur reply :) > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> igor.vaynberg wrote: > >> >> >> > > >> >> >> > show us how you populate your listview... > >> >> >> > > >> >> >> > -igor > >> >> >> > > >> >> >> > > >> >> >> > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> >> >> >> > >> >> >> >> Hi All, > >> >> >> >> > >> >> >> >> I have rendered a list view on a Web Page. > >> >> >> >> > >> >> >> >> vehicle1X > >> >> >> >> vehicle2X > >> >> >> >> vehicle3X > >> >> >> >> > >> >> >> >> when a person click on 'X', that item should be deleted. > >> >> >> >> But I'm facing an issue, when i click on 'X', last item get > >> >> deleted. > >> >> >>
Re: How to delete an item from List view.
quot;vehicledetails", >> >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); >> >> >> vehicles.setOutputMarkupId(true); >> >> >> vehicles.setReuseItems(true); >> >> >> add(vehicles); >> >> >> >> >> >> private static class VehiclesList extends ListView { >> >> >> >> >> >> >> >> >> public VehiclesList (String id, List vehicles) { >> >> >> super (id, vehicles); >> >> >> >> >> >> } >> >> >> >> >> >> protected void populateItem(final ListItem item) >> >> >> { >> >> >> >> >> >> item.add(new TextField("vehicle.modelText", new >> >> >> PropertyModel(vehicle, "model")).setRequired(true)); >> >> >> TextField registrationnumber = new >> >> >> TextField("vehicle.registrationnumber", new PropertyModel(vehicle, >> >> >> "registrationNumber")); >> >> >> TextField engineNumber = new >> >> >> TextField("vehicle.enginenumber", new >> >> >> PropertyModel(vehicle, "engineNumber")); >> >> >> >> >> >> final int index = item.getIndex(); >> >> >> Button remVehBtn = new >> Button("btn_removeVeh", >> >> >> new ResourceModel( >> >> >> "removevehicle" )) { >> >> >> public void onSubmit() { >> >> >> List vehicles = (List) >> >> >> getParent().getParent().getModelObject(); >> >> >> vehicles.remove(index); >> >> >> } >> >> >> }); >> >> >> } >> >> >> } >> >> >> >> >> >> Thanks a lot for ur reply :) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> igor.vaynberg wrote: >> >> >> > >> >> >> > show us how you populate your listview... >> >> >> > >> >> >> > -igor >> >> >> > >> >> >> > >> >> >> > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> Hi All, >> >> >> >> >> >> >> >> I have rendered a list view on a Web Page. >> >> >> >> >> >> >> >> vehicle1X >> >> >> >> vehicle2X >> >> >> >> vehicle3X >> >> >> >> >> >> >> >> when a person click on 'X', that item should be deleted. >> >> >> >> But I'm facing an issue, when i click on 'X', last item get >> >> deleted. >> >> >> >> Actually when I delete vehicle2 from my list, it deletes >> vehicle2 >> >> but >> >> >> >> that >> >> >> >> component is still there. >> >> >> >> So while rendering it render vehicle1 & vehicle2. >> >> >> >> >> >> >> >> public void onSubmit() { >> >> >> >> List vehicles = (List) >> >> >> getParent().getParent().getModelObject(); >> >> >> >> vehicles.remove(index); >> >> >> >> } >> >> >> >> >> >> >> >> can please help out ?? >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> >> View this message in context: >> >> >> >> >> >> >> >> >> >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.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-delete-an-item-from-List-view.-tp15217608p15218960.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-delete-an-item-from-List-view.-tp15217608p15219402.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-delete-an-item-from-List-view.-tp15217608p15234458.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-delete-an-item-from-List-view.-tp15217608p15236550.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 delete an item from List view.
dont use a listview, use a refreshingview and provide an itemreuse strategy. -igor On Feb 1, 2008 1:51 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > Hi Igor, > > Finally I'm able to find out the exact issue. > suppose There are 3 items in the list- > wicket will assign id as 0, 1 & 2. to those items. > So When we say item.getparent().remove(item) to item with id=1, > them It'll remove that item from list but item with id=2 will not remain as > it is.. > i.e. Now list will have 2 items one with id=0 & id=2. > So when we display list, it'll clears the fields for item with id=1. > so we need to update id field of item object... But think there is no way to > do that... > > is there...??? > > -Pnerkar > > > > > igor.vaynberg wrote: > > > > try this: > > > > onpopulate (final listitem item) { > >add(new link("remove") { onclick() { > > item.getparent().remove(item); }} > > } > > > > -igor > > > > > > On Jan 31, 2008 6:19 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> > >> Hi igor, > >> > >> But If I remove setReuseItems(true), it'll remove all field values which > >> user has entered will be removed. > >> Bcz default processing is false for Remove button (Sorry forget to tell > >> you) > >> I just want to remove vehicle2, but the values entered for vehicle1 & > >> vehicle3 should not be lost. > >> > >> > >> - Pnerkar > >> > >> > >> > >> > >> > >> igor.vaynberg wrote: > >> > > >> > vehicles.setReuseItems(true); <== that is what is causing your list to > >> > reuse old components > >> > > >> > -igor > >> > > >> > > >> > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> >> > >> >> Hi, > >> >> > >> >> Following is my code for rendering vehicle list- > >> >> > >> >> final VehiclesList vehicles = new VehiclesList("vehicledetails", > >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); > >> >> vehicles.setOutputMarkupId(true); > >> >> vehicles.setReuseItems(true); > >> >> add(vehicles); > >> >> > >> >> private static class VehiclesList extends ListView { > >> >> > >> >> > >> >> public VehiclesList (String id, List vehicles) { > >> >> super (id, vehicles); > >> >> > >> >> } > >> >> > >> >> protected void populateItem(final ListItem item) > >> >> { > >> >> > >> >> item.add(new TextField("vehicle.modelText", new > >> >> PropertyModel(vehicle, "model")).setRequired(true)); > >> >> TextField registrationnumber = new > >> >> TextField("vehicle.registrationnumber", new PropertyModel(vehicle, > >> >> "registrationNumber")); > >> >> TextField engineNumber = new > >> >> TextField("vehicle.enginenumber", new > >> >> PropertyModel(vehicle, "engineNumber")); > >> >> > >> >> final int index = item.getIndex(); > >> >> Button remVehBtn = new Button("btn_removeVeh", > >> >> new ResourceModel( > >> >> "removevehicle" )) { > >> >> public void onSubmit() { > >> >> List vehicles = (List) > >> >> getParent().getParent().getModelObject(); > >> >> vehicles.remove(index); > >> >> } > >> >> }); > >> >> } > >> >> } > >> >> > >> >> Thanks a lot for ur reply :) > >> >> > >> >> > >> >> > >> >> > >> >> igor.vaynberg wrote: > >> >> > > >> >> > show us how you populate your listview... > >> >> > > >> >> > -ig
Re: How to delete an item from List view.
Hi Igor, Finally I'm able to find out the exact issue. suppose There are 3 items in the list- wicket will assign id as 0, 1 & 2. to those items. So When we say item.getparent().remove(item) to item with id=1, them It'll remove that item from list but item with id=2 will not remain as it is.. i.e. Now list will have 2 items one with id=0 & id=2. So when we display list, it'll clears the fields for item with id=1. so we need to update id field of item object... But think there is no way to do that... is there...??? -Pnerkar igor.vaynberg wrote: > > try this: > > onpopulate (final listitem item) { >add(new link("remove") { onclick() { > item.getparent().remove(item); }} > } > > -igor > > > On Jan 31, 2008 6:19 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> Hi igor, >> >> But If I remove setReuseItems(true), it'll remove all field values which >> user has entered will be removed. >> Bcz default processing is false for Remove button (Sorry forget to tell >> you) >> I just want to remove vehicle2, but the values entered for vehicle1 & >> vehicle3 should not be lost. >> >> >> - Pnerkar >> >> >> >> >> >> igor.vaynberg wrote: >> > >> > vehicles.setReuseItems(true); <== that is what is causing your list to >> > reuse old components >> > >> > -igor >> > >> > >> > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> >> >> Hi, >> >> >> >> Following is my code for rendering vehicle list- >> >> >> >> final VehiclesList vehicles = new VehiclesList("vehicledetails", >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); >> >> vehicles.setOutputMarkupId(true); >> >> vehicles.setReuseItems(true); >> >> add(vehicles); >> >> >> >> private static class VehiclesList extends ListView { >> >> >> >> >> >> public VehiclesList (String id, List vehicles) { >> >> super (id, vehicles); >> >> >> >> } >> >> >> >> protected void populateItem(final ListItem item) >> >> { >> >> >> >> item.add(new TextField("vehicle.modelText", new >> >> PropertyModel(vehicle, "model")).setRequired(true)); >> >> TextField registrationnumber = new >> >> TextField("vehicle.registrationnumber", new PropertyModel(vehicle, >> >> "registrationNumber")); >> >> TextField engineNumber = new >> >> TextField("vehicle.enginenumber", new >> >> PropertyModel(vehicle, "engineNumber")); >> >> >> >> final int index = item.getIndex(); >> >> Button remVehBtn = new Button("btn_removeVeh", >> >> new ResourceModel( >> >> "removevehicle" )) { >> >> public void onSubmit() { >> >> List vehicles = (List) >> >> getParent().getParent().getModelObject(); >> >> vehicles.remove(index); >> >> } >> >> }); >> >> } >> >> } >> >> >> >> Thanks a lot for ur reply :) >> >> >> >> >> >> >> >> >> >> igor.vaynberg wrote: >> >> > >> >> > show us how you populate your listview... >> >> > >> >> > -igor >> >> > >> >> > >> >> > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> Hi All, >> >> >> >> >> >> I have rendered a list view on a Web Page. >> >> >> >> >> >> vehicle1X >> >> >> vehicle2X >> >> >> vehicle3X >> >> >> >> >> >> when a person click on 'X', that item should be deleted. >> >> >> But I'm facing an issue, when i click on 'X', last item get >> deleted. >> >> >> Actually
Re: How to delete an item from List view.
see wicket-extensions Martijn On 2/1/08, pnerkar <[EMAIL PROTECTED]> wrote: > > > Hi Eelco, > > RefreshingView is available in wicket 1.3.0. > While I'm using wicket 1.2.6. > > Regards, > > Pankaj,... > > > Eelco Hillenius wrote: > > > > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> > >> Hi All, > >> > >> I have rendered a list view on a Web Page. > >> > >> vehicle1X > >> vehicle2X > >> vehicle3X > >> > >> when a person click on 'X', that item should be deleted. > >> But I'm facing an issue, when i click on 'X', last item get deleted. > >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but > >> that > >> component is still there. > >> So while rendering it render vehicle1 & vehicle2. > >> > >> public void onSubmit() { > >> List vehicles = (List) > getParent().getParent().getModelObject(); > >> vehicles.remove(index); > >> } > > > > Instead of using ListView, you could consider RefreshingView with it's > > itemReuseStrategy set to ReuseIfModelsEqualStrategy. > > > > Eelco > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: > http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15227738.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] > > -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
Re: How to delete an item from List view.
Hi Eelco, RefreshingView is available in wicket 1.3.0. While I'm using wicket 1.2.6. Regards, Pankaj,... Eelco Hillenius wrote: > > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> Hi All, >> >> I have rendered a list view on a Web Page. >> >> vehicle1X >> vehicle2X >> vehicle3X >> >> when a person click on 'X', that item should be deleted. >> But I'm facing an issue, when i click on 'X', last item get deleted. >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but >> that >> component is still there. >> So while rendering it render vehicle1 & vehicle2. >> >> public void onSubmit() { >> List vehicles = (List) getParent().getParent().getModelObject(); >> vehicles.remove(index); >> } > > Instead of using ListView, you could consider RefreshingView with it's > itemReuseStrategy set to ReuseIfModelsEqualStrategy. > > Eelco > > ----------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15227738.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 delete an item from List view.
Hi igor, I have tried this, Now when I click on remove - it just clear all fields for vehicle2. But none of them get deleted. -pnerkar igor.vaynberg wrote: > > try this: > > onpopulate (final listitem item) { >add(new link("remove") { onclick() { > item.getparent().remove(item); }} > } > > -igor > > > On Jan 31, 2008 6:19 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> Hi igor, >> >> But If I remove setReuseItems(true), it'll remove all field values which >> user has entered will be removed. >> Bcz default processing is false for Remove button (Sorry forget to tell >> you) >> I just want to remove vehicle2, but the values entered for vehicle1 & >> vehicle3 should not be lost. >> >> >> - Pnerkar >> >> >> >> >> >> igor.vaynberg wrote: >> > >> > vehicles.setReuseItems(true); <== that is what is causing your list to >> > reuse old components >> > >> > -igor >> > >> > >> > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> >> >> Hi, >> >> >> >> Following is my code for rendering vehicle list- >> >> >> >> final VehiclesList vehicles = new VehiclesList("vehicledetails", >> >> ((RatingRequestAuto)getModelObject()).getVehicles()); >> >> vehicles.setOutputMarkupId(true); >> >> vehicles.setReuseItems(true); >> >> add(vehicles); >> >> >> >> private static class VehiclesList extends ListView { >> >> >> >> >> >> public VehiclesList (String id, List vehicles) { >> >> super (id, vehicles); >> >> >> >> } >> >> >> >> protected void populateItem(final ListItem item) >> >> { >> >> >> >> item.add(new TextField("vehicle.modelText", new >> >> PropertyModel(vehicle, "model")).setRequired(true)); >> >> TextField registrationnumber = new >> >> TextField("vehicle.registrationnumber", new PropertyModel(vehicle, >> >> "registrationNumber")); >> >> TextField engineNumber = new >> >> TextField("vehicle.enginenumber", new >> >> PropertyModel(vehicle, "engineNumber")); >> >> >> >> final int index = item.getIndex(); >> >> Button remVehBtn = new Button("btn_removeVeh", >> >> new ResourceModel( >> >> "removevehicle" )) { >> >> public void onSubmit() { >> >> List vehicles = (List) >> >> getParent().getParent().getModelObject(); >> >> vehicles.remove(index); >> >> } >> >> }); >> >> } >> >> } >> >> >> >> Thanks a lot for ur reply :) >> >> >> >> >> >> >> >> >> >> igor.vaynberg wrote: >> >> > >> >> > show us how you populate your listview... >> >> > >> >> > -igor >> >> > >> >> > >> >> > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> Hi All, >> >> >> >> >> >> I have rendered a list view on a Web Page. >> >> >> >> >> >> vehicle1X >> >> >> vehicle2X >> >> >> vehicle3X >> >> >> >> >> >> when a person click on 'X', that item should be deleted. >> >> >> But I'm facing an issue, when i click on 'X', last item get >> deleted. >> >> >> Actually when I delete vehicle2 from my list, it deletes vehicle2 >> but >> >> >> that >> >> >> component is still there. >> >> >> So while rendering it render vehicle1 & vehicle2. >> >> >> >> >> >> public void onSubmit() { >> >> >> List vehicles = (List) >> >> getParent().getPare
Re: How to delete an item from List view.
On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > Hi All, > > I have rendered a list view on a Web Page. > > vehicle1X > vehicle2X > vehicle3X > > when a person click on 'X', that item should be deleted. > But I'm facing an issue, when i click on 'X', last item get deleted. > Actually when I delete vehicle2 from my list, it deletes vehicle2 but that > component is still there. > So while rendering it render vehicle1 & vehicle2. > > public void onSubmit() { > List vehicles = (List) getParent().getParent().getModelObject(); > vehicles.remove(index); > } Instead of using ListView, you could consider RefreshingView with it's itemReuseStrategy set to ReuseIfModelsEqualStrategy. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to delete an item from List view.
if you want to talk about a cleaner way... add(new removelink("remove", item.getmodel()) { onclick() { vehicles.remove(getmodelobject()); } } assuming vehicles is a property on listview's parent... -igor On Jan 31, 2008 7:29 PM, Timo Rantalaiho <[EMAIL PROTECTED]> wrote: > On Thu, 31 Jan 2008, pnerkar wrote: > > public void onSubmit() { > > List vehicles = (List) getParent().getParent().getModelObject(); > > vehicles.remove(index); > > } > > As a cleaner way to do this you could try > > > List vehicles = findParent(VehiclesList.class).getModelObject(); > > > Best wishes, > Timo > > -- > Timo Rantalaiho +358-45-6709709 > Reaktor Innovations Oyhttp://www.ri.fi/ > > > > - > 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 delete an item from List view.
On Thu, 31 Jan 2008, pnerkar wrote: > public void onSubmit() { > List vehicles = (List) getParent().getParent().getModelObject(); > vehicles.remove(index); > } As a cleaner way to do this you could try List vehicles = findParent(VehiclesList.class).getModelObject(); Best wishes, Timo -- Timo Rantalaiho +358-45-6709709 Reaktor Innovations Oyhttp://www.ri.fi/ > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to delete an item from List view.
try this: onpopulate (final listitem item) { add(new link("remove") { onclick() { item.getparent().remove(item); }} } -igor On Jan 31, 2008 6:19 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > Hi igor, > > But If I remove setReuseItems(true), it'll remove all field values which > user has entered will be removed. > Bcz default processing is false for Remove button (Sorry forget to tell > you) > I just want to remove vehicle2, but the values entered for vehicle1 & > vehicle3 should not be lost. > > > - Pnerkar > > > > > > igor.vaynberg wrote: > > > > vehicles.setReuseItems(true); <== that is what is causing your list to > > reuse old components > > > > -igor > > > > > > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> > >> Hi, > >> > >> Following is my code for rendering vehicle list- > >> > >> final VehiclesList vehicles = new VehiclesList("vehicledetails", > >> ((RatingRequestAuto)getModelObject()).getVehicles()); > >> vehicles.setOutputMarkupId(true); > >> vehicles.setReuseItems(true); > >> add(vehicles); > >> > >> private static class VehiclesList extends ListView { > >> > >> > >> public VehiclesList (String id, List vehicles) { > >> super (id, vehicles); > >> > >> } > >> > >> protected void populateItem(final ListItem item) > >> { > >> > >> item.add(new TextField("vehicle.modelText", new > >> PropertyModel(vehicle, "model")).setRequired(true)); > >> TextField registrationnumber = new > >> TextField("vehicle.registrationnumber", new PropertyModel(vehicle, > >> "registrationNumber")); > >> TextField engineNumber = new > >> TextField("vehicle.enginenumber", new > >> PropertyModel(vehicle, "engineNumber")); > >> > >> final int index = item.getIndex(); > >> Button remVehBtn = new Button("btn_removeVeh", > >> new ResourceModel( > >> "removevehicle" )) { > >> public void onSubmit() { > >> List vehicles = (List) > >> getParent().getParent().getModelObject(); > >> vehicles.remove(index); > >> } > >> }); > >> } > >> } > >> > >> Thanks a lot for ur reply :) > >> > >> > >> > >> > >> igor.vaynberg wrote: > >> > > >> > show us how you populate your listview... > >> > > >> > -igor > >> > > >> > > >> > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> >> > >> >> Hi All, > >> >> > >> >> I have rendered a list view on a Web Page. > >> >> > >> >> vehicle1X > >> >> vehicle2X > >> >> vehicle3X > >> >> > >> >> when a person click on 'X', that item should be deleted. > >> >> But I'm facing an issue, when i click on 'X', last item get deleted. > >> >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but > >> >> that > >> >> component is still there. > >> >> So while rendering it render vehicle1 & vehicle2. > >> >> > >> >> public void onSubmit() { > >> >> List vehicles = (List) > >> getParent().getParent().getModelObject(); > >> >> vehicles.remove(index); > >> >> } > >> >> > >> >> can please help out ?? > >> >> > >> >> > >> >> > >> >> -- > >> >> View this message in context: > >> >> > >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.html > >> >> Sent from the Wicket - User mailing list archive at Nabble.com. > >> >> > >> >> > >> >> --
Re: How to delete an item from List view.
Hi igor, But If I remove setReuseItems(true), it'll remove all field values which user has entered will be removed. Bcz default processing is false for Remove button (Sorry forget to tell you) I just want to remove vehicle2, but the values entered for vehicle1 & vehicle3 should not be lost. - Pnerkar igor.vaynberg wrote: > > vehicles.setReuseItems(true); <== that is what is causing your list to > reuse old components > > -igor > > > On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> Following is my code for rendering vehicle list- >> >> final VehiclesList vehicles = new VehiclesList("vehicledetails", >> ((RatingRequestAuto)getModelObject()).getVehicles()); >> vehicles.setOutputMarkupId(true); >> vehicles.setReuseItems(true); >> add(vehicles); >> >> private static class VehiclesList extends ListView { >> >> >> public VehiclesList (String id, List vehicles) { >> super (id, vehicles); >> >> } >> >> protected void populateItem(final ListItem item) >> { >> >> item.add(new TextField("vehicle.modelText", new >> PropertyModel(vehicle, "model")).setRequired(true)); >> TextField registrationnumber = new >> TextField("vehicle.registrationnumber", new PropertyModel(vehicle, >> "registrationNumber")); >> TextField engineNumber = new >> TextField("vehicle.enginenumber", new >> PropertyModel(vehicle, "engineNumber")); >> >> final int index = item.getIndex(); >> Button remVehBtn = new Button("btn_removeVeh", >> new ResourceModel( >> "removevehicle" )) { >> public void onSubmit() { >> List vehicles = (List) >> getParent().getParent().getModelObject(); >> vehicles.remove(index); >> } >> }); >> } >> } >> >> Thanks a lot for ur reply :) >> >> >> >> >> igor.vaynberg wrote: >> > >> > show us how you populate your listview... >> > >> > -igor >> > >> > >> > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> >> >> Hi All, >> >> >> >> I have rendered a list view on a Web Page. >> >> >> >> vehicle1X >> >> vehicle2X >> >> vehicle3X >> >> >> >> when a person click on 'X', that item should be deleted. >> >> But I'm facing an issue, when i click on 'X', last item get deleted. >> >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but >> >> that >> >> component is still there. >> >> So while rendering it render vehicle1 & vehicle2. >> >> >> >> public void onSubmit() { >> >> List vehicles = (List) >> getParent().getParent().getModelObject(); >> >> vehicles.remove(index); >> >> } >> >> >> >> can please help out ?? >> >> >> >> >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.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-delete-an-item-from-List-view.-tp15217608p15218960.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-delete-an-item-from-List-view.-tp15217608p15219402.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 delete an item from List view.
vehicles.setReuseItems(true); <== that is what is causing your list to reuse old components -igor On Jan 31, 2008 5:36 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > Hi, > > Following is my code for rendering vehicle list- > > final VehiclesList vehicles = new VehiclesList("vehicledetails", > ((RatingRequestAuto)getModelObject()).getVehicles()); > vehicles.setOutputMarkupId(true); > vehicles.setReuseItems(true); > add(vehicles); > > private static class VehiclesList extends ListView { > > > public VehiclesList (String id, List vehicles) { > super (id, vehicles); > > } > > protected void populateItem(final ListItem item) > { > > item.add(new TextField("vehicle.modelText", new > PropertyModel(vehicle, "model")).setRequired(true)); > TextField registrationnumber = new > TextField("vehicle.registrationnumber", new PropertyModel(vehicle, > "registrationNumber")); > TextField engineNumber = new > TextField("vehicle.enginenumber", new > PropertyModel(vehicle, "engineNumber")); > > final int index = item.getIndex(); > Button remVehBtn = new Button("btn_removeVeh", new > ResourceModel( > "removevehicle" )) { > public void onSubmit() { > List vehicles = (List) > getParent().getParent().getModelObject(); > vehicles.remove(index); > } > }); > } > } > > Thanks a lot for ur reply :) > > > > > igor.vaynberg wrote: > > > > show us how you populate your listview... > > > > -igor > > > > > > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: > >> > >> Hi All, > >> > >> I have rendered a list view on a Web Page. > >> > >> vehicle1X > >> vehicle2X > >> vehicle3X > >> > >> when a person click on 'X', that item should be deleted. > >> But I'm facing an issue, when i click on 'X', last item get deleted. > >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but > >> that > >> component is still there. > >> So while rendering it render vehicle1 & vehicle2. > >> > >> public void onSubmit() { > >> List vehicles = (List) getParent().getParent().getModelObject(); > >> vehicles.remove(index); > >> } > >> > >> can please help out ?? > >> > >> > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.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-delete-an-item-from-List-view.-tp15217608p15218960.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 delete an item from List view.
Hi, Following is my code for rendering vehicle list- final VehiclesList vehicles = new VehiclesList("vehicledetails", ((RatingRequestAuto)getModelObject()).getVehicles()); vehicles.setOutputMarkupId(true); vehicles.setReuseItems(true); add(vehicles); private static class VehiclesList extends ListView { public VehiclesList (String id, List vehicles) { super (id, vehicles); } protected void populateItem(final ListItem item) { item.add(new TextField("vehicle.modelText", new PropertyModel(vehicle, "model")).setRequired(true)); TextField registrationnumber = new TextField("vehicle.registrationnumber", new PropertyModel(vehicle, "registrationNumber")); TextField engineNumber = new TextField("vehicle.enginenumber", new PropertyModel(vehicle, "engineNumber")); final int index = item.getIndex(); Button remVehBtn = new Button("btn_removeVeh", new ResourceModel( "removevehicle" )) { public void onSubmit() { List vehicles = (List) getParent().getParent().getModelObject(); vehicles.remove(index); } }); } } Thanks a lot for ur reply :) igor.vaynberg wrote: > > show us how you populate your listview... > > -igor > > > On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: >> >> Hi All, >> >> I have rendered a list view on a Web Page. >> >> vehicle1X >> vehicle2X >> vehicle3X >> >> when a person click on 'X', that item should be deleted. >> But I'm facing an issue, when i click on 'X', last item get deleted. >> Actually when I delete vehicle2 from my list, it deletes vehicle2 but >> that >> component is still there. >> So while rendering it render vehicle1 & vehicle2. >> >> public void onSubmit() { >> List vehicles = (List) getParent().getParent().getModelObject(); >> vehicles.remove(index); >> } >> >> can please help out ?? >> >> >> >> -- >> View this message in context: >> http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.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-delete-an-item-from-List-view.-tp15217608p15218960.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 delete an item from List view.
show us how you populate your listview... -igor On Jan 31, 2008 3:49 PM, pnerkar <[EMAIL PROTECTED]> wrote: > > Hi All, > > I have rendered a list view on a Web Page. > > vehicle1X > vehicle2X > vehicle3X > > when a person click on 'X', that item should be deleted. > But I'm facing an issue, when i click on 'X', last item get deleted. > Actually when I delete vehicle2 from my list, it deletes vehicle2 but that > component is still there. > So while rendering it render vehicle1 & vehicle2. > > public void onSubmit() { > List vehicles = (List) getParent().getParent().getModelObject(); > vehicles.remove(index); > } > > can please help out ?? > > > > -- > View this message in context: > http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.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 delete an item from List view.
Hi All, I have rendered a list view on a Web Page. vehicle1X vehicle2X vehicle3X when a person click on 'X', that item should be deleted. But I'm facing an issue, when i click on 'X', last item get deleted. Actually when I delete vehicle2 from my list, it deletes vehicle2 but that component is still there. So while rendering it render vehicle1 & vehicle2. public void onSubmit() { List vehicles = (List) getParent().getParent().getModelObject(); vehicles.remove(index); } can please help out ?? -- View this message in context: http://www.nabble.com/How-to-delete-an-item-from-List-view.-tp15217608p15217608.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]