Few questions about angular-formly - javascript

I am looking for a library for form building based on provided model, so we are looking at formly:)
I took a glance into the examples and video on formly web site, but there are still some questions without
an answer.
-There are a lot of examples of viewing/editing single entity via formly. I am interested in some example of viewing/editing collection of entities via formly (being displayed e.g. as a table). Each field of table should have it's own type.
-Editing single entity is cool. But what if editing one entity requires creation of the other entity. E.g. what if you create "User" entity, and you need to create/choose existing "Bank Account" entity to link with User? What is the best way to do such a thing?
-Are there any examples of client + server applications using formly? (e.g, we get forms from server side?). Maybe, some attributes (annotations) to classes, fields for automatic formly objects generation?

You can do all the things your talking about with formly. If you need help with something specific, follow the instructions at http://help.angular-formly.com

Related

I'm Confused About Naming Between Sap Odata and Sapui5

https://blogs.sap.com/2015/02/05/simple-exercise-on-odata-and-sap-ui5-application-for-the-basic-crud-operation/
Im trying to make my own sapui5 project based on project above. But I'm so much confused about field naming in data base. There is too much names similar to each other(they represent each other but I just dont understand which one im using in abap an wich one I'm using in js).
Can someone please highlight it? At least i should understand relation between them.
For the project new DB table ZMM_EMP created. Data model use source parameters imported from the table. Fields for mapping are provided by function modules with names IV_* and ET_*.
Regards
Sergii

Is it possible to create a subpage without any file?

I'm a newbie when it comes to PHP. I wrote some JS to make AJAX requests for my project and it worked well, but I don't have any idea how to convert that into PHP.
I've prepared layouts like the following:
mainLayout.php,
userLayout.php,
offerLayout.php,
In those files are some PHP and MySQL parts that build an HTML page.
In Ajax it was easy to navigate between many users using only one page and replacing some divs with data...
But a huge minus was that you couldn't have a single address reference a user profile or the offer (like mywebsite.com/user1).
Now, when I use PHP I want to achieve same layout effect.
How can I avoid creating a thousands of pages (of course even dynamically it seems to be a waste of memory IMO) like user1.php, user2.php, offer1.php, etc.
I don't know how to achieve the effect of being on a site like example.com/user277373.php without creating thousands of files but only one template.
Two solutions I see is either you use GET to parse your data:
http://example.com/?data=1736861
and than access it over the $_GET variable:
$id = $_GET["data"];
($id will be 1736861)
or you use the flight php extension, that will look something like this:
Flight::route('/id/#id', function($id){
echo "ID: $id";
});
and the URL would look like http://example.com/id/1736861. You can also use multiple variables with the flight module.
I hope this helped, Sebastian
Are you familiar with any MVC frameworks? If not, I would highly recommend getting accustomed to the MVC design paradigm. MVC = Model View Controller. From Wikipedia, a short excerpt:
A model stores data that is retrieved according to commands from the controller and displayed in the view.
A view generates new output to the user based on changes in the model.
A controller can send commands to the model to update the model's state (e.g., editing a document). It can also send commands to its
associated view to change the view's presentation of the model (e.g.,
scrolling through a document).
Two of the key components of MANY frameworks (in pretty much any language), are Routes and Templates. When utilizing a routing system, you're able to specify a template for every page loaded that matches a specific route. For instance, site.com/people/:id where ':id' can be any value in the URL, and be configured to use "person.html" for the HTML output. Note that "person.html" receives variables/data that will dynamically populate content, e.g. <h2>Hello, {{name}}</h2>
So, to clarify, site.com/people/252, site.com/people/12, site.com/people/5, site.com/people/john would all match the site.com/people/:id route path where :id is dynamic, and your system will use ONE TEMPLATE (which you specify) to display all the data. Don't forget, when that route path is met, that's only step 1. You will probably need to take that :id run some database query and pass that data into the template.
A popular micro PHP framework called Slim, might be a good starting point. Here's documentation for its way of handling Routes and Templates:
https://www.slimframework.com/docs/objects/router.html
https://www.slimframework.com/docs/features/templates.html
Slim is commonly used with Twig, a super popular PHP template engine. Here's its website/documentation: http://twig.sensiolabs.org/
And if that wasn't enough, Slim has a super handy First App Walkthrough that will show you routes, database connection, and templates: https://www.slimframework.com/docs/tutorial/first-app.html
Hope this information helps you on your journey – Best of luck!

