Flex4 : Component state vs skin state
Hello,
I still can't quite figure the difference between the two ( if there is even a difference )
component state : Defined by UIComponent's current state
skin state : Determined by SkinnableComponent->getCurrentSkinState.
Now, when should one use these 2 different mechanisms ?
My first thought was that skin state was used for small variations ( selected effects, small controls appearing, etc ) and that component state was more for application state, like a view representing a form would change drammatically if currentState became FORM_BEING_SUBMITTED. But a skin could very well be applied to a huge and complex view so this reasonning fails.
-> Another interpretation is that you would use a skin only if flexibility is required, or else just use the old component state mechanism.
Is that correct?
Hi,
It can be a bit confusing, no worries. Not sure if this will help but here goes...
A Flex 4 "skin" is itself a component - e.g. Skin is derived from UIComponent and as such supports view states. So when you see the term 'skin state' all it really means is that it is the 'currentState' of the Flex 4 skin. The 'currentState' of a Skin is controlled automatically by the SkinnableComponent the skin is associated with (based on what getCurrentSkinState returns at a given point in time).
There really is no functional difference between how view states work for a Flex 4 Skin vs. how they work for say any other MXML component (like Application) - other than who is responsible for changing the state over time. It's just that in the case of Application where (as in your example) you may define 3 different orientations of your application for example - you'd be responsible for setting currentState when appropriate.
The one thing to remember (and I'm sure is the reason for most folk's confusion) is that for a SkinnableComponent instance, there really aren't any "states" for the component itself - the 'currentState' and states array are unused in this case.
A simple example:
Button. The actual Button class has no states itself, but its Skin does. The Button is responsible for putting the Skin in one of the possible view states at runtime based on user interaction over time (e.g. up, over, down, disabled). e.g. getCurrentSkinState is called on Button and depending on what is returned, the Button will (behind the scenes) set 'currentState' of the Skin component to one of the 4 states.
Setting 'currentState' on a Button itself has no affect, because the Button has no actual states defined (as far as the states API is concerned), even though it happens to also be a UIComponent.
-Corey
Similar Messages
-
Declaring skin states in an MXML component?
From the docs, you can declare skin states in a .as file before the class declaration, like this:
[SkinState("up")]
[SkinState("over")]
[SkinState("down")]
[SkinState("disabled")]
public class Button extends Component { .. }
But how do declare states in a .mxml file? There is no "public class ..." statement to precede.So maybe this isn't possible? I have had such a hard time finding docs on the component side of the skinning contract.
-
Custom TitleWindow Skin State Problem
Hi everyone, I've got a problem:
I have a TitleWindow with a skin made by me.
Everything is perfect but when I change to a certain state (in this case is called "AuctionWon").
When I get to that state the skin completely disappear showing a transparent background and the components I placed in that state aren't right.
Here is screenshot of component state in flash builder design mode (when running I can't see the background and the green button):
http://dl.dropbox.com/u/4064417/panelStateError.JPG
Here the screenshot when I run the program
http://dl.dropbox.com/u/4064417/panelStateError2.JPG
Do you find something strange in the code?
Component code:
http://pastebin.com/A2XtZKxs
Code where I manage the component (I change the state at 73):
http://pastebin.com/su2878Zu
here is the skin definition:
http://pastebin.com/8XXP7pa3
making some test I found out that sometime, if I manage to find the title bar in the panel and I drag it, the skin magically appears but the buttons are still wrong...
unfortunately it appears just sometimes...
It also appears magically if I bring the window application to icon and then reopen it...
I really just can't figure out the problem =S
Can someone help me please?
Thank you in advanceThank you Kevinklee for the quick answer =)
Changing the TextArea's background alfa brings to nothing =\
But I saw a change when I applied the image component of my skin in all the states
Here is the new skin code (yellow line is the edited part)
http://pastebin.com/grgAQLRW
The change I see is this: now I can't see my image in Design mode as well and in all the states of my TitleWindow
Screenshot:
http://dl.dropbox.com/u/4064417/panelStateError3.JPG
In the skin design mode anyway I can see my image. Now what I have to do to make it visible everywhere? -
Missing "disabled" state in skin
I have a custom component CircleProgress.mxml with two states: "default" and "other", using a skin with the same two states defined. But during compilation, there appears an error in the skin file: The required skin state "disabled" is missing.
I don't want any "disabled" state because the logic of my application does not include such state. How to get rid of this error? (without adding the "disabled" state)
Below is the code:
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
skinClass="mylib.progress.circle.skins.SolidSkin"
>
<s:states>
<s:State name="default"/>
<s:State name="other"/>
</s:states>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import spark.components.supportClasses.SkinnableComponent;
import spark.primitives.Ellipse;
[SkinState("default")]
[SkinState("other")]
[SkinPart(required="true")]
public var skinCircle:Ellipse;
]]>
</fx:Script>
</s:BorderContainer>
And the skin:
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Metadata>
[HostComponent("mylib.progress.circle.CircleProgress")]
</fx:Metadata>
<s:states>
<s:State name="default" />
<s:State name="other" />
</s:states>
<s:Ellipse id="skinCircle" width="100%" height="100%" >
<s:stroke>
<s:SolidColorStroke color="blue"/>
</s:stroke>
</s:Ellipse>
</s:Skin>I think you're right. It is even written in Adobe documentation of the BorderContainer under the Skin States section, I just didn't notice it before, Bordercontainer inherits "disabled" and "normal" skin states.
-
How to add multiple skin states to SkinnableContainerSkin so that can switch among states
Hi All,
I have a xml which represents 2 views of SkinnableContainer, xml being parsed and converted to ui elements and stored into 2 array variables based on display property of the tag
initially adding 1 set of array element to Container
whenever a button clicked to show different set of array elements, calling removeAllElements() and adding different set of elements from 2nd array
Can somebody help me converting this application to utilize "Skin States" feature
Sorry, Could not find way to attach demo project, copied code bellow
Thanks in advance...
/src/ContainerDemo.mxml
/com.containerdemo.controls
ButtonControl.as
ContainerControl.mxml
CustomContainer.as
CustomControls.mxml
IControl.as
ParentControl.mxml
/com.containerdemo.skins
ButtonControlSkin.mxml
CustomContainerSkin.mxml
/com.containerdemo.utils
XmlUtil.as
ContainerDemo.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="700" minHeight="500"
xmlns:controls="com.containerdemo.controls.*">
<s:VGroup paddingBottom="20" paddingLeft="20"
paddingRight="20" paddingTop="20" gap="20"
horizontalCenter="0">
<s:Label text="Flex states demo" fontSize="30"/>
<controls:ParentControl id="pc" />
</s:VGroup>
</s:Application>
XmlUtil.as
package com.containerdemo.utils {
import com.containerdemo.controls.ButtonControl;
import com.containerdemo.controls.ContainerControl;
import com.containerdemo.controls.CustomContainer;
import com.containerdemo.controls.IControl;
public class XmlUtil {
public static var ELEMENTS:Object = {
"buttonElement": ButtonControl,
"containerElement": ContainerControl
public static function parse(xml:XML):IControl {
var name:String = xml.name();
var clazz:Class = ELEMENTS[name];
var elem:IControl = new clazz();
elem.parse(xml);
return elem;
CustomContainerSkin.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Metadata>
[HostComponent("com.containerdemo.controls.CustomContainer")]
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>
<s:Group id="rectGroup">
<s:Rect left="0" right="0" top="0" bottom="0" radiusX="8" radiusY="8">
<s:stroke>
<s:SolidColorStroke weight="2" color="#FF0000" alpha="0.8" />
</s:stroke>
</s:Rect>
<s:HGroup top="10" left="10" right="10" gap="4">
<s:Label id="containerLabel" text="{this.hostComponent.label}" />
<s:Button id="compOrExpButton" label="{this.hostComponent.btnLabel}" />
<mx:Spacer width="100%" />
</s:HGroup>
<s:Group id="contentGroup" left="16" right="16" top="32" bottom="32" />
</s:Group>
</s:SparkSkin>
ButtonControlSkin.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
minWidth="21" minHeight="21" alpha.disabled="0.5">
<fx:Metadata>
[HostComponent("com.containerdemo.controls.ButtonControl")]
</fx:Metadata>
<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<s:Label id="labelDisplay"
textAlign="center"
verticalAlign="middle"
maxDisplayedLines="1" minWidth="20"
horizontalCenter="0" verticalCenter="1"
left="10" right="10" top="2" bottom="2">
</s:Label>
</s:SparkSkin>
ParentControl.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:controls="com.containerdemo.controls.*"
creationComplete="group1_creationCompleteHandler(event)">
<fx:Declarations>
<fx:XML id="compXml" xmlns="">
<elems>
<buttonElement id="b1" label="Element1" />
<containerElement id="c2" label="Container2" display="comp">
<comp>
<buttonElement id="c2b1" label="Element5 (Comp)" />
<buttonElement id="c2b2" label="Element6 (Comp)" />
<containerElement id="c2c1" label="Container c2c1" display="comp">
<comp>
<buttonElement id="c2c1b1" label="Element c2c1b1 (Comp)" />
<buttonElement id="c2c1b2" label="Element c2c1b2 (Comp)" />
</comp>
</containerElement>
<containerElement id="c2c2" label="Container c2c2" display="comp">
<comp>
<buttonElement id="c2c2b1" label="Element c2c2b1 (Comp)" />
<buttonElement id="c2c2b2" label="Element c2c2b2 (Comp)" />
</comp>
</containerElement>
</comp>
</containerElement>
<buttonElement id="b3" label="Element7" />
</elems>
</fx:XML>
<fx:XML id="expXml" xmlns="">
<elems>
<buttonElement id="b1" label="Element1" />
<containerElement id="c2" label="Container2" display="exp">
<comp>
<buttonElement id="c2b2" label="Element5 (Comp)" />
<buttonElement id="c2b2" label="Element6 (Comp)" />
<containerElement id="c2c1" label="Container c2c1" display="exp">
<comp>
<buttonElement id="c2c1b1" label="Element c2c1b1 (Comp)" />
<buttonElement id="c2c1b2" label="Element c2c1b2 (Comp)" />
</comp>
<exp>
<buttonElement id="c2c1b3" label="Element c2c1b3 (Exp)" />
<buttonElement id="c2c1b4" label="Element c2c1b4 (Exp)" />
</exp>
</containerElement>
<containerElement id="c2c2" label="Container c2c2" display="comp">
<comp>
<buttonElement id="c2c2b1" label="Element c2c2b1 (Comp)" />
<buttonElement id="c2c2b2" label="Element c2c2b2 (Comp)" />
</comp>
<exp>
<buttonElement id="c2c2b3" label="Element c2c2b3 (Exp)" />
<buttonElement id="c2c2b4" label="Element c2c2b4 (Exp)" />
</exp>
</containerElement>
</comp>
<exp>
<containerElement id="c4" label="Container4" display="comp">
<comp>
<buttonElement id="c4b1" label="Element 555(Comp)" />
<buttonElement id="c4b2" label="Element 655 (Comp)" />
</comp>
<exp>
<buttonElement id="c4b3" label="Element 335 (Exp)" />
<buttonElement id="c4b4" label="Element 126 (Exp)" />
</exp>
</containerElement>
</exp>
</containerElement>
<buttonElement id="b3" label="Element7" />
</elems>
</fx:XML>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function group1_creationCompleteHandler(event:FlexEvent):void {
this.customControls.parse(compXml);
]]>
</fx:Script>
<controls:CustomControls id="customControls" />
</s:Group>
IControl.as
package com.containerdemo.controls
import mx.core.IVisualElement;
public interface IControl extends IVisualElement {
function parse(xml:XML):void;
CustomControls.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
implements="com.containerdemo.controls.IControl">
<fx:Script>
<![CDATA[
import com.containerdemo.utils.XmlUtil;
public function parse(xml:XML):void {
for each (var child:XML in xml.children()) {
var e:IControl = XmlUtil.parse(child);
this.addElement(e);
]]>
</fx:Script>
<s:layout>
<s:HorizontalLayout verticalAlign="middle" gap="15"
paddingLeft="16" paddingRight="16"
paddingTop="16" paddingBottom="16" />
</s:layout>
</s:Group>
CustomContainer.as
package com.containerdemo.controls
import com.containerdemo.skins.CustomContainerSkin;
import com.containerdemo.utils.XmlUtil;
import flash.events.MouseEvent;
import mx.collections.ArrayCollection;
import spark.components.Button;
import spark.components.Group;
import spark.components.SkinnableContainer;
public class CustomContainer extends SkinnableContainer implements IControl {
[SkinPart(required="true")]
public var compOrExpButton:Button;
[SkinPart(required="true")]
public var rectGroup:Group;
private var dispState:String;
private var _label:String;
private var _cid:String;
private var compControls:ArrayCollection;
private var expControls:ArrayCollection;
public function CustomContainer() {
this.setStyle("skinClass", Class(CustomContainerSkin));
public function parse(xml:XML):void {
this.compControls = null;
this.expControls = null;
compControls = new ArrayCollection;
expControls = new ArrayCollection;
this.dispState = xml.@display;
this.label = xml.@label;
this.cid = xml.@id;
for each (var child:XML in xml.comp.children()) {
var e:IControl = XmlUtil.parse(child);
this.compControls.addItem(e);
//trace((e is ButtonControl).label);
for each (var child1:XML in xml.exp.children()) {
var e1:IControl = XmlUtil.parse(child1);
this.expControls.addItem(e1);
//trace((e1 as ButtonControl).label);
showControls();
[Bindable]
public function set cid(value:String):void {
this._cid = value;
public function get cid():String {
return this._cid;
public function showControls():void {
if (this.dispState == "comp") {
showCompControls();
} else {
showExpControls();
public function showCompControls():void {
if (this.numElements >0)
this.removeAllElements();
for each (var e:IControl in compControls) {
this.addElement(e);
this.btnLabel = "Exp";
this.invalidateSkinState();
public function showExpControls():void {
if (this.numElements >0)
this.removeAllElements();
for each (var e:IControl in expControls) {
this.addElement(e);
this.btnLabel = "Comp";
this.invalidateSkinState();
public function get ownerContainer():CustomContainer {
return this.owner as CustomContainer;
public var b:Boolean = true;
public function displayCompOrExpControls(event:MouseEvent):void {
if (this.btnLabel == "Exp") {
if (b) {
this.reParse();
b = false;
} else {
this.showExpControls();
} else {
this.showCompControls();
public function reParse():void {
/*if (this.owner && (this.owner is CustomContainer))
(this.owner as CustomContainer).reParse();
else {*/
var xml:XML = this.parentApplication.pc.expXml;
var expXml:XMLList = xml.descendants().(attribute("id") == this.cid);
this.parse(expXml[0]);
private var _btnLabel:String;
public function get btnLabel():String {
return this._btnLabel;
[Bindable]
public function set btnLabel(value:String):void {
this._btnLabel = value;
public function get label():String {
return this._label;
[Bindable]
public function set label(value:String):void {
this._label = value;
override protected function partAdded(partName:String, instance:Object):void {
super.partAdded(partName, instance);
if (instance == this.compOrExpButton)
this.compOrExpButton.addEventListener(MouseEvent.CLICK, displayCompOrExpControls, false, 0, true);
override protected function partRemoved(partName:String, instance:Object):void {
super.partRemoved(partName, instance);
if (instance == compOrExpButton)
this.compOrExpButton.removeEventListener(MouseEvent.CLICK, displayCompOrExpControls, false);
ContainerControl.mxml
<?xml version="1.0" encoding="utf-8"?>
<controls:CustomContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:controls="com.containerdemo.controls.*">
<controls:layout>
<s:HorizontalLayout gap="20"
paddingLeft="16" paddingRight="16"
paddingBottom="16" paddingTop="16" />
</controls:layout>
</controls:CustomContainer>
ButtonControl.as
package com.containerdemo.controls
import com.containerdemo.skins.ButtonControlSkin;
import spark.components.Button;
public class ButtonControl extends Button implements IControl {
public function ButtonControl() {
this.setStyle("skinClass", Class(ButtonControlSkin));
public function parse(xml:XML):void {
this.label = xml.@label;Could somebody help me?
-
Skin state problem with PopupAnchor
I wanted a button which on hover show a popup. and depending on some state, add/remove elements from the popup.
I extended Button to create HoverButton and used DropDownController with PopupAnchor to get the hover to popup behavior. However for some reason removing element from the popup using skin state isn't working. I've included a sample code below.
Basically when you mouse hover over the button, you should see a popup with one or two label depending on state which gets toggled when you click on the button. Initially you see one label in the popup because it's in open state. when you click on the button, state should change to close. so when you hover on the button, popup shows up with two button. So far so good. But if you move your mouse away and then hover again, all of sudden you don't get the second button.
anyone have any idea why this is happening?
MainApplication.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:local="*">
<local:HoverButton skinClass="HoverButtonSkin" label="wtf" horizontalCenter="0" verticalCenter="0"/>
</s:WindowedApplication>
HoverButton.as
package
import flash.events.MouseEvent;
import spark.components.Button;
import spark.components.Group;
import spark.components.supportClasses.DropDownController;
import spark.events.DropDownEvent;
[SkinState("open")]
[SkinState("close")]
public class HoverButton extends Button
private var _dropDownController:DropDownController;
private var _open:Boolean = true;
[SkinPart(required='true')]
public var dropDown:Group;
public function HoverButton()
super();
_dropDownController = new DropDownController();
_dropDownController.openButton = this;
_dropDownController.rollOverOpenDelay = 300;
_dropDownController.addEventListener(DropDownEvent.OPEN, handleDropDownOpenClose, false, 0, true);
_dropDownController.addEventListener(DropDownEvent.CLOSE, handleDropDownOpenClose, false, 0, true);
override protected function clickHandler(event:MouseEvent):void
_open = !_open;
override protected function getCurrentSkinState():String
var skinstate:String;
// if the hover is opened, return open
if (_dropDownController.isOpen) {
if (_open) {
skinstate = "open";
} else {
skinstate = "close";
} else {
skinstate = super.getCurrentSkinState();
return skinstate;
override protected function partAdded(partName:String, instance:Object):void
super.partAdded(partName, instance);
if (instance == dropDown) {
_dropDownController.dropDown = dropDown;
override protected function partRemoved(partName:String, instance:Object):void
super.partRemoved(partName, instance);
if (instance == dropDown) {
_dropDownController.dropDown = null;
private function handleDropDownOpenClose(event:DropDownEvent):void
// invalidate skin state whenever the hover gets opened or closed.
invalidateSkinState();
HoverButtonSkin.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009" width="50" height="50">
<fx:Metadata>[HostComponent("HoverButton")]</fx:Metadata>
<!-- states -->
<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="open" stateGroups="hoverState" />
<s:State name="close" stateGroups="hoverState" />
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<s:Rect top="0" bottom="0" left="0" right="0">
<s:fill>
<s:SolidColor color="0xAAAAAA" />
</s:fill>
</s:Rect>
<s:PopUpAnchor id="popUp" displayPopUp="false" displayPopUp.hoverState="true" includeIn="hoverState"
left="0" right="0" top="0" bottom="0" itemDestructionPolicy="auto"
popUpPosition="above" popUpWidthMatchesAnchorWidth="false">
<s:Group id="dropDown">
<s:VGroup>
<s:Label text="{'hover ' + currentState}"/>
<s:Label text="closeLabel" includeIn="close"/>
</s:VGroup>
</s:Group>
</s:PopUpAnchor>
<s:Label id="labelDisplay" verticalCenter="0" horizontalCenter="0"/>
</s:SparkSkin>hello!
I've experienced the same problem after installing arch on my new hp nx7400. Workaround is to compile psmouse as a module, so i ask you to do that...
Ubuntu users only need to unloading module before shutdown / reboot by adding 'modprobe -r psmouse' to '/etc/init.d/halt' and '/etc/init.d/reboot' because they have psmouse as a module compiled to kernel.
I've noticed that arch devs made that floppy is now a module so I would be gratefull if they could do the same with psmouse. -
Issues with interactivity between component states and page states
Hi there, I recently downloaded the trial of Catalyst 5.5 and am encountering the following problem:-
I have many screens in my application and am attempting to get around the 20 state limit by creating custom components that contain multiple states that can be used as screens. So, I have created button links between the component states which work fine but have also created button links to and from the standard states of the application, which dont work upon running/publishing. I'm not quite sure whats wrong here as the button commands are pointing to the right place, i.e. they are pointing firstly to the specific custom component and then the state within the component, but its just not working.
Is this a trial issue or something deeper?
I really hope someone can help as apart from this issue I have been very happy with the application but if I can not find a solution theres no point in purchasing it.
Cheers.Ive had the same problem. Im trying to create an interactive e-book but im having problmes with the limit of states. I have now worked out that i have to create custom components to create a sub-state but im finding it difficult to go between sub states. Help anyone?
-
How to change train step from visited state to disabled state
Hi all,
I like to change visited train step into disable state again.
Is there anyway to do this?
With Regards,
WPHi M.Jabr,
Thanks for your reply.
It works.
i like to know one more thing about train.
is there anyway to change visited state to unvisited state?
With Regards,
WP -
Converting an update statement to modify statement in BADI
Hai I want to convert an update statement to nodify statement . Can we define the internal table in BADI. Give me the code
Hi,
We can define internal tables in BADI.
Example:
Implement BADI ME_PROCESS_PO_CUST and in the method PROCESS_ITEM
DATA: ls_mepoitem TYPE mepoitem.
*get item data
ls_mepoitem = im_item->get_data( ).
IF ls_mepoitem-adrn2 EQ space AND
ls_mepoitem-adrnr EQ space.
Retrieve the adddres or hardcode as per ur reqmt.
*transfer the address to ls_mepoitem-adrn2.
MOVE v_adrn2 TO ls_mepoitem-adrn2.
CALL METHOD im_item->set_data
EXPORTING
im_data = ls_mepoitem.
ENDIF.
Asha -
Statement and Prepared Statement
if i write a same query with statement and preparedStatement
like
Select * from emp_detail where emp_id =20;
stmt= con.createStatment();
rs = stmt.executeQuery(query);
and using preparedStatement
Select * from emp_detail where emp_id =?;
pstmt= con.prepareStatement();
pstmt.setInt(1,20);
rs = stmt.executeQuery(query);
Using which statment(Statement or Prepared Statement) the data will retrive fast and why.... in these case ????Statement should be quicker than Prepared Statement, because
Statment do only one thing: send that sql to server or run that sql directly.
Prepared Statement should do two (or more than two)things:
1. parse your sql first, prepare a store procedure, then call that store procedure.
Or
2. prase your sql first, then use your value to replace "?" for getting a new sql, then work like Statement.
Prepared Statement is quiker when you use it repeatedly. -
Statement,Prepared Statement and callable statement
Hi,
Please let me know in which scenario we are using Statement,Prepared Statement and callable statement.
and which is efficient one among the above.
Thanks in advanceWelcome to the forum!
>
Please let me know in which scenario we are using Statement,Prepared Statement and callable statement.
>
We don't know what scenario you are using those in or if you are using them at all. Are you asking what they are?
For document related questions you should consult the documentation or use your favorite search engine to get information.
See the Java Tutorial
http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html
>
The main feature of a PreparedStatement object is that, unlike a Statement object, it is given a SQL statement when it is created. The advantage to this is that in most cases, this SQL statement is sent to the DBMS right away, where it is compiled. As a result, the PreparedStatement object contains not just a SQL statement, but a SQL statement that has been precompiled. This means that when the PreparedStatement is executed, the DBMS can just run the PreparedStatement SQL statement without having to compile it first.
>
The Javadocs for your Java SDK have the API for each of those classes and a description of what they are. And the Oracle JDBC Developer Guide has extensive information on how to use them.
http://docs.oracle.com/cd/B28359_01/java.111/b31224/toc.htm -
Cash Flow Statement & Funds Flow Statement
Hi,
Good day!
I'm currently working on a project where I have to generate a Cash Flow Statement & Funds Flow Statement from SAP. I would just like to ask how to generate the same and what tables or databases I need to consider or check in preparing it.
Regards,
Nimish AgarwalDear Colleagues:
I would like to ask you if you know a Report that cover the requirement of "State of origin and application of Funds" Report. I would need an Standard Report in SAP in order not to make a Z development.
Your Sincerely
leonardo lopez
FI Consultant. -
Retained Earnings Statement Format(Financial Statement Version)
Dear Friends,
Since 2 days i am requesting you regarding Retained Earnings Statement Format(Financial Statement Version)
Please send me the fromat for Retained Earnings Statement Format(Financial Statement Version)
It would be a great help for me and points will be assigned...
Regards
Sap Guru
[email protected]hi sapguru,
please cheek your mail and assign points. -
How to create active state or current state in spry menu ?
i have build a vertical menu with spry menu widget, Just
wondering if any one can guide me how to create an active state or
current state in the menu.
I want the visitor to understand which page they are on, so
just want to change the colour of the active link.<helpful but self-serving too>
There are several ways to do this, but the easiest way, if I
may say so,
is to use my divaGPS Extension. It works with virtually any
menu type
and is designed to accomplish precisely what you are asking
for quickly
and easily.
</back to our regularly scheduled programming>
E. Michael Brandt
www.divaHTML.com
divaPOP : standards-compliant popup windows
divaGPS : you-are-here menu highlighting
divaFAQ : FAQ pages with pizazz
www.valleywebdesigns.com
JustSo PictureWindow
JustSo PhotoAlbum -
How to highlight State of Multi-State object?
hi,
I have created 3 states of object State1, State2, State 3. and want to highlight state in object state panel programmatically. can any one have idea abt it?@Priyanka – you did not mention a specific scripting language.
In ExtendScript (JavaScript) you can set the "active" property of the 3rd state of your MultiStateObject to value "true".
//ExtendScript (JavaScript) example
//Make sure a MultiStateObject is selected; nothing else, then run this JavaScript:
app.selection[0].states[2].active = true;
The expression from left to wright (for lurkers who never saw a line of code):
app => application (that's InDesign, of course)
selection => your current selection in the UI (could be one item, could be many)
[0] => index number 0 is the first item in your selection; be cautious with the expression "first", it depends on the InDesign version what that does exactly mean, if you selected more than one object
states => obviously the "state" object (always with the plural "s", it's the collection of all states in that selected MultiStateObject)
[2] => index number 2 is the 3rd element of the states collection
active => property for the active status; boolean, could be "true" or "false"
= => with the "=" sign, you are setting the value
true => the value of the property; self-explanatory, I hope…
; => end of expression, all that comes after is a different expression.
The different parts are held together with a dot-notation. The index is directly glued to its object, no dot notation between object and index.
If you want learn more about ExtendScript and the InDesign DOM see Jongwares' documentation at:
http://www.jongware.com/idjshelp.html
Uwe
Maybe you are looking for
-
I had to reformat my computer and the easiest way I had at the moment to save my photos was to just tranfer them to my phone. I guess I didn't realize that I wouldn't be able to transfer them back to my computer. I've never had an iPhone and my last
-
Problems with iPhoto and Aperture after installing Mavericks
I use iphoto 11, version 9.5 (902.7) and Aperture 3.5. both are dodgy since installing Mavericks - freezing, not allowing access while wheel spins, showing "Processing". I've re-installed both aperture and iphoto from the Apps store. No difference.
-
Remove title from clips in the sequence panel?
http://imgur.com/FkPhT (Where it says Kuruvi Dandana..etc) So there is more space for the video in the editing view. I don't need to be reminded of the title on the clip I'm using..
-
I have an iWeb blog that allows subscription through RSS. I've found that the RSS feed mixes up the photos and the blog entries (so the photo from one entry will end up being associated with a different entry). Sometimes the pictures are repeated, an
-
Why does this script behavior change with the phase of the moon ?
Can anyone from adobe corp or non-adobe volunteers tell me where to look in their docs to find out why this script change its behavior or how to use the debugger to figure out the same. I read the guide and the whole section on debugger and break poi