May i know the element to import global transitions xml? - spring-webflow

I am using spring-webflow-2.0, I want to import globaltransitions.xml in to myflow.xml. can i use to achieve this? Because i dont see any other element for import...please help
Thanks,
Sundar

You have mark your globaltransitions.xml as abstract:
<flow abstract="true">
and inherit this abstract flow inside your final flow definition:
<flow parent="globaltransitions">

Related

Could not resolve * to a component implementation with custom CalloutButton component

I've got a custom CalloutButton component in a package called uiComponents. This custom CallOutButton is needed because I need some more properties in it.
This CalloutButton gets added to my MXML like usual;
<uiComponents:MyCustomCalloutButton someproperties here >
</uiComponents:My...>
Now, the enclosed s:calloutContent gets a compilation error, the (almost standard) could not resolve...
Naturally, the namespace has been imported
What am I missing here? This is driving me nuts for more than an hour now. Any help would be greatly appreciated!
Cheers!
Since the error was generated from the s:calloutContent tag ; not the uiComponents:MyCustomCallOutButton tag; the solution was that in many situations, enclosed tags must use the same namespace as their parent, so replace it with uiComponents:calloutContent
So instead of this:
<uiComponents:MyCustomCalloutButton someproperties here >
<s:calloutContent />
</uiComponents:My...>
You'll need to do this:
<uiComponents:MyCustomCalloutButton someproperties here >
<uiComponents:calloutContent />
</uiComponents:My...>

Flex wrapper title

I need to change browser title via flex.
How can I change the broser title with flex in execution time?
I'm setting the title like this:
<mx:Application (xxx) pageTitle="ConfigApp.getTitle()}" (xxx) >
You can use the BrowserManager class for this. It has a function called setTitle() which does exactly what you want.
The BrowserManager can also handle a lot more interactions between Flex and the browser. I wrote a more elaborate answer on this topic earlier, which you can find here: Bookmarks in Flex
This works for me:
import mx.managers.BrowserManager;
import mx.managers.IBrowserManager;
import mx.events.BrowserChangeEvent;
private var bm:IBrowserManager;
bm = BrowserManager.getInstance();
bm.setTitle("... Page title xxx ...");

View inheritance problem

I have copied this question here from spring forum.
I have a parent flow and a child flow. The parent flow has following folder structure
parent
|
|--parent-flow.xml
|--parentView.xhtml
This parent has following view-state
<view-state id="parentState" view="parentView.xhtml">
</view-state>
Child flow looks like this:
<flow ...
parent="parent">
...
<view-state id="test">
<transition on="bang" to="parentState"/>
</view-state>
...
</flow>
The problem is when I hit 'bang' action of child flow it can't see parentView.xhtml view in parent flow. I get something like this:
Code:
The requested resource (/spring/child?execution=e3s2) is not available.
If I copy parentView.xhtml into child's flow folder, everything works as a charm.
I wonder if it is a defect or it was designed to work like this? If it's a defect, then it worse opening JIRA ticket... This situation is quite common I think, for example in my case I have delete conformation screen (parent view-state) that is used in all pages where user is able to delete entities.
Workaround for the issue:
One can specify relative path in view attribute. The example below works if you specify parent view like that:
<view-state id="parentState" view="../parent/parentView.xhtml">
</view-state>

Where does code within Script tags go in the resulting AS class?

I was wondering what happens to the code contained in an <mx:Script> tag. If I define a function tehre, it just becomes a member function of the generated class. But I noticed that it seems OK for the compiler if I just write some (static) method calls there (specifically, I call Font.registerFont()). It works fine, but I feel kind of guilty for doing this, because I have no idea what's really happening and when the code gets executed.
MXML is formally an ActionScript generation language. So, the Flex compiler will translate all MXML into ActionScript.
If you wan to see what happens; add the 'keep-generated-actionscript' argument to the compiler and then you can look at the generated ActionSCript code.
http://livedocs.adobe.com/flex/3/html/compilers_14.html#157203
Beyond that; I don't really understand your question. Why would static methods make you feel guilty?
Following the advice of www.Flextras.com's answer, I kept the generated Actionscript classes and had a look. The code inside <mx:Script> tags is simply put in the class body as-is. Knowing that, I could dig into the Flex livedocs and came across the following paragraph in the section about class definitions:
ActionScript 3.0 allows you to include not only definitions in a class body, but also statements. Statements that are inside a class body, but outside a method definition, are executed exactly once--when the class definition is first encountered and the associated class object is created.
So, putting statements inside a <Script> tag in an MXML file is equivalent to putting code in a static block in a Java class definition.

Flex code region?

Is there a way in flex (Flash Builder 4) to make regions like in c#, to group a part of the code allowing us to collapse it and see through our project more easily?
In c# it's like:
#region example
// my functions I want to group
#endregion
Not that I have seen. I have only found comment and function collapsing.
No, you basically have to use comments. I generally do something like
// *********************** THIS REGION IS FOR ... *************************
Actually, there is a way you can do this, at least in Flex Builder 4.5. I've had success using multiple <fx:Script> tags. You can add a <!--Region Title--> comment above the tag, and just collapse the entire tag. Not exactly as good as proper code regions, but it works pretty well.

Resources