Any good examples? :) It'd be certainly better to have some repeaters instead of so many single Label declarations.
On Sat, Oct 23, 2010 at 5:32 PM, James Carman [via Apache Wicket] < ml-node+3008524-1615548235-152...@n4.nabble.com<ml-node%2b3008524-1615548235-152...@n4.nabble.com> > wrote: > You'd be surprised what you can do with a table. > > On Sat, Oct 23, 2010 at 11:09 AM, Zeldor <[hidden > email]<http://user/SendEmail.jtp?type=node&node=3008524&i=0>> > wrote: > > > > > It's a table with lots of data to display, with a mixture of plain text, > > data from session and from arrays, so it'd be rather hard to solve it > with > > ListView. > > > > So my only problem is how to point the Label to data that is outside > Form. > > > > On Sat, Oct 23, 2010 at 5:03 PM, James Carman [via Apache Wicket] < > > [hidden email] > > <http://user/SendEmail.jtp?type=node&node=3008524&i=1><[hidden > email] <http://user/SendEmail.jtp?type=node&node=3008524&i=2>> > >> wrote: > > > >> The PropertyModel takes a "root" object on which it will evaluate the > >> expression. So, you have to make sure the property is traversable > >> from the root object. Most likely, you'd be better off using a > >> ListView for your situation if you're trying to show all the items in > >> the list. > >> > >> On Sat, Oct 23, 2010 at 10:59 AM, Zeldor <[hidden email]< > http://user/SendEmail.jtp?type=node&node=3008486&i=0>> > >> wrote: > >> > >> > > >> > Ha! Good suggestion, I should have looked at "this" earlier. I guess I > > >> need > >> > better understanding of how things work. "this" in my situation > referred > >> > just to a form, so it could not find the data required. When I cloned > the > >> > >> > ArrayList again in the Form, it works. But that's not exactly good > thing > >> to > >> > do, what should I use instead of "this" to get the data properly, > without > >> > >> > repeating it? "Building.class" does not work [same error with get > >> method]. I > >> > just want to access and display data that is outside form... > >> > > >> > Right now it looks like that: > >> > > >> > public class Building extends EconPage{ > >> > public Building() { > >> > int nation = MySession.loggedInUser.getNation(); > >> > ArrayList<Double> base_costs = new ArrayList<Double>(); > >> > final ArrayList<Double> house_cost = new ArrayList<Double>(5); > >> > ... > >> > add(new FeedbackPanel("errorMsg")); > >> > Form<String> buildHousesForm = new > Form<String>("buildHousesForm", > >> > >> > new Model<String>()) { > >> > private TextField<Long> build_houses = new > >> > TextField<Long>("build_houses", new Model<Long>()); > >> > { > >> > ... > >> > add(new Label("houses_infracost", new > >> > PropertyModel(this, "houses_cost.0"))); > >> > ... > >> > add(build_houses); > >> > } > >> > }; > >> > add(buildHousesForm); > >> > } > >> > } > >> > > >> > > >> > > >> > On Sat, Oct 23, 2010 at 2:13 PM, Sven Meier [via Apache Wicket] < > >> > [hidden email] > >> > <http://user/SendEmail.jtp?type=node&node=3008486&i=1><[hidden > > >> email] <http://user/SendEmail.jtp?type=node&node=3008486&i=2>> > >> >> wrote: > >> > > >> >> The PropertyModel is having problems with "house_cost". > >> >> > >> >> What is "this" in your example? Is "house_cost" a member variable of > >> >> your "this"? > >> >> > >> >> Sven > >> >> > >> >> On 10/23/2010 11:35 AM, Zeldor wrote: > >> >> > >> >> > Nope, still same error: > >> >> > > >> >> > org.apache.wicket.RequestCycle logRuntimeException: no get method > >> >> > defined for class: class com.myproject.economy.Building$1 > expression: > >> >> > house_cost > >> >> > org.apache.wicket.WicketRuntimeException: no get method defined for > > >> >> > class: class com.myproject.economy.Building$1 expression: > house_cost > >> >> > > >> >> > > >> >> > > >> >> > { > >> >> > System.out.println("Values:" + house_cost.get(0)+ + > >> >> > house_cost.get(1)+ + house_cost.get(2)+ + house_cost.get(3)+ + > >> >> > house_cost.get(4) ); > >> >> > } > >> >> > This works and gives proper values. I'd be surprised if Wicket > >> required > >> >> smth > >> >> > special just to display that... > >> >> > > >> >> > > >> >> > On Sat, Oct 23, 2010 at 7:08 AM, Ernesto Reinaldo Barreiro-4 [via > >> Apache > >> >> > Wicket]<[hidden email]< > >> http://user/SendEmail.jtp?type=node&node=3008353&i=0> > >> >> <[hidden email] < > http://user/SendEmail.jtp?type=node&node=3008353&i=1>> > >> > >> >> > > >> >> >> wrote: > >> >> >> > >> >> > > >> >> >> Can you try PropertyModel(this, "house_cost[4]")? > >> >> >> > >> >> >> Ernesto > >> >> >> > >> >> >> On Fri, Oct 22, 2010 at 10:39 PM, Zeldor<[hidden email]< > >> >> http://user/SendEmail.jtp?type=node&node=3008166&i=0>> > >> >> >> wrote: > >> >> >> > >> >> >> > >> >> >>> Hi, > >> >> >>> > >> >> >>> I am trying to make an ArrayList, populate it and then display > them > >> >> [and > >> >> >>> > >> >> >> do > >> >> >> > >> >> >>> other stuff later, but I did not get so far]. It does not work > >> though, > >> >> so > >> >> >>> > >> >> >> > >> >> >>> what I am missing? > >> >> >>> > >> >> >>> My code looks like that: > >> >> >>> > >> >> >>> > >> >> >>> ... > >> >> >>> ArrayList<Double> house_cost = new > >> >> ArrayList<Double>(5); > >> >> >>> ... > >> >> >>> [adding some data here] > >> >> >>> > >> >> >>> [form] > >> >> >>> add(new Label("houses_goldcost", new PropertyModel(this, > >> >> >>> "house_cost.get(4)"))); > >> >> >>> ... > >> >> >>> > >> >> >>> I am of course getting the generic "no get method defined for > class" > >> > >> >> >>> > >> >> >> error, > >> >> >> > >> >> >>> so I must be doing something wrong. What is the correct way to > get > >> just > >> >> > >> >> >>> > >> >> >> one > >> >> >> > >> >> >>> cell from ArrayList and display it with a Label? > >> >> >>> > >> >> >>> > >> >> >>> -- > >> >> >>> View this message in context: > >> >> >>> > >> >> >> > >> >> > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t>> > > >> < > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t&by-user=t>>> > > >> > >> >> < > >> >> > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t&by-user=t>> > > >> < > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t&by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t&by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3007849.html?by-user=t&by-user=t&by-user=t&by-user=t>>>> > > >> > >> >> > >> >> >> > >> >> >>> Sent from the Users forum mailing list archive at Nabble.com. > >> >> >>> > >> >> >>> > >> --------------------------------------------------------------------- > >> >> >>> To unsubscribe, e-mail: [hidden email]< > >> >> http://user/SendEmail.jtp?type=node&node=3008166&i=1> > >> >> >>> For additional commands, e-mail: [hidden email]< > >> >> http://user/SendEmail.jtp?type=node&node=3008166&i=2> > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >> > --------------------------------------------------------------------- > >> > >> >> >> To unsubscribe, e-mail: [hidden email]< > >> >> http://user/SendEmail.jtp?type=node&node=3008166&i=3> > >> >> >> For additional commands, e-mail: [hidden email]< > >> >> http://user/SendEmail.jtp?type=node&node=3008166&i=4> > >> >> >> > >> >> >> > >> >> >> > >> >> >> ------------------------------ > >> >> >> View message @ > >> >> >> > >> >> > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008166.html<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008166.html?by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008166.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008166.html?by-user=t&by-user=t>> > > >> < > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008166.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008166.html?by-user=t&by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008166.html?by-user=t&by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008166.html?by-user=t&by-user=t&by-user=t>>> > > >> > >> >> >> To unsubscribe from ArrayList, Label and Model, click here< > >> >> > >> > http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t&by-user=t>> > > >> < > >> > http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t&by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t&by-user=t<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t&by-user=t&by-user=t>>>>. > > >> > >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> > > >> >> > >> >> > >> >> --------------------------------------------------------------------- > > >> >> To unsubscribe, e-mail: [hidden email]< > >> http://user/SendEmail.jtp?type=node&node=3008353&i=2> > >> >> For additional commands, e-mail: [hidden email]< > >> http://user/SendEmail.jtp?type=node&node=3008353&i=3> > >> >> > >> >> > >> >> > >> >> ------------------------------ > >> >> View message @ > >> >> > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008353.html<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008353.html?by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008353.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008353.html?by-user=t&by-user=t>> > > >> >> To unsubscribe from ArrayList, Label and Model, click here< > >> > http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t&by-user=t>>>. > > >> > >> >> > >> >> > >> >> > >> > > >> > -- > >> > View this message in context: > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008482.html<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008482.html?by-user=t> > < > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008482.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008482.html?by-user=t&by-user=t>> > > >> > >> > Sent from the Users forum mailing list archive at Nabble.com. > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: [hidden email]< > http://user/SendEmail.jtp?type=node&node=3008486&i=3> > >> > For additional commands, e-mail: [hidden email]< > http://user/SendEmail.jtp?type=node&node=3008486&i=4> > >> > > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [hidden email]< > http://user/SendEmail.jtp?type=node&node=3008486&i=5> > >> For additional commands, e-mail: [hidden email]< > http://user/SendEmail.jtp?type=node&node=3008486&i=6> > >> > >> > >> > >> ------------------------------ > >> View message @ > >> > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008486.html<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008486.html?by-user=t> > >> To unsubscribe from ArrayList, Label and Model, click here< > http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=&by-user=t>>. > > >> > >> > >> > > > > -- > > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008495.html<http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008495.html?by-user=t> > > > Sent from the Users forum mailing list archive at Nabble.com. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [hidden > > email]<http://user/SendEmail.jtp?type=node&node=3008524&i=3> > > For additional commands, e-mail: [hidden > > email]<http://user/SendEmail.jtp?type=node&node=3008524&i=4> > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=3008524&i=5> > For additional commands, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=3008524&i=6> > > > > ------------------------------ > View message @ > http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008524.html > To unsubscribe from ArrayList, Label and Model, click > here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3007849&code=cGdyb25raWV3aWN6QGdtYWlsLmNvbXwzMDA3ODQ5fC0xMTUwMjA4NDM=>. > > > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ArrayList-Label-and-Model-tp3007849p3008548.html Sent from the Users forum 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