You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Altuğ Bilgin Altıntaş <al...@gmail.com> on 2010/08/31 09:14:43 UTC
Listview remove columns on the fly
Hi all;
How can i disable Listview's column/s while post it to excel on the fly. I
mean i don't want to post all columns into excel.
Link linkExcel = new Link("linkExcel") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
getRequestCycle().setRequestTarget(
new ComponentRequestTarget(tableContainer) {
@Override
public void respond(RequestCycle requestCycle) {
final int oldipp =
supplierListView.getRowsPerPage();
supplierListView.setRowsPerPage(Integer.MAX_VALUE);
supplierListView.setMetaData();
*// I don't want to post all listview's
columns into excel *
super.respond(requestCycle);
supplierListView.setRowsPerPage(oldipp);
}
});
WebResponse wr = (WebResponse) getResponse();
wr.setContentType("application/vnd.ms-excel;
charset=UTF-8");
wr.setCharacterEncoding("UTF-8");
wr.setHeader("content-disposition",
"attachment;filename=excel.xls");
}
};
Thanks.
Re: [BULK] Re: Listview remove columns on the fly
Posted by Benedikt Schlegel <be...@betasystems.com>.
If you want to modify your data on a column-base, you should consider
using a DataTable instead of DataView/ListView.
So long,
Benedikt
Save Paper: Think Before You Print Beta Systems Email Disclaimer and Email
Impressum
Beta Systems email messages are confidential. They may also be privileged
or otherwise protected by work product immunity orother legal rules. If
you have received an email by mistake please let us know by reply and then
delete it from your system; you should not copy it or disclose its
contents to anyone. All messages sent to and from Beta Systems may be
monitored to ensure compliance with internal policies and to protect our
business. Emails are not secure and cannot be guaranteed to be error free
as they can be intercepted, amended, lost or destroyed, or contain
viruses. Anyone who communicates with us by email is taken to accept these
risks.Beta Systems Email-Sicherheitsinformation
Die Inhalte der Emails von Beta Systems sind vertraulich. Sie unterliegen
darüber hinaus ggf. dem Schutz von Arbeitsergebnissen oder sind
anderweitig rechtlich geschützt. Falls Sie diese Email irrtümlich erhalten
haben, benachrichtigen Sie uns bitte unverzüglich und löschen Sie
anschließend die Email. Es ist untersagt, diese Email oder deren Inhalt zu
kopieren oder Dritten zugänglich zu machen. Wir behalten uns das Recht
vor, jegliche an bzw. von Beta Systems gesendeten Nachrichten zu
überprüfen, um die Einhaltung unserer internen Richtlinien sowie die
Wahrung unserer Geschäftsinteressen zu gewährleisten. Da Emails nicht
sicher sind, kann eine fehlerfreie Übermittlung nicht gewährleistet
werden. Emails können abgefangen und modifiziert oder zerstört werden,
verloren gehen oder Viren enthalten. Die Kommunikation mit Beta Systems
per Email geschieht auf eigene Gefahr.
Mandatory Information for business email according to German trade laws /
Pflichtangaben für geschäftliche Emails gemäß Handelsgesetzbuch und
Aktiengesetz:
Beta Systems Software AG
Alt-Moabit 90d
10559 Berlin
Germany
Phone: +49-(0)30-726 118-0
Fax: +49-(0)30-726 118-800
info@betasystems.com
Chairman of the supervisory board / Vorsitzender des Aufsichtsrats: Dr.
Günter Lewald
Management board / Vorstand: Jürgen Herbott (CEO/Vorstandsvorsitzender),
Gernot Sagl (CFO)
Legal form / Rechtsform: Aktiengesellschaft
Registered office / Sitz: Berlin
Commercial register / Handelsregister: Berlin Charlottenburg, HRB 38 874
Ust-ID-Nr.: DE 136572034, St.-Nr.: DE 29/1/3927
Bank / Bankverbindung: Deutsche Bank Berlin, BLZ 10070000
Account No / Konto-Nr.: 0680488
BIC DEUTDEBB, IBAN: DE94 1007 0000 0068 0488 00
Re: Listview remove columns on the fly
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Any button will re-render the page. Just make your column in visible:
listview() {
onpopulate (item) {
item.add(column.setVisible(if-you-want-to-show-it-now));
}
}
form.add(listview);
button=new button() {
onsubmit() {
if-you-want-to-show-it-now = false;
}
}
form.add(button);
2010/8/31 Altuğ Bilgin Altıntaş <al...@gmail.com>:
> Any code example ?
>
> Thanks.
>
> 2010/8/31 Martin Makundi <ma...@koodaripalvelut.com>
>
>> Re-render it before going to excel..
>>
>> 2010/8/31 Altuğ Bilgin Altıntaş <al...@gmail.com>:
>> > Hi all;
>> >
>> > How can i disable Listview's column/s while post it to excel on the fly.
>> I
>> > mean i don't want to post all columns into excel.
>> >
>> > Link linkExcel = new Link("linkExcel") {
>> > private static final long serialVersionUID = 1L;
>> >
>> > @Override
>> > public void onClick() {
>> >
>> > getRequestCycle().setRequestTarget(
>> > new ComponentRequestTarget(tableContainer) {
>> > @Override
>> > public void respond(RequestCycle requestCycle)
>> {
>> > final int oldipp =
>> > supplierListView.getRowsPerPage();
>> >
>> > supplierListView.setRowsPerPage(Integer.MAX_VALUE);
>> > supplierListView.setMetaData();
>> > *// I don't want to post all listview's
>> > columns into excel *
>> >
>> > super.respond(requestCycle);
>> > supplierListView.setRowsPerPage(oldipp);
>> > }
>> > });
>> > WebResponse wr = (WebResponse) getResponse();
>> > wr.setContentType("application/vnd.ms-excel;
>> > charset=UTF-8");
>> > wr.setCharacterEncoding("UTF-8");
>> > wr.setHeader("content-disposition",
>> > "attachment;filename=excel.xls");
>> >
>> > }
>> > };
>> >
>> > Thanks.
>> >
>>
>
Re: Listview remove columns on the fly
Posted by Altuğ Bilgin Altıntaş <al...@gmail.com>.
Any code example ?
Thanks.
2010/8/31 Martin Makundi <ma...@koodaripalvelut.com>
> Re-render it before going to excel..
>
> 2010/8/31 Altuğ Bilgin Altıntaş <al...@gmail.com>:
> > Hi all;
> >
> > How can i disable Listview's column/s while post it to excel on the fly.
> I
> > mean i don't want to post all columns into excel.
> >
> > Link linkExcel = new Link("linkExcel") {
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > public void onClick() {
> >
> > getRequestCycle().setRequestTarget(
> > new ComponentRequestTarget(tableContainer) {
> > @Override
> > public void respond(RequestCycle requestCycle)
> {
> > final int oldipp =
> > supplierListView.getRowsPerPage();
> >
> > supplierListView.setRowsPerPage(Integer.MAX_VALUE);
> > supplierListView.setMetaData();
> > *// I don't want to post all listview's
> > columns into excel *
> >
> > super.respond(requestCycle);
> > supplierListView.setRowsPerPage(oldipp);
> > }
> > });
> > WebResponse wr = (WebResponse) getResponse();
> > wr.setContentType("application/vnd.ms-excel;
> > charset=UTF-8");
> > wr.setCharacterEncoding("UTF-8");
> > wr.setHeader("content-disposition",
> > "attachment;filename=excel.xls");
> >
> > }
> > };
> >
> > Thanks.
> >
>
Re: Listview remove columns on the fly
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Re-render it before going to excel..
2010/8/31 Altuğ Bilgin Altıntaş <al...@gmail.com>:
> Hi all;
>
> How can i disable Listview's column/s while post it to excel on the fly. I
> mean i don't want to post all columns into excel.
>
> Link linkExcel = new Link("linkExcel") {
> private static final long serialVersionUID = 1L;
>
> @Override
> public void onClick() {
>
> getRequestCycle().setRequestTarget(
> new ComponentRequestTarget(tableContainer) {
> @Override
> public void respond(RequestCycle requestCycle) {
> final int oldipp =
> supplierListView.getRowsPerPage();
>
> supplierListView.setRowsPerPage(Integer.MAX_VALUE);
> supplierListView.setMetaData();
> *// I don't want to post all listview's
> columns into excel *
>
> super.respond(requestCycle);
> supplierListView.setRowsPerPage(oldipp);
> }
> });
> WebResponse wr = (WebResponse) getResponse();
> wr.setContentType("application/vnd.ms-excel;
> charset=UTF-8");
> wr.setCharacterEncoding("UTF-8");
> wr.setHeader("content-disposition",
> "attachment;filename=excel.xls");
>
> }
> };
>
> Thanks.
>