Alternative function for group inorder to improve the performance in a xfrom - xpath

Can we use an alternate function other than group to perform the same action. The scenario I am trying to workout using group is - I have multiple pages in a form and a summary button on the first page which on being clicked should show the summary of all pages.
The logic we tried was using group to club each individual pages by having a form variable which turns true when the summary button is clicked and we check this variables value in all pages and so when the summary button is clicked this condition satisfies and all the pages are displayed.
The Code Snippet
<Xforms:group id="page-1"
ref=".[instance('form')/current-page = '1'
or
instance('form')/summary = 'true']">
Using group fn drastically depreciates the performance. Is there any method to perform the same scenario. Kindly advise.

At this point, hidden groups and hidden cases work differently:
The controls in hidden groups are non-relevant.
The controls in hidden cases are relevant.
As a result, using a switch/case, the server has to do more work to maintain and update the state of controls in hidden cases, but switching to a another case is very fast: it is pretty much just a matter of changing a class in the HTML, as the values of all the controls are already there. With hidden groups, when "switching to another group", the values for the controls in that group are sent by the server to the browser. Updating the values can take a little bit of time, especially if you have a lot of controls, say in a repeat.
It is hard to give a recommendation without really running your code, but if the time taken to do a switch is mostly spent on the browser, you could investigate using the full update mechanism. If the time is mostly spent on the server, then I'd look into XPath analysis. (Note that both features are PE-only.)

Related

Dynamic requests with JMeter

I want to use JMeter to do load testsing.
I will use the requests to simulate user behavior on my website.
Depending on what a user is filling out on the page, new fields may appear and these must be filled out.
For example if a user chooses a value in a dropdown box, depending on this value can appear below the text fields and / or the radio button group, etc. it is quite unpredictable so the possibilities are wide.
That's why I made a little program with Selenium to build a dataset based on what the application presents to me as fields.
So I can not present a CSV with a quantity of fixed columns since this one is dynamic according to the different choices of the users.
How would you have implemented this?

Access UI (controlsource property) vs VBA Performance

Is there a difference in performance (speed, memory used, etc.) when using the Access UI and setting a property to add a value to a textbox (or other control) as opposed to using VBA to do the same thing when object variables are correctly used?
For example, let's say that I want to select an item from a listbox and add values from the selected record to 2 textbox controls. I can do this by using the following VBA code in the AfterUpdate event procedure of the listbox:
Private Sub lstTest_AfterUpdate()
Dim lstA As Control
Set lstA = Me.lstTest
Me.txtTest1 = lstA.Column(0)
Me.txtTest2 = lstA.Column(1)
Set lstA = Nothing
End Sub
I can also set the ControlSource property using the MS Access UI via the Properties window in the txtTest1 and txtTest2 controls to the following to achieve the same result.
txtTest1 ControlSource: =[lstTest].[Column](0)
txtTest2 ControlSource: =[lstTest].[Column](1)
Is there any difference between these 2 approaches as far as performance is concerned? Any documentation on this would be greatly appreciated.
There is a “bit” of difference, but not really anything that going to make or break the application performance wise.
The first example could be considered better, since the values are “stuffed” into the other controls. The problem of course is next time you load the form, if txtTest1/2 are UNBOUND then next time the form loads, you would presumably have to run some code to re-load up the values again. (so this makes the first example worse)
Thus in your first case, the values will NOT persist and next time you load the form (or navigate to a different record), then such values will not update since your first example ONLY updates the values WHEN the after update event fires. That after update event ONLY fires WHEN you change the combo box, not on a general form load or navigate.
So the issue likely not performance, but simply that of your first example will NOT work nor display the data next time the form loads (unless of course the textboxes were bound to underlying columns).
Since the code is required to always run when the form loads, or record navigation occurs, you likely best use the control source approach since in BOTH cases you likely want these values to display correctly and thus in both cases you have to reference the .column() property anyway.

AngularJS performance with many custom directives

For this specific project, my team and I are thinking of leveraging the power of AngularJS directives and use them to build custom elements specific to our project, and use them like they were real HTML components.
For instance...
Say we have this table where each row is composed with a bunch of information that we get from a request, each row will be repeated with ng-repeat. Inside each row we will have multiple custom buttons with the same custom behavior. This button will also be used across different modules/pages on the website and not only on this specific table.
Our first thought was to use 2 directives, one for the table row and one for the button. The idea is that these are custom components/elements with custom attributes to define the custom behavior of the element. This would allow us to have a really nice modular application where each component is developed and unit-tested individually. Our HTML would also be easy to ready and understand.
Does this sound good?
Now, what about performance issues? Could we encounter big issues with this approach if, say we have a table with 100 of those rows and 5 of those buttons per row. Could this be big a problem if those rows/buttons had a couple of bindings to update information each X seconds?
The father of Angular Misko Hevery has this to say about performance and data-binding:
How does data binding work in AngularJS?
But in short like he says as long as you dont have more than 2000 data-bound items per page performance wont be an issue...

