No transition on first form - codenameone

I am using a CN1 project created by the CN1 plugin in IntelliJ. I have built a form by hand (not using the GUI builder). I would like the first form shown to be my form. Unfortunately, it seems to bootstrap code that loads the theme expects me to use a form created in the GUI builder. In fact, when my application loads, it briefly shows the default Hello World screen, and then transitions to my form by scrolling the form from right to left. How do I make my hand-coded form the first thing on the screen appear without any transition?
It would seem that I could just override StateMachine.getFirstFormName(), but my form is not known to the underlying code.

There are many ways to do this... Try creating a new project with Get Started template selected.
Open MyApplication.java or any other name you changed MyApplication to. Replace the hi form code and use this as your code foundation.

Related

Make annotation on graph created by echart

I'm using reactJs to develop the frontend, is it possible to make annotations on graphs created by echart? For example, I can left-click anywhere on a line chart to make a quick note of that point or I can a range on a graph and make a note of that range.
If I understand you correctly, you want to build an interface that allows users to left-click somewhere on the chart and add their own annotations (rather simply coding in annotations as a developer, and having them be static)?
In broad strokes, here's how I would build this:
Register click event handlers on the chart, so you can detect where the user clicked.
Build custom UI in react that can overlay on the chart, provide text input and "add"/"cancel" buttons, using the information from the click event to figure out where to draw it and to what element the annotation should be attached to.
When the user clicks "add", make a call to the showTip API (see docs) to a tooltip in the right location (from step 1) with the text the user provided.
(It looks like there is a github issue where folks are asking for this feature to be built-in - and some discussion of how to build it yourself, and a simple example that illustrates how to do step 3 above which you might find useful)

Issue when navigating from one form to another when second form has Picker control

In my App, While navigating from one form to another, I found an issue with both android and IOS debug build. This will happen only when second form contains any type of Picker control. I have added logic to navigating to second form on click of a button on the first form. So now when I click the button, Picker control of the second form open up on first form instead of navigating to second form. Second form will appear only after I made the selection on Picker Control. This issue is happening on bother android and IOS builds. Please advise if any one encounter similar issue with recent debug builds.
This happens only when Picker is first control on the form.
Code used for Picker:
Picker firstAppForm = new Picker();
String[] options = {"Tabbed Menu", "My Schedule "};
firstAppForm.setStrings(options);
firstAppForm.setUIID("TextField");
firstAppForm.setAutoSizeMode(true);
I tried to reproduce it and wasn't able to but I did run into a null pointer exception related to the native picker which might be the underlying cause of this.
I've pushed out a fix that should be available now so if you send a new build this will hopefully be resolved.
as a reference, I've published three videos to help illustrate the current problems I'm facing and probably #Chris L as well, maybe this aid in finding out the root of the problem. The links can be found as a comment to the initial publication.

Best practice to handle extjs refresh page

I wrote an ExtJS application like this:
the sub menu is dynamic added by clicking the button on the left.
The question is :
as the sub panel is created dynamically, so if I refresh the whole page, the panel will go away.
What I expected is it could still display the same content before refresh pages.
So, my question is how to handle this in ExtJS?
Do I need to record the current panel information into Ext.App?
ExtJS is a framework to build Web Applications that run inside the browser.
With Web Applications, just like normal applications, you don't close the program and start it anew (like a browser refresh does) just because someone wants to switch to a different toolbar or look at different data. You work with multiple panels, switch between them, and/or open windows.
You could for instance generate multiple panels inside a container with card layout, and bring to front the panel that you want to show right now.
If you have a license that allows you to use Sencha Architect, there is a nice "navigation" sample available in Architect from where you can start and look at how it's done.

codenameone autocomplete text field display issue in gui

I m working on my mobile apps using codename1 and i found that after adding an autocomplete textfield to any form, every other component disapears along with tabs behind a white container.
It sounds like you are using a scrollable FlowLayout (which is the default layout manager) and some nesting behavior goes bad.
Another guess is that you add everything into the layered pane which is a HUGE MISTAKE, you should add everything to the form directly or content pane.

Making a basic navigation for iOS with two buttons on both sides of the title

I am working on codenameone, and trying to make the first UI.
A basic UI with a title and two buttons on two sides of the "title" to go to two different pages.
I was trying to do that with "Form" component but then it only gives one button by default, which is just taking me to the previous screen.
Not sure how to do this, any link or tip is a nice help.
thanks
Use addCommand(new Command("X")) or in the GUI builder just click the commands property in the form. It will automatically use the menu for Android.
The back button is added automatically for iOS apps for back navigation which you will probably need. You can disable it in the state machine code and have room for two commands in the title.

Resources