Flex - MATE Framework - apache-flex

I am new to MATE framework and I have been digging around some sample codes so that i can do the following:
On clicking a button (on a canvas)
Display a Panel.
The issue is that i am not trying to pass any value hence not sure of how/ what should be defined as sourcekey and targetkey. If this is the case, then how should one define the propertyinjector details.
most examples that are floating around contains details of reading data from a source and populating the same on a UI/ Display component.
Thanks
Srinivasan S

for this one you shouldn't use propertyInjection you should dispatch an event (you can make it custom), then you need to catch the event in the appropriate place and simply do whatever you want with it.

Related

Reactivate drag control fails in openlayers

all. I have this little Problem and i'am looking for some help:
first I have a function which contains the following:
var point = new OpenLayers.Geometry.Point(imageConfig.XPos, imageConfig.YPos);
var imageFeature = new OpenLayers.Feature.Vector(point);
layers.imageLayer.addFeatures([imageFeature]);
So a point is be drawn on the layer. On this layer there is also an openlayers drag control. It is activated after the point was drawn. Now I can drag the point around. Works like a charm.
This is a little part of a user driven step by step procedure. So after dragging is done the next steps doing something with the point. While these other steps the drag control is deactivated. In the procedure it is possible to jump between steps so the de/activate of the drag control is needed. This works fine.
At the end of all steps the point is removed from the layer. Also this works great.
BUT: if I call again the function which draws the point on the layer (of cause now it is a new one) and activate the drag control I cant drag the new point any more even if I try to select the point with mouse click?!
I controlled with firbug:
feature is there
feature is on the right layer
control is there
control is on the right layer
control is activated
Maybe I' am missing a simple thing here. But I breaking my hed on this for two days now and can't find an answer.
By the way I found that in the first step sequence (when all works great) the controls feature property is set with the point feature. But in the second not. The same in the controls drag handler feature property.
I tried to set it manually by:
control.feature = imageFeature
and:
control.handler.drag.feature = imageFeature
I was looking for a function to set the new feature to the control. But can't find any on the openlayers docs.
Other controls at not active at the same time (controlled it with firebug).
But no luck. Didn't help. Why this? I'am sure that this should work. What am I doing wrong or miss under standing here???
Every help appreciated.
Thanks
Figured it out by my self. Problem was that I used a geoext feature store to display points in a grid. This grid was configured wit a geoext feature selection model. I just copied this...
The selection model also asign a feature select control on the map. In the first round this do no conflicts to the drag control because it is loaded after.
When the the tool enters the first step again all controls are loaded to the map. the select control and the drag control is enabled. this can't be handled by open layers. It seems the last to map added control is the one which comes with priority. So you can enable the drag control after again and again. The select control wins.
The trick is to decativate the select control. Then all works perfect.

Flex: accessing child through navigating the hiererachy

I have a generic function to build rows of controls (each row comprising of sliders, radio buttons, reset buttons, text display) etc, and some functionality to change underlying data based on these
As I didn't want to write specific code for each row, I had code written by which I can detect the row on which there has been a mouseevent, and though the row access each individual control
The hierarchy used is titleWindow (part of popup)->skinnable container->HGroup->control
When I trace for a radiobutton, I get the path as follows Electric_Modify.TitleWindowSkin2620._TitleWindowSkin_Group1.contents.contentGroup.0.RadioButton2645
The '0' before the radioButton stands for the first Hgroup id->named as 0
I tried accessing the radio button as follows- 5th element in the HGroup
((this.contentGroup.getChildAt(row)as Group).getChildAt(4) as RadioButton).enabled=false;
and get a message "Cannot access a property or method of a null object reference" on this line. How should I navigate the hierarchy to reach the element?
You should be using getElementAt(...) and not getChildAt(...).
The get element functions represent a "higher level" element hierarchy which is needed to make skinning easier.
((this.getElementAt(row) as IVisualElementContainer).getElementAt(4) as RadioButton).enabled = false;
It should look something like that, but the exact hierarchy depends on what's in your app.
#drkstr
Thanks for your input... I thought of an alternate approach that worked for me...I mapped out the parent of the HGroup via
parent1=hgrp.parent; and then referenced these buttons as follows
((parent1.getChildAt(row)as Group).getChildAt(4) as RadioButton)
This works like a dream...I presume your suggestion would let me jump across the intermediate layers
#J_A_X/ #Constantiner: Thanks for the suggestion. I have no idea why we didn't think through and go down the DataGroup path. Prima facie seems simpler... we got to creating the UI controls in MXML laying out controls serially,and when it came to making it generic, we literally replicated the MXML approach in AS. Started off easy, till it caused problems like above. We will fix this to a better approach, when we upgrade versions. It works for now