Using AngularJS, which is optimal with regards to ng-repeat

I have a potentially long repeating list with lots of data associated with each reapeated list element. There is also a hidden panel that contains more data and interactive tools that can be used on each repeated element (comments, tags, etc.).
My question is: Is it more efficient to include a duplicate of this panel within each ng-repeat, already filled with the appropriate data, or have one panel outside of the ng-repeat scope, who's data get's fill after clicking the 'panel toggle' button?
Extra details: This is a responsive site, with an emphasis on mobile use, so we are trying to minimize data sent, and make the amount of Javascript short and sweet (so far it hasn't been a problem at all).
After typing it out, I think the best option would be to have one tools panel, and populate it depending on which 'panel toggle' button is clicked. Fewer DOM elements the better, right?
It also leave it open for lazy-loading of the extra details in the future.

COLDFUSION CFGRID Datapass with a post

I have a bit of a unique challenge today. I have a client that wants to be able to search for multiple items based on inserts into a cfgrid. Suppose we have the following web form:
A Country selection dropdown
A State Selection dependent AJAX dropdown
A city Selection dependent AJAX dropdown
An ADD Button
----------------------------------------------------
A CFGRID that will populate a row with selections when the user clicks the add button
----------------------------------------------------
And finally, a CLEAR button, and a GO button on the bottom.
The resulting page will then query the database and get some statistics about the cities selected. So, suppose an individual picks USA > Arizona > Scottsdale and USA > Arizona > Flagstaff. The grid below the options will 'save' each selection and reset to their default options, waiting for a user to pick additional options or click on 'GO'.
The resulting page will then generate columns that list some statistics about the communities and highlight the 'best of' between each selected community.
Each time a user selects the ADD button (assuming three criteria are selected) I want the information to be added into a CFGRID that displays the options selected. Then, After the user selects at least one country/city/state option, have all of the data in the CFGRID get passed to another page that does a query from the data selected. In theory, the user could pick as many communities as they want, assuming they are willing to let the database sludge through enough data to get what they want and wait through a 'loading' screen to get it.
I'm having these challenges, in no particular order:
- I have an HTML grid that I must use per client spec (No Java or Flash, must be HTML)
- I have no idea how to get the selected options into the CFGRID. I assume there is some JavaScript I can write that uses some sort of AddRow function to add data into the grid with the add button but cannot seem to find how to it on the interwebs
- After we conquer the above challenge, how do I pass the data from the grid into the results page? I thought about passing one big string or a structure, but I'm not sure how to do that through the URL or posting, nor how to get the data out of the grid. I wonder if I am better off coding some sort of string that gets passed from the options page to the results page with a get method instead of dealing with the stuff in the CFGRID and have the CFGRID serve only as a 'dummy' display container.
- Finally, after the pass is complete, I would need to loop through through the structure and perform a CFQUERY or CFSTOREDPROC on each row of data, then get the statistics I need to display on the results page. I assume this would depend on how I am getting the data from the options selection page to the results page.
THANK YOU ALL!
CFGRID is great to start, but it can be b*tch to customize and extend... Have you tried editable CFGRID with bind? See how far off it is from what you want first. If it turns out to be very far, then you might want to go for a jqGrid and code up some jQuery.
To start, read Using HTML grids and make the cfgrid editable.
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7a01.html#WSc3ff6d0ea77859461172e0811cbec22c24-72e0
Once you got that working, look at these provided JS functions that you can use with CFGRID
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WS0ef8c004658c1089-6262c847120f1a3b244-8000.html
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSd160b5fdf5100e8f-4439fdac128193edfd6-7f5f.html
If you still demand a bit more, you might need to dig into the underlying ExtJS component. At that point I would rather use jqGrid
I found out that the best way to handle this was by using a SerializeJSON call and a Deserialize JSON call back and forth. By using JavaScript notation we are able to pass a complex JavaScript object (array) between one page and another. This has the value add of not having to worry about sessions timing out and making URLs clickable from one solution to the next.

Resources