how to charge components dynamically? - dataflow

I use the plugin total.js flow.
I would like to know if there is a function like FLOW.Reload() to dynamically reload the components?

Yes, Flow supports FLOW.reload() method.
FLOW.reload([type], [callback]);
// +v6.0.0 Can reload a Flow
// #type {Number} 0 reloads only designer + variables (default), 1 reloads components + designer + variables
// #callback {Function} A callback

Related

Ag-Grid wrong row orders in clipboard due to custom row node id

Ag-grid's default rowNodeId is an auto-increment number (0,1,2,3,4...)
For my application, I use a custom rowNodeId which is composed of values inside the grid, like: col_x_value + '#' + col_y_value + '#' + col_z_value:
this.gridOptions.getRowNodeId = (data) => {
return myPkColumns
.sort()
.map(pk) => data[pk])
.join('#')
Issue: When I copy rows to excel, the order in which the rows are pasted in Excel is not like the order I see on the grid.
The order does not seem to follow custom row node id neither..
One solution I have in mind is to use the default rowNodeId + a non-visible column to store the custom id. But this means I need to loop through the grid every time I need to find a specific row.
Any better solutions? Thanks
A possible solution I could think of is implementing callback sendToClipboard(params) so you can control the ordering before sending data to clipboard.
From the docs -
If you want to do the copy to clipboard yourself (ie not use the grids
clipboard interaction) then implement the callback
sendToClipboard(params). Use this if you are in a non-standard web
container that has a bespoke API for interacting with the clipboard.
The callback gets the data to go into the clipboard, it's your job to
call the bespoke API.
Example here

Disable a form if the other is updatable

I'm using page fragments to create a view and in the same page I have two forms to view / update specific information.
What I want know if it's possible to disable one form (or button, since it's the way I use to change from readable to updatable) based on if the other is in updatable mode.
Simplifying I have form A and B, both in the same page as readable. When I select A to update I want B to disable the option to edit until A is back to read mode, and the same to B form.
Can anyone help me?
---Update
Flows
A
B
In each fragment (view) I have a button that as an action to the fragment (edit)
What I need is to disable the button from B.view when A button is pressed and vice versa
If the forms are part of separate taskflows and these taskflows are used on the page as regions, then you will need to enable inter-region communication, so that an action in one region can affect the data and behavior of other region:
http://www.oracle.com/technetwork/developer-tools/adf/adfregioninteraction-155145.html
For your use case, contextual events can serve the purpose:
http://rohanwalia.blogspot.com/2013/07/contextual-events-basic-step-by-step.html
http://www.awasthiashish.com/2013/05/using-contextual-event-in-oracle-adf.html
https://blogs.oracle.com/raghuyadav/entry/refresh_bounded_taskflows_acro
To implement your case, follow the tutorials provided above with following changes:
Pass a boolean value in the customPayLoad of event
<event name="DisableButtonEvent" customPayLoad="${'true'}"/>
In the event handler method assign the payLoad value to a scope variable:
public void handleDisableButtonEvent(String payLoad) {
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
Map pageFlowScope = adfFacesContext.getPageFlowScope();
pageFlowScope.put("disableButton", payLoad);
}
Use the scope variable for disabled property of button on second region
<af:commandButton text="EditButoonB" id="cb1"
disabled="#{pageFlowScope.disableButton ne null? pageFlowScope.disableButton : false}"/>

Symfony 1.4 - are forms always in <table>?

I'm using sfDoctrineAllowPlugin. I need form which has Twitter's Bootstrap semantics. I looked into template and I found, that there is only $form, which is a <table>. How can I format it in my way? I don't want to use table, rows and cols.
There are plenty of render* functions available to display each item in your form.
renderRow
renderLabel
render
renderError
etc ...
But you can also define a decorator (a custom sfWidgetFormSchemaFormatter) for your form to define the way each item will be display. Check this example of adding * for each required field.

ExtJS 4 - How to load grid store with its params carrying latest values from a form?

I have a window with a search form at the top and grid at the bottom.
User can enter values in the search form and click button - Get Records.
At the click of this button, I load the store of the grid by passing the values in form fields as parameters in following way:
store.load({
params:{
key1:Ext.getCmp('field1').getValue();
}
});
I tried giving parameters in the store proxy itself, but it unfortunately always takes up initial values (values when the form is rendered) and not the latest one entered by the users in the form fields. Following is the method I used for assigning values to params while creating the store:
extraParams:{
key1:Ext.getCmp('field1').getValue();
}
I wanted to seek guidance at two things:
a. While defining a store, can I ensure that store takes latest/current values from the form fields before querying server, so that I don't have to provide these values while calling load function?
This becomes more necessary as I have a paging toolbar at the bottom which carries a refresh button (along with next, last, previous, first icons for navigation).
Now, whenever user clicks at refresh (or any navigation icon), the store gets loaded without the query parameters.
Thus the second thing is:
b. If the answer of 'a' is that - Pass the latest values to parameters manually when calling load function - then how can I write the handler for 'refresh' button and navigation icons (that is, next, last, previous and first) in the paging toolbar, so that I can pass the latest form values to load function.
Thanks for any help in advance.
PS: I am using ExtJS 4.
yourStore.on('beforeload',function(store, operation,eOpts){
operation.params={
status:cmbStatus.getValue(),
value:txtBuscarPor.getValue(),
empresa:'saasd',
app:'dsads'
};
},this);
Related to your question (b) (and because you especially asked for this in the comments section):
I see only one standard way to hook into the PagingToolbar button handlers which is very limited.
Ext.toolbar.Paging fires a 'beforechange' event before it actually changes the current page. See API docs. A listener that returns false will stop the page change.
All other methods require extending Ext classes which wouldn't be a problem if the ComboBox would make it easier to use your own implementation of BoundList (which is the class that renders the dropdown) or pass through config parameters to BoundList resp. the paging toolbar.
I tried to bring this lack of flexibility up on the Ext message board once but was pretty much ignored.
A possible solution for this is to use 'beforeload' event of the store and provide the list of parameters in it. This way, whenever the store is loaded, then its beforeload event is fired and the values picked up are always the latest. Hope this helps someone looking for something similar.

C Builder TForm not allocated or created properly all its controls

I'd like to know how I can check that all the controls on the form are created and initialized.
I have a form I am showing when a user presses the update button. It has only a TProgressBar control.
The handle is not NULL for this control and at random stages it can or can't set the Position/Max values.
When I set TProgressBar->Max value to some integer it remains 0 after.
So the question is:
How to really create the form and all controls on it (i am currently using just Form->Show() method, which as I can check calls the constructor)
Also I have following form creation code in main cpp file:
Application->CreateForm(__classid(TupdateProgramForm), &updateProgramForm);
How to check that all controls on the form are created and PAINTED (showed and visible)
In C++ Builder the form and the controls created at design-time are translated into binary objects through automatic scripts that produce Delphi code.
To view the originated Delphi code just right-click anywhere on form at design-time and select 'View as text'. This will show the Delphi source code of the form and it's controls.
After a form and all child controls created, the OnCreate event of that form invoked and you can place your initialization and checking code in this event, for example:
void __fastcall TfrmMain::updateProgramFormCreate(TObject *Sender)
{
ProgressBar->Max = 100;
ProgressBar->Value = 20;
}