How to dismiss current form in codenameone? - codenameone

Hi i'm new to codenameone and now i stuck with two issues those are
How to dismiss current form in codenameone?
It means that in my sample i've three screens and when i click on button in Form1 it navigates to the Form2 like that Form2 to Form3 also. now when i click back button on Form3/Form2 i want to dismiss current form. so for this i've tried "showBack() method" but its not working.
So could anyone help me for this? and
How to show Calendar in Current form?
I want to show Calendar in current form but i've tried multiple samples but in all samples when i click on button they taking to another screen(i.e. Another Form). so how to resolve this also?
These are my questions if anyone has idea please help me..
Sorry for my poor English..
Thanks in advance..

Form.showBack() is almost the same as Form.show(). It uses the back transition instead of forward one.
For your case, you have to call showBack() on the form that should be displayed.
Example:
Form1 is currently visible
Form2.showBack() is executed
Form 2 will be shown with a back transition

For question 2: form.add(new Calendar(new Date().getTime()));

Related

How to set active tab in Tab from Material UI by code

First time asking on SO, I know that this question was asked lot of times. I already visit all those posts but without sucess unfortunately.
As the title says, I need to change the active tab by code. I am using the material ui scrollable tabs with react.
I thought that the project I am working on maybe it has something bad, so I made this codesandbox to try without success aswell.
Could you please give me a hint on how to do this on the given example?
Thanks in advance for all the help, this community is awesome!
Best regards
If I understand correctly, you are looking for a way to manually set a tab, without hitting the actual tab button.
If yes, all you need to do is to change the state that holds the tab's value using setValue and provide the number of the tab you want to go (starting from 0).
e.g. setValue(2) will take you to the third tab.
You can take a look on this. I have created a static button that change the state to a specific number, just to demonstrate the idea.

accessing invisible popup in selenium webdriver?

in a interview they have asked below questions please tell me code or approach ...
1-how to access invisible popup.in selenium alert pop can be accessible using alert.accept() but if alert popup is invisible then how can we use.
2-code for automatic image display slider,some image slider has next and previous button we have to click next or previous so please let me know how to develop it in both way by clicking next button on image or automatic image display slider
i am using selenium web driver,java,Firefox
thanks a lot
For the 1st question, AssertEquals will help us to go through invisible pop-ups and for the second one, I am not sure that they have asked the slider next or previous button will be on image....if it is outside image, then we can verify that if its present than click on particular id else not.

Tab issue in angularjs popup

I am using AngularJS popups dialog to display popups. But if there is any combination of inputs and buttons then after input fields, tab goes back to url instead of button.
It would be helpful for me if I can have tab that comes first in my input fields and then to my buttons and again goes back to input fields.
I am thanking in advance if anyone takes the initiative to answer my question.

Form elements are not receiving input

I have a form designed with the GUI designer with input textfields and buttons. I have attached actions to the buttons. When I call up the form with showForm(Form,null), the textfields are not accepting input and the buttons are not triggering the action. This is happening only for this form. Initially, there was the problem solved here Unable to call a specific form from a button in codenameone and then the problem solved here Simulator keeps defaulting to old Main form. What could be the issue now?
As far as I know there may be some issues as you say, but first need to see code
In the form after you added the text fields did you select the text field component and press action event?
Assuming you did that you should get a callback method in the Statemachine class.
This call will be invoked only when the user changes the content of the text field. You can run in the debugger and set breakpoints/step into code to see what is going on.

C#: components cannot show on Windows Form

I have created an empty project. after that, I added new items is Windows Form and add some component such as button or textbox in Design View.
In main file, I use this code:
SimpleForm form = new SimpleForm(); // SimpleForm is my class
form.Show();
But, when I run, C# generate a form but I cannot see textbox nor button. I just see blank area where I put those components. As picture below, the white area is my button, but I don't know why this button cannot show. I think maybe some problem, and those components cannot draw on the form.
Please help me this error.
Thanks :)
If by "the main file" you mean your main method (the entry point) - try this code instead:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new SimpleForm());
If not you really need to post more of your code to get a reasonable answer.

Resources