How can I implement drag-out-to-delete in Flex?

I have a List component from which I'd like to be able to remove items using drag & drop, but without having a specific target. If you use the mac, the behaviour I'm looking for is something like what the Dock uses; when you drag something out of the bounds of the control it should get an icon that indicates that it'll be deleted (OSX uses a cloud or something?) and then if you release it it will be removed from the list.
How can I do this?
(If I need to provide a more clear description, please comment; I'll fill in what I can)
In my experience with drag/drop in Flex, you cannot simply drag something out and handle that. There is no dragOut event (unfortunately), so that would leave you up to the task of writing dragOver and dragDrop listeners on all the containers surrounding your dragInitiator and handling the process accordingly.
It's more time consuming and can become complicated if any of these controls already have specific dragOver and dragDrop event handlers.
Hope this helps.
Having no Flex experience all I can offer is some psuedo code which resembles how I implemented a similar effect in JavaScript, but hopefully it will get you started.
Essentially what you'll want to do is during your drag event measure the current coordinates of the object you're dragging to see if they intersect the original container and when they fall outside of its bounds call the logic to update the icon in order to indicate it will be removed. Then, on the drop event, check the coordinates once more and delete the item if needed.

Mercury Quick Test Pro - Testing with a custom grid

We are trying to create some tests that reference an vendors custom grid. Unfortunatly QTP only recognises it as a WinObject which is quite useless. We need to be able to navigate the grid and change cell values, double click on a cell(without using X,Y co-ordinates) etc.
Ideally we want to get QTP to understand that this object is a grid and treat it as one.
Any help would be greatly appreciated.
Thanks
Jon
What vendor?
I have a few suggestions:
Use key strokes to navigate the grid, rather than mouse clicks. Ctrl-Home to set focus to the top-left cell, then use up, down, left, right to move around. Use Enter keystroke to simulate double clicking. Often you can use Ctrl-A, Ctrl-C to copy the contents of the grid to the system clipboard, and use the clipboard API to retrieve the data.
You may be able to programmatically get/set the grid properties using the .Object property. .Object provides access to the underlying native properties and methods of the object, as opposed to the QTP methods and properties. You could do something like the following pseudo-code to set focus to a cell and change the value. Your code would differ depending on the vendor implementation. Consult the vendor's documentation to find out what methods and properties you would be able to use.
WinObject("mygrid").Object.CurRow = 1
WinObject("mygrid").Object.CurCol = 1
WinObject("mygrid").Object.Value = "my new value"
If the grid in question happens to be a Stingray Objective Grid, QTP has plugins specifically for that.
Same thing for Infragistics. They have a plug-in for QTP for the UltraWinGrid etc.
http://www.infragistics.com/dotnet/testadvantage.aspx#Overview
It is resonable to send the request to Support Center. If they will get a big number of requests - they will add support for your grid-vendor.
May be you forgot to load (install) AddIn for your grid-vendor.

Adobe Flex - How to jump view?

I understand that we need to create MXML file to define a view. Suppose on user click of a button I want to show another view defined in another MXML file. How can I do this?
You could use a viewstack. each item in the viewstack would be a different MXML file so when the user clicks a button you change the selected index of the viewstack which makes the view change.
You could probably do with checking out the examples in http://www.adobe.com/devnet/flex/tourdeflex/ this will help explain so much more than a simple answer will.
From your question it sounds like you need to get the basics of flex first and the tour de flex app contains loads of examples with source code.
HTH.

Resources