SWIZ: Getting started with first example - apache-flex

I am trying to start with the framework, but it appears to be
dramatically hard for some reason. I want to follow complete example
posted here
http://swizframework.jira.com/wiki/display/SWIZ/Quick+Start
But I have issue on the very beginning. E.g.
<swiz:beanProviders>
<config:Beans />
</swiz:beanProviders>
The line causes the error:
The prefix "config" for element "config:Bean" is not bound.
SwizTest.mxml /SwizTest/src line 10 Flex Problem

I think you're probably just missing the namespace declaration for the config: part of config:Beans. Flex basically doesn't know what package or folder config prefix is pointing to unless you have that.
If you look at the application node at the top of the example I think you'll see what's missing:
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:view="org.swizframework.quickswiz.view.*"
xmlns:config="org.swizframework.quickswiz.config.*"
xmlns:swiz="http://swiz.swizframework.org">
Hope that does the trick.

Related

change base path in blazor server application

I'm trying to change the base path in a Blazor server application. Instead of having it at
http://localhost:5000/ I want to have it at http://localhost:5000/CoolApp/
I followed this instructions, but the application crashes with:
InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /CoolApp/{**path:nonfile}, area: }.
Here's the sample
I had this exact problem. I explored it for about an hour or so as well. The problem was that in my component I had a
href="#($"/myPageComponent/{id}")"
...When I removed the / and made it
href="#($"myPageComponent/{id}")"
then it worked. Basically, check your child's component and make sure that you have no slash in the beginning. As the slash is saying "Go to the root". Also, in my specific case, I had to include a separate web.config file that prevented the app from inheriting parent configuration features. Like So
`<configuration>
<location path="." inheritInChildApplications="false">
<configuration/>`
You should removing the app.PathBase():
app.Map("/CoolApp", coolApp =>
{
coolApp.MapBlazorHub();
coolApp.MapFallbackToPage("/_Host");
});
This will mean nothing will run unless it is on the /CoolApp endpoint - and you don't need to worry about appending the /CoolApp route to anything.
In future if you don't want the /CoolApp base path - move the inside of the Map() function out and remove it, replacing coolApp with app.
Let me know if this works for you!

Why NBug HostApplicationVersion shows an incorrect version of the application?

I get a Crash Report, but HostApplicationVersion does not show the version of my application.
It seems that the version of NBug itself is shown, while the version of my application 2.12.4.0.
<Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GeneralInfo>
<CLRVersion>4.0.30319.42000</CLRVersion>
<DateTime>10/14/2020 6:17:46 PM</DateTime>
<ExceptionMessage>Object reference not set to an instance of an object.</ExceptionMessage>
<ExceptionType>System.NullReferenceException</ExceptionType>
<HostApplication>HotBotVPN.exe</HostApplication>
<HostApplicationVersion>1.2.*</HostApplicationVersion>
<NBugVersion>1.2.1.0</NBugVersion>
<TargetSite>...</TargetSite>
</GeneralInfo>
</Report>
You probably need to set this: https://github.com/soygul/NBug/blob/master/NBug/Settings.cs#L391
I'm guessing you are dynamically loading NBug assembly which can cause this.

How do I add attributes to a root element when the class is generated by JAXB?

I'm developing a REST API that uses Spring MVC. The objects I consume and produce are generated (using JAXB) from NCPDP (http://www.ncpdp.org/) XSDs. I have everything working when requests come in, but I'd like to add additional attributes to the root element on outgoing requests.
Right now, my outgoing response looks as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<transport:Message xmlns:transport="http://www.ncpdp.org/schema/transport">
<transport:Header>
...
</transport:Header>
<transport:Body>
<transport:Status>
<transport:Code>010</transport:Code>
<transport:Description>OK</transport:Description>
</transport:Status>
</transport:Body>
</transport:Message>
And it should look as follows:
<?xml version="1.0"?>
<transport:Message xmlns:transport="http://www.ncpdp.org/schema/transport" xmlns:datatypes="http://www.ncpdp.org/schema/datatypes"
xmlns:script="http://www.ncpdp.org/schema/script" xmlns:structures="http://www.ncpdp.org/schema/structures"
xmlns:pa-structures="http://www.ncpdp.org/schema/pa-structures" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
StructuresVersion="v2014041" ECLVersion="v2014041" DatatypesVersion="v2014041" PA-StructuresVersion="v2014041"
TransactionVersion="v2014041" TransportVersion="v2014041" TransactionDomain="SCRIPT">
<transport:Header>
...
</transport:Header>
<transport:Body>
<transport:Status>
<transport:Code>010</transport:Code>
</transport:Status>
</transport:Body>
</transport:Message>
I don't believe I need all the namespaces defined (since they're not used), but I do need the StructuresVersion and all other attributes. Is there a way to modify my bindings.xjb to include these attributes? Or do I have to copy the generated code into my source tree and add annotations to do this?
Thanks,
Matt
Since these attribute are declared in your XML schema, you should be getting appropriate properties in your schema-derived code.
It actually does not matter if this is a root element or some child element. Please re-check the generated code, look for something like getStructuresVersion(). So you don't need to do anything.
As for the namespaces, you will get them automatically declared, when you marshal. But you may first get them declared as ns0, ns1 etc. which is not very nice in terms of readability. Please see the following question:
Controlling namespace prefixes in JAXB
(the question itself, not the answers) for information on how to control these prefixes with a custom prefix mapper or this post by Blaise Doughan.

