OK. I am glad someone is trying to understand my problem :) So, what is complex about Wicket and Datatable to show any SQL results in a HTML table format. (Just as you may know Oracle 's iSQL-Plus which you just write SQL, then click on Run command and then see the results in a HTML table)
1) For simple way, you need domain objects as you call <Entity>. But for an unknown SQL command this is impossible because you cant know what domain object the SQL result will match, right 2) For the custom way, you need to code nested repeaters for the case you dont use any domain objects, to loop for table headers and rows. Just tell me there is no way other than option 2 which is the hard way.. BTW: Struts is just a View layer too, but it has DisplayTag component that saves you from coding nested repeaters, loopers etc. On 21 July 2011 17:22, Martin Grigorov <mgrigo...@apache.org> wrote: > Am I that old or .NET is younger than 10 years ? > > First tell me what is so complex with wicket-extensions DataTable and > I'll tell you how to do it ;-) > > You *need* to extract the DB meta data if you want the dynamics. > Wicket is web framework, not common data extraction framework. > Once you have the column names then you can create the > List<IColumn<Entity>> and IDataProvider<Entity> needed by DataTable. > From there on Wicket will create the table for you. > > So if you do the "easy" part to extract the columns meta data then > give it to me and I'll do the "hard" part to dress it in a DataTable > ;-) > > On Thu, Jul 21, 2011 at 5:08 PM, davut uysal <dauy...@gmail.com> wrote: > > Yeah, I agree there must be some easier way. I hope the Wicket gurus and > > fanboys here can show the simple way and save the Wicket's title and > pride - > > easiest framework ever :) > > > > I remember, even the Struts 1 framework had a component named > "DisplayTag" > > that can be easily bind to dynamic datasets or resultsets. So Struts 1 > > DisplayTag component can show any data in a Table format without needing > to > > know the result of the SELECT SQL Queries. It can show the results of any > > SQL simply without coding any nested repeater to loop for headers and > rows.. > > > > I also remember, even 10 years ago it was very easy to do this kind of > > dynamic things in .NET. .NET has GridView component which can also be > bind > > easily to any dataset simply, just simple as below: > > > > DataSet ds = new DataSet(); > > OracleConnection conn = new > > OracleConnection(strConnectionString); > > OracleDataAdapter adap = new OracleDataAdapter(txtSql.Text, > > conn); > > > > conn.Open(); > > adap.Fill(ds); > > > > GridView1.DataSource = ds; > > GridView1.DataBind(); > > > > So tell me if Wicket framework is that simple or not :) > > > > > > On 21 July 2011 15:18, Lurtz Nazgul <lu...@ymail.com> wrote: > > > >> Any simple way ? > >> > >> Thanks. > >> > >> > >> > >> ________________________________ > >> From: Wilhelmsen Tor Iver <toriv...@arrive.no> > >> To: "users@wicket.apache.org" <users@wicket.apache.org> > >> Sent: Thu, July 21, 2011 3:10:16 PM > >> Subject: RE: dynamic DataTable > >> > >> > Since TextArea can contain any SELECT statement, Column names, count > can > >> >change > >> > > >> > every time. So I need a dynamic table that is compatible to view any > >> SELECT > >> > Statement result. > >> > >> Since you appear to have no need for performing updates or inserts, try > >> ditching > >> the DataTable in favour of using nested repeaters over the > >> ResultSetMetaData > >> column info and ResultSet rows instead. > >> > >> - Tor Iver > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >