Own GUIs with UIBuilder

48 views
Skip to first unread message

trash.buc...@gmail.com

unread,
Jun 8, 2015, 3:52:35 PM6/8/15
to codenameone...@googlegroups.com
Hi together

I don't use the GUI Designer of cn1, because I want create dynamic GUI's. For this I have create some own Form-classes which extends from Form. But I don't know if this is an good idea!?
In my own Form-classes I added the GUI-Elements on load.

But now I have no idea how I can handle my GUI's with the UIBuilder class. Have you got any idea?

Kind regards


Steve Hannah

unread,
Jun 8, 2015, 3:56:44 PM6/8/15
to codenameone...@googlegroups.com
On Mon, Jun 8, 2015 at 12:52 PM, <trash.buc...@gmail.com> wrote:
Hi together

I don't use the GUI Designer of cn1, because I want create dynamic GUI's. For this I have create some own Form-classes which extends from Form. But I don't know if this is an good idea!?
Nothing wrong with this.  I write lots of my UIs this way.
 
In my own Form-classes I added the GUI-Elements on load.

But now I have no idea how I can handle my GUI's with the UIBuilder class. Have you got any idea?

I don't think the GUI builder currently supports custom components this way. (Correct me if I'm wrong Shai/Chen). 

Steve

Shai Almog

unread,
Jun 9, 2015, 12:00:12 AM6/9/15
to codenameone...@googlegroups.com, steve....@codenameone.com
You can load them dynamically using UIBuilder.createContainer. You will need to register some of the components used and there is some effort involved.
Personally I think this is more work than its worth, I suggest picking one or the other.

trash.buc...@gmail.com

unread,
Jun 9, 2015, 1:33:41 AM6/9/15
to codenameone...@googlegroups.com, steve....@codenameone.com
I have some problems with reloading some components. Would in that case the UIBuilder help? Can I register the components and after that reload them?

Shai Almog

unread,
Jun 9, 2015, 1:14:33 PM6/9/15
to codenameone...@googlegroups.com, trash.buc...@gmail.com, trash.buc...@gmail.com, steve....@codenameone.com
I have no idea what you are talking about. What's "reloading"?
This isn't a web app.

trash.buc...@gmail.com

unread,
Jun 9, 2015, 1:29:44 PM6/9/15
to codenameone...@googlegroups.com, trash.buc...@gmail.com, steve....@codenameone.com
I have an command that looks similar to the code below. My problem is the todo. The image would not "reload" by clicking.

Command cmd = new Command("", imgOne){
   
public void actionPerformed(ActionEvent evt) {
       
this.setIcon(imgTwo);
       
// TODO: reload Parent Form
   
}
};

I have the same Issue when I change the Locale like this:
UIManager.getInstance().setBundle(theme.getL10N(translationTable, "de"));

Shai Almog

unread,
Jun 9, 2015, 11:54:38 PM6/9/15
to codenameone...@googlegroups.com, trash.buc...@gmail.com, steve....@codenameone.com, trash.buc...@gmail.com
Commands get associated with their UI element when they are added. This is problematic to fix since a command might be associated in a very elaborate way e.g. it can be added to a completely native menu that's hidden from your UI code (Android action bar).
You will need to recreate the menu to achieve that.

trash.buc...@gmail.com

unread,
Jun 11, 2015, 1:48:36 AM6/11/15
to codenameone...@googlegroups.com, trash.buc...@gmail.com
Hi Steve, hi Shai

Thank you for all the answers ! These answers helped me a lot.

Best regards from switzerland
Silvan
Reply all
Reply to author
Forward
0 new messages