codename one transfer data between forms without stateMachine - codenameone

Hi I am new to codename one and i want to transfer some data between the button clicked on one form and then doing something on the show of the second form.
Any example will be really helpful as i am not able to find anything on the web which is not using the GUI builder.

Usually I just use member variables on the StateMachine class. E.g. when the button is clicked, store whatever data you need in member variables on the statemachine class. Then when the second form shows, you can access this data in the on show form callback.

Related

Is there a function for overriding the New Note buttons at the bottom of the action?

I want to remove the buttons for Share and Add to Records on the New Note action but I cannot find documentation that support this. I need this for a single object on the database. Is this possible? New Note page
I have tried to create a custom related list using Visualforce and creating a Notes custom object but neither one fits the usecase perfectly.

CRUD: using mat-Dialog as UI

I'm having a list of a playlist using mat-card and I'm getting my data from an array list inside my PlaylistComponent
What I'm trying to do is to add another playlist that's why I added a new playlist button that will display a dialog
I've added a playlist service that contained my form group.
My problem is that I'm new and I got lost with the architecture of the program.
do I have to use two-way binding or do I have to find a way to implement it in my dialog component
if someone is familiar with this technique please give me an insight.
Your question is asking a lot and you don't give the underlying code so I am going to give an outline and point you to the documentation to follow for your specific implementation.
Basically you take the data from the form and pass it in mat-dialog-close. When you open the dialog from your playlist component you also subscribe to the afterClosed of the dialog. In this subscribe, you will get the data back from the mat-dialog-close. You then can push that data into your existing array.
The first example of mat-dialog in the documentation handles a form and returning the data Dialog | Angular Material

DotNetNuke Nested Controls Redirection Method

Any DNN developers out there who have figured this out?
I have a user control (ascx) (DotNetNuke extension) with 4 user controls. There are buttons on the first view form to access the others.
When you access another control, you can access other controls from that control. I'm looking for the best way to redirect the user back to the previous control the user was on regardless of the 'level' of the control.
Here's an example.
1) First view form: People list
Buttons available:
2) User Addresses
3) User Downloads
4) User Videos
5) Another user related module
Let's say I choose 2) User Addresses
On that user control I have buttons to 3, 4 and 5
If I want to return to the first view control (1), I simply use DotNetNuke.Nvigation.NavigateURL and pass in the parameter of the user I was querying about. That works fine.
But now instead of going back to 1 I choose to go to 3) User Downloads
When the user hits the 'Return' button to go to the previous screen (not the browser back button; this is a button on my form) I want to go back to 2) User Addresses, not back to the first view control (1).
I've tried adding the first view control as another control in the same extension, and using EditURL to call it, but the screen shows up blank on redirect (except for the DNN menu etc).
How do I redirect a user to the previous control, not the first control of the module?
If this doesn't make sense, let me know and I'll try to explain it better.
Thanks.
You likely will want to pass a querystring parameter in the request to the various controls so that you can keep track of where they were, and how to get back.
Example:
Instead of just calling ctl=controlvalue try calling ctl=controlvalue&prevvalue=edit
THen you can wire up your Return code to use the querystring value of "prevvalue"
Chris
Check out my DNNHero.com video tutorials on Module Views, Settings & Navigation. I give code and instruction on different ways of doing module view navigation.
I decided to write a custom solution for this. It works really well, but it's a bit involved.
1) I wrote a SourceType enum to list the different forms in my application.
2) Any page can serve as the 'base page." On form load I read a property in settings for "base page url" and if it's not there yet, I write the base page's rawurl to the setting along with the enum value of which form (SourceType) it is.
3) Since sub-controls all use the same settings as the base page, whenever navigation occurs, I pass in the base page's enum value to the new form; in the new form I read the base page URL in the Page_Load of the new form and, if the current form's enum value is different from the enum value passed in (which it is), I use that base URL for the link 'back'.
4) If the user goes to another form from the second form, the process is repeated. But I pass both 'prevous' form enums to the third form so it shows two links to choose from to return to.
5) This can be repated as long as possible. One caveat: you have to remove the current form from the SourceType enum before you pass the SourceForms property back to a previous form; if you don't do this, the form you are coming from will also be listed as a 'go back to' form which you don't want.
Hope this helps someone having trouble figuring out a clean DNN redirection solution within multiple controls in a module.
If this isn't clear hit me up and I'll show some of my code.

AngularJS Wizard with dynamic steps

I have to implement a wizard, where each step is a single input field.
Everything is wrapped inside an accordion with section headers.
The user, after filling the input and pressing Enter, should navigate the wizard field by field. Only the current field is editable, while the other ones are readonly (the user can anytime change a previously filled input, by clicking it, moving the current pointer to it).
I was wondering what could be the best approach to design this system, considering that the whole wizard structure changes in dependence of different user inputs.
I have found a tutorial using ui-router (http://scotch.io/tutorials/javascript/angularjs-multi-step-form-using-ui-router), with a fixed number of steps, but my requirements are to show the current input edit box inside the accordion, not in a fixed "ui-views" placeholder.
Take a look at https://github.com/JustMaier/angular-autoFields-bootstrap
It's a module that allows you to render forms from Metadata. So essentially, you can change the Metadata you provide dynamically to change the forms.

Overriding "New" button with VF page(Flow) for objects with Record Types

I have a custom object with 2 record types, and there are 2 page layouts correspondingly. Now I have created a Flow to gather all the required fields(based on one of the record types) and create the object.
How can i override the "New" button for this object so that when the record type for which the flow was created is selected , the VF page with the flow shows up and when the other record type is selected the corresponding page layout shows up ?
Or do i have to modify the existing flow and pass it the record type, and based on that change the screens ?
Thanks in advance.
Your question isn't entirely clear, but it sounds like you may be able to create a new button that attaches to APEX code that will do the branching that you want either to launch the flow, or to redirect to the page layout that you are seeking.

Resources