How to define Matrix/Link/Cross Table joins in BreezeJS Metadata?

I'm trying to get breeze working with hand generated Metadata, but I can't seem to find documentation covering navigation properties through matrix tables.
the data model is:
Organization
PK:OrganizationID
User
PK:UserID
The table that joins them is:
User_Organization
PK:UserOrganizationID
FK:OrganizationID
FK:UserID
When I retrieve an Organization I want it to have a property "users" which contains an array of User objects.
How do I define this and specify the matrix table in Breeze Metadata, seeing as User does not have an organizationID?
** update
My primary problem is that I'm linking Breeze to Sequelize, so I need to be able to manage this all through the metadata if possible. The first answer below from #Jeremy-Danyow solves the problem with client side code, but I'm looking for a way to present the final object graph to breeze as part of the metadata.
I think this question might be a duplicate of Many-to-many relations in Breeze. There is useful information in the answer there as well as the comments on the answer.
That said, I want to propose a work-around for this part of your question:
When I retrieve an Organization I want it to have a property "users" which contains an array of User objects.
If you were to configure your metadata the supported way you could add a read-only "users" property to your organization entity like this:
function Organization() { }
Organization.prototype.users = function () {
return this.userOrganizations().map(function(userOrganization) { return userOrganization.user() });
};
store.registerEntityTypeCtor('Organization', Organization);
This uses the "Add methods to the constructor" approach documented here.
Edit
Sounds like breeze-sequelize support is in the works and will be released soon. See here and here. If you can afford to wait a little bit you'll have less friction getting this going.

Find and Pull data from API (elgg)

Okay so I'm trying to make a custom elgg website.
One of the main features I need is for users to be able to create events, and for those events to be displayed in a sortable table.
For events, I use a plugin for elgg called Event Manager. I originally thought that the data for the events was stored in mysql, but apparently it's stored in the elgg API instead.
'
Can anyone give me any tips on where to find the event data, and how to pull it from the api and put it into a javascript/html table?
Gracias,
Pablo Escobar
Regarding details of writing plugins, refer to documentation: http://docs.elgg.org/wiki/Main_Page and make sure to read through: http://docs.elgg.org/wiki/Engine/DataModel
To get event_calendar events, you'll need to use one of the functions from elgg_get_entities family. You'll most likely need to filter by type (object) and subtype (event_calendar), apply some filtering (metadata_name_value_pairs parameter to elgg_get_entities_from_metadata) and sorting (order_by_metadata)
For additional support you'll be more successful at community.elgg.org page.

Updating field in CRM 2011 through javascript from ribbon button on homegrid view

I am trying to create a button on the initial list or homegrid view of leads that will set the value of a specific field to the same value every time for the lead that is selected. Anyone know how i can do this through javascript?
Thanks!
To build on James's answer, you can use the CrmParameter SelectedControlSelectedItemIds to get a list of all the leads selected in a homepage grid. There is an answer on the MSDN forums that explains how to do this, copied below. You can do this in the Xml source or in the two CRM ribbon editors I know of.
After that, you would then need to use the Update method of one of the CRM webservices to loop through the Guid array and update each entity/database row accordingly. I've mentioned Avanade's excellent web resource before, and MSDN has some additional documention on this as well.
Walkthrough: Use the SOAP Endpoint for Web Resources with JScript
Sample: Create, Retrieve, Update and Delete Using the REST Endpoint with JavaScript
<CommandDefinition Id="Account.Form.CustomGroup.Button.A.Command">
<Actions>
<JavaScriptFunction Library="$webresource:AccountFormLibrar"
FunctionName="CreateNewAccount">
<CrmParameter Value="SelectedControlSelectedItemIds"/>
</JavaScriptFunction>
</Actions>
</CommandDefinition>
function CreateNewAccount (prmRecordGUID) {
//prmRecordGUID will recieve all GUIDS in comma seperated i.e. GUID1,GUID2,GUID3
}
Yeah this should be pretty straightforward - I dont think what you have said in your comment will work - that function you are trying to use only works if the form of the record is open, e.g. it wont work from a grid view.
You will have to use a webservice call as described in the MSDN here: http://msdn.microsoft.com/en-us/library/hh771584#BKMK_DataAccessUsingJavaScript
Also if you are customising the ribbon (adding buttons) you would find it a lot easier with this tool: http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx

Categories

Resources