0

Reading XML attributes to a ListBox problem!

asked 2015-02-23 14:40:16 +0800

jolubrech gravatar image jolubrech
1

Hello! I'm implementing MVC design pattern. I created a listbox just like the demos. I'm doing the parsing from a xml file and reading some attributes that i'm desperate to show in that listbox. I read the attributes, I save them as string variables:

for (int index = 0; index < attributes.getLength(); index++) {

                    apellido = attributes.getValue("last");
                    nombre = attributes.getValue("first");
                    color = attributes.getValue("color");
            }

What I can't seem to do is load those attributes to the listbox using

profesoresList.add(new Profesores(id++,nombre,apellido,color));

I'd be great if someone tell me that maybe is imposible to load data that is being read at the same time. When it comes to static data, is really easy but dynamic as this example creates and obstacle for me.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-02-28 10:34:54 +0800

Darksu gravatar image Darksu
1991 1 4

updated 2015-03-08 14:21:15 +0800

Hello jolubrech,

Personally i would recommend using the mvvm design pattern because it is much easier to update the listbox and it's model using the @NotifyChange.

But for more information on how to implement it using MVC or MVVM please refer to the following url:

http://books.zkoss.org/wiki/ZKEssentials/Chapter6:ImplementingCRUD

Best Regards,

Darksu

link publish delete flag offensive edit

Comments

@Darksu, the link is not working.

chillworld ( 2015-03-01 07:01:21 +0800 )edit

Fixed, thanks chillworld

Darksu ( 2015-03-08 14:21:29 +0800 )edit

your welcome :)

chillworld ( 2015-03-08 19:18:05 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2015-02-23 14:40:16 +0800

Seen: 12 times

Last updated: Mar 08 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More