Clarification of web deploy project settings

During a web deployment I'd like to change some ACL settings. I found this article describing the process.
The article includes the following code snippet:
<PropertyGroup>
<!- Extends the AfterAddIisSettingAndFileContentsToSourceManifest
action to also set ACLs–>
<IncludeCustomACLs>TRUE</IncludeCustomACLs>
<AfterAddIisSettingAndFileContentsToSourceManifest Condition=“‘$(AfterAddIisSettingAndFileContentsToSourceManifest)’==”“>
$(AfterAddIisSettingAndFileContentsToSourceManifest);
SetCustomACLs;
</AfterAddIisSettingAndFileContentsToSourceManifest>
</PropertyGroup>
My question relates to the Condition attribute. From the comment, it appears that the intent is to append SetCustomACLs to the AfterAddIisSettingAndFileContentsToSourceManifest property. But from the condition, it appears that this block is only evaluated when AAISAFCTSM is not already set, so this isn't an "extension" so much as a "set-if-null".
So do the comment and markup disagree, or am I missing something?
I believe the Condition is there to ensure that if you've set AfterAddIisSettingAndFileContentsToSourceManifest somewhere else in the build stack explicitly, then it wont be altered. Having said that, I'd say that you aren't missing something, it reads to me the exact same way it reads to you.

Flex 3 TileList Drag/Drop/Re-order Exception. How do I rearrange tiles?

I’m in need of some dire help here. I'm writing an application in Flex 3 that utilizes a TileList with a custom itemRenderer to display info from a service. Unfortunately, I'm running into an exception with the drag/drop/rearrange portion of the TileList. With dragEnabled and dragMoveEnabled, I receive a fully-reproducible exception when trying to rearrange the tiles in the control:
Exception:
ArgumentError: Error #2004: One of the parameters is invalid.
at flash.utils::ByteArray/writeObject()
at flash.desktop::Clipboard/putSerialization()
at flash.desktop::Clipboard/convertFlashFormat()
at flash.desktop::Clipboard/setData()
at mx.managers::NativeDragManagerImpl/doDrag()[C:\autobuild\3.2.0\frameworks\projects\airframework\src\mx\managers\NativeDragManagerImpl.as:282]
at mx.managers::DragManager$/doDrag()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\DragManager.as:243]
at mx.controls.listClasses::ListBase/dragStartHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:9085]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
at mx.controls.listClasses::ListBase/mouseMoveHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:8822]
Here’s the code for the custom TileList:
<cmp:MemoTileList itemRenderer="CoverNote" dragEnabled="true" itemsChangeEffect="{this.myTileListEffect}" backgroundAlpha="0" id="memoList" dataProvider="{this.management.memoCollection}" right="0.049865723" left="0.05" top="0" bottom="0" focusEnabled="false" focusAlpha="0" borderStyle="none" direction="horizontal" textAlign="left" allowMultipleSelection="false" showEffect="fadeIn" hideEffect="fadeOut" effectEnd="fadeOut" effectStart="fadeIn" dragDrop="onReorder(event)" dragMoveEnabled="true">
</cmp:MemoTileList>
Here's the code for the onReorder(event):
private function onReorder(event:DragEvent):void{
var indexStartDrag:Number = event.currentTarget.selectedIndex
var indexStopDrag:Number = this.memoList.calculateDropIndex(event);
Alert.show(indexStopDrag.toString());
}
When I try to debug, the debugger doesn't seem to indicate to me any piece of code that might be faulty.
Can anyone point me the right direction as to how to solve this?
Thanks in advance!
Tajddin
ArgumentError: Error #2004: One of the parameters is invalid.
Is one of those "can be whatever" messages ;(
I remember I had it not to long ago, misspelled some function and Eclipse compiled just fine even though it shouldn't have..(a restart of eclipse helped here, but it took me a while before i found out..).
My tip is to remove code until it works and re-add it again, also check number of parameters. Its a "weird" bug for sure, you know one of those, "have to call these two functions in a certain order" and whatnot. Good Luck!
Other stories about the #2004 ;
http://www.coldfusioncommunity.org/profiles/blog/show?id=1439641%3ABlogPost%3A14565
http://blog.3alves.com/blog/post/2007/09/19/argumenterror-error-2004.aspx
This one was interesting;
http://code.google.com/p/flexlib/issues/detail?id=113#c3

Resources