Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 55
Registered: ‎02-08-2010
My Device: Blackberry Bold
My Carrier: Verizon
Accepted Solution

XML driven UI development

Hi,

 

I've hardcoded all my UI till now and would like to make my UI more customizable. (Fields on a screen, data in a field, etc.)


I'm used to doing this on webapps, but I'm wondering if this is a good idea on blackberry since XML parsing seems to be an expensive task.

 

Can anyone provide tips on if it's a good idea / if there's some other way to do it? 

 

Thanks,

Teja.

Developer
Posts: 19,629
Registered: ‎07-14-2008
My Device: Not Specified

Re: XML driven UI development

We do this for some screens and have written, for a third party, an XML based 'interpreter' which as well as screens, allowed the XML to specify form flow and collection logic. 

 

The performance is fine, though we do try to create the Screens once, cache them, and reuse rather than creating each time. 

 

The biggest issue I have is that it is very difficult to tailor the screens, for example to look OK on various device's and to be able to do intelligent processing - for example to do context sensitive processing.  Personally for our applications, I'm not sure that we have saved time overall. 

 

In summary, I think for simple forms/data capture, there is value in looking at this, but for a complicated application, I'm not convinced.

 

But it is definitely do-able.

Contributor
Posts: 25
Registered: ‎02-19-2010
My Device: bold 9700
My Carrier: att

Re: XML driven UI development

I think the answer to this question is probably the same no matter what the UI platform. I've done this with web pages. The issue is that it quickly becomes much more complicated than you would have guessed. Also, I'd say it depends highly on what you want to customize. And, as Peter said, you may be left with wondering whether you should have done it. Rather than an overall "xml framework" approach maybe you can get by with a simple property file and a bunch of "if, then, else" logic.

 

"as simple as possible and no simper"

Developer
Posts: 55
Registered: ‎02-08-2010
My Device: Blackberry Bold
My Carrier: Verizon

Re: XML driven UI development

Cool, thanks !

New Developer
Posts: 13
Registered: ‎08-27-2008
My Device: Not Specified

Re: XML driven UI development

Hi,

Can u please guide me what to do for XML driven UI development for web services.

Actually I am looking for a sample in which create an XML  for Login Screen parse that xml and According to parse data the Login Screen UI will get display on the Screen can any of you please guide me how to 

do this stuff.

Developer
Posts: 19,629
Registered: ‎07-14-2008
My Device: Not Specified

Re: XML driven UI development

I can't give you anything, this is all our own code.

 

Below is an example Field definition, in XML, which shows you the sort of things that we do.

 

In simplistic terms, the Screen processing just parses the XML (using a SAX parser) and adds the Fields to the Screen, so it is not that complicated. 

 

But it is a lot of work.

 

<Field type="Checkbox" label="Submitted?"
    name=”SubFlagField” dataName=”_subFlag”
    display="'Y'" bold="'Y'" size="2" update="N" >
    <CheckboxField default=”N” />
</Field>