Multiple output-parameters in a custom component

Is it possible to develop a custom component that returns multiple outputs?
I know that I can define multiple tag <output-parameter> in component.xml, but I don't know how the method of my class can return multiple Objects...
Thanks,
Fabio

You can have multiple getters and setters function that will set or return multiple parameters. Each output parameter can be set to a specific function.
Jasmin

Similar Messages

  • How to view multiple output parameters from web services

    I have used the Labview tool to create a .NET assembly from a WSDL file.
    In the WSDL file the service has been defined to return 2 output parameters.
    In Labview, when I invoke the method for this service the first output parameter ends up as the return value of the method.  I can create an indicator for this and it gets updated properly when I run the VIS to use the web service..  The indicator is an integer value but recognizes the type defined within the WSDL file. 
    The second output parameter shows up as an output value.  When I right click on it and create an indicator for it I get a .NET icon on the front panel rather than an integer value. 
    How can I view the value for this second output parameter after running the web service?
    Is there a difference in how multiple output parameters handled in newer versions of Labview (I am using verison 7.1)?

    scrooge wrote:
    You can try this link .
    the link is dead... or i dont have access..

  • Handling Multiple Output Parameters

    Howdy.
    What is the concensus approach for handling multiple output parameters in Java?
    We have a legacy C API that we are porting to Java. All API routines already return an error value as an int. i.e.:
    int foo(...);
    What if we wanted to return additional info, such as a length and binary (not text) data?
    int foo(...,int* len,char** data);
    We use a char** for data cause we don't know in advance how long the data will be and we don't want callers to have to allocate arbitrary-sized arrays. In other words, we allocate the output data buffer internally.
    How do you do this in Java? Obviously, we can use an Integer object to return the length, but passing in a byte[] for data will not return the internally allocated array to the caller:
    public int foo(...,Integer len,byte[] data); // can't allocate data internally
    We also thought about using ByteArrayOutputStream, but since the class does not provide direct access to the internal array, it requires an inefficient copy through the toByteArray() method in order to retrieve our data.
    Any ideas?
    Ricardo

    Yes, that is the approach that we are currently
    using. We have defined an Out class that incorporates
    all possible output types as data members:Huh? One class that is used for all possible output types? I'm not quite sure what you mean by that. Classes should be meaningful in and of themselves, not just to encapsulate a bunch of unrelated fields. Sounds non-OO.
    public class Out
    byte[] out_bytes;
    int      out_int;
    }I guess we feel this is somewhat inelegant...
    The only real problem is with the byte[] arguments.
    Any thoughts on that?
    Thanks,
    RicardoThere's nothing inherently wrong with a byte array - else there may not be such an animal in the language. Other than the comments above about maybe it being non-OO, the only other comment I could make on this without really seeing the whole context (how this class is really used, etc) would be that yes it looks like it is just encapsulating all possible output types. Not good. If a method is going to return a byte array, it should do so - not return a meaningless "Out" object which happens to contain that array. And another method returning an int should return the int, not this "Out" object containing the int. These don't appear to be related fields belonging to an object in an OO sense.

  • How to allow multiple output parameters in a user-defined service operation???

    I have creating a self-defined service operation “LDAPAddUser” to connect to LDAP server to create user accounts. I want to get 2 output parameters after executing the operation. One is the result (Boolean data type) and one is the error message (String data type). However, since Java only support one return value in a method, it seems that only one output parameter can be returned. May I have the suggestion so that multiple parameters can be supported in this case? Here is the extracted code
    In Java program,
    public Boolean addUser(String url, String aName)
    In file "component.xml",
         <operation name="addUser" method="addUser" orchestrateable="true" anonymous-access="true">
      <hint>Add a new user</hint>
         <input-parameter name="url" type="java.lang.String" required="true" title="LDAP URL">
         </input-parameter>
              <input-parameter name="aName" type="java.lang.String" required="true" title="Admin Login Name">
         </input-parameter>
              <output-parameter name="Result" title="Result" type="java.lang.Boolean">
              </output-parameter>
    Besides the boolean return value, I want to get another return value (string data type). Any suggestion ?

    I've returned multiple values to LiveCycle by using a complex object as an intermediatory.
    For example if I need to return two strings (firstName and lastName), I'll first build a single class (name) with two string attributes (private String firstName; private String LastName) and add getters and setters to my "name" class for each.  My service class method will return an object of type "name".
    for example  public name mymethod(String GUID, String username, String password).......
    Then in the component.xml you can return the two strings as long as you use the binding type "Bean":
    <output-parameter name="firstName" title="First Name" binding-type="Bean" property="firstName">
                        </output-parameter>
    <output-parameter name="lastName" title="Last Name" binding-type="Bean" property="lastName">
                         </output-parameter>

  • Webservice with multiple output parameters

    As a follow up on Can't create Webservice Project question of mine I have another question.
    I have my webservice now, but only one output parameter. I can only find java-bean examples with just one. How do I get multiple of them.
    Groetjes,
    Jeschael

    Hi Jan,
    I've created a structure. It is a (non EJB) bean with 6 private Strings with getters and setters. I put it into a List (Vector to be precise). When I try to test it, using the Web Services Navigator, I get an error.
    The structure really is just a copy from a SAP-ABAP structure. It looks like this:
    Created on Feb 21, 2007
    To change the template for this generated file go to
    Window>Preferences>Java>Code Generation>Code and Comments
    package com.test.struc;
    import java.io.Serializable;
    @author JeschaelL
    To change the template for this generated type comment go to
    Window>Preferences>Java>Code Generation>Code and Comments
    public class Hrwpc_S_KeyObjec implements Serializable {
         public String PlanVersion;                    //plvar
         public String ObjectType;                    //otype
         public String ObjectID;                    //objid
         public String StartDate;                    //begda
         public String EndDate;                     //endda
         public String PlanningStatus;               //istat
         public String HistoricalRecordFlag;     //histo
         public String ObjectAbbreviation;          //short
         public String ObjectName;                    //stext
         public String ExtendedObjectID;          //realo
    @return
         public String getEndDate() {
              return EndDate;
    @return
         public String getExtendedObjectID() {
              return ExtendedObjectID;     }
    @return
         public String getHistoricalRecordFlag() {
              return HistoricalRecordFlag;
    @return
         public String getObjectAbbreviation() {
              return ObjectAbbreviation;
                   -- etcetera --
    Thanks for your time,
    Jeschael

  • Custom component: porting from lc 8.0 to lc 8.2

    hello
    i developed a java pojo custom component for lc 8.0, essentially it connected to a db and returned a complex object. Now the environment has been upgraded to lc 8.2 . I've loaded my processes (which include my custom component) on the new environment. When i start the process , my component reaches the finally block where i've logged the db connections closing. Immediatly after the system crushes with the following error(i haven't added the whole stack trace because its huge): 
    2009-04-10 13:11:21,422 WARN  [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@2ac6fb1
    2009-04-10 13:11:21,431 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract com.adobe.pof.GenericObject com.adobe.pof.omapi.POFObjectManagerLocal.writeObject(com.adobe.pof.GenericObject,com.ado be.idp.Context) throws com.adobe.pof.POFException, causedBy:
    org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 643401bb:6b45:49df1884:29cb status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 643401bb:6b45:49df1884:29cb status: ActionStatus.ABORT_ONLY >))
        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94 )
        at com.adobe.pof.ConnectionWrapper.getConnection(ConnectionWrapper.java:45)
        at com.adobe.pof.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:179)
        at com.adobe.pof.adapter.JDBCAdapter.prepareStatement(JDBCAdapter.java:5299)
    After that jboss get stucked, printing exceptions every 2 minutes, and i need to stop and restart it. I don't see anything wrong with my code: i get the datasource object, i get a coonettin from it, make my queries/updates and finally i close the connection.
    googling i've found this might be due to datasource item being local-tx-datasource instead of xa-datasource, but all datasources are of this kind.
    Any hint about this problem will be greatly appreciated
    thank you in advance
    Stefano

    hi Steve
    thank you for your answer. Unluckly i'm not using mysql but oracle 9i (or 10i i don't know since i'm just a poor programmer). Anyway i did a test : i've bypassed the datasource file , hardcoding the connection parameters in my custom component and it has got executed without problem, then process has crushed again on a query done by some adobe component. there are many adobe sql component instances to read/write from the same schema my compnent uses, so i suppose the problem is inside datasource configuration. There's a datasource sample for oracle too?
    I cannot give much details, since the new system has been recently installed and i don't know all info (i think jboss is 4.2 but i'm not sure)
    thanks again
    regards
    Stfano

  • Writing a custom component with multiple fields.

    Does anyone have some pointers on writing a custom component that properly handles multiple input fields?
    An example usage might be as follows:
    Assume the following java classes:
    public interface Address {
        //... getters/setters for Address.
    public class Company{
        Address getAddress(){...};
    }The tag usage might be something like the following:
    <custom:address value="#{myCompanyBean.address}" />
    Extending UIComponentBase I can easily render the output and create all the needed input elements. I'm also able to properly retrieve the submitted values in the decode method. But I'm unsure how to handle the "UpdateModelValues" step. Do I simply over-ride processUpdates, or is there more housekeeping to be done?
    Thanks.

    I'm guessing that doing addChild inside createChildren causes an infinite loop.
    Why aren't you just doing this with MXML?  it would be a lot simpler.

  • Adding Parameters (Inspectable) to a Custom Component?

    Hi --
    I am attempting to build a custom component just to learn a
    little more
    about AS 3.0. I can not figure out where / how in my package
    declarations I
    can "expose" parameters that will be visible to the user in
    the Flash IDE
    when using my component.
    Thanks
    Rich

    Hi Richard ,
    there is a pretty cool livedoc about component creation in as
    3 :
    http://www.adobe.com/devnet/flash/articles/creating_as3_components.html
    setting up the inspectables is the same as it was in as2
    i am doing it in my controller :
    [as]
    package mat3d.yugopReel {
    import flash.display.*;
    import flash.text.TextField;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import fl.core.InvalidationType;
    import fl.core.UIComponent;
    import fl.data.DataProvider;
    import fl.events.ComponentEvent;
    import fl.containers.UILoader;
    import mat3d.yugopReel.model.MainModel;
    public class ScrollReel extends UIComponent {
    public var dataProvider : DataProvider;
    public var RIG : Sprite;
    public var LeftBTN : Sprite;
    public var RightBTN : Sprite;
    public var myModel : mat3d.yugopReel.model.MainModel;
    private var _background : Sprite;
    private var _tf : TextField;
    public var _AutoScroll : Boolean;
    public var _StepControl : Boolean;
    private var _FileType : String;
    public var _File : String;
    private var _text : String;
    public var _ScrollInit : String;
    public var _StepBehaviour : String;
    public var _PictureSize : String;
    public var _ScrollTime : Number;
    public var abstand_x : Number = 90.3;
    public var abstand_y : Number = 125;
    public var ConfigData : Array;
    public function ScrollReel() {
    super();
    alpha = 0;
    myModel = new mat3d.yugopReel.model.MainModel(this);
    >> start get set INSPECTABLES
    AutoScroll start
    public function get AutoScroll() : Boolean {
    return _AutoScroll;
    myPropInit.AutoScroll = true;
    public function set AutoScroll(value : Boolean) : void {
    _AutoScroll = value;
    myPropInit.AutoScroll = true;
    [Inspectable(name="AutoScroll",defaultValue="false",type="Boolean")]
    AutoScroll end
    FileType start
    public function get FileType() : String {
    return _FileType;
    myPropInit.FileType = true;
    public function set FileType(value : String) : void {
    _FileType = value;
    myPropInit.FileType = true;
    [Inspectable(name="FileType",defaultValue="XML",type="String")]
    FileType end
    Filestart
    public function get File() : String {
    return _File;
    myPropInit.File = true;
    public function set File(value : String) : void {
    _File = value;
    myPropInit.File = true;
    init();
    [Inspectable(name="File",defaultValue="",type="String")]
    File end
    Width start
    public function get Width() : Number {
    return width;
    myPropInit.Width = true;
    public function set Width(value : Number) : void {
    width = value;
    //trace("setWidth >>>" + width);
    myPropInit.Width = true;
    [Inspectable(name="Width",defaultValue="250",type="Number")]
    Width end
    Height start
    public function get Height() : Number {
    return height;
    myPropInit.Height = true;
    public function set Height(value : Number) : void {
    height = value;
    trace("setHeight >>>" + height);
    myPropInit.Height = true;
    [Inspectable(name="Height",defaultValue="50",type="Number")]
    Height end
    ScrollTime start
    public function get ScrollTime() : Number {
    return _ScrollTime;
    myPropInit.ScrollTime = true;
    public function set ScrollTime(value : Number) : void {
    _ScrollTime = value;
    myPropInit.ScrollTime = true;
    [Inspectable(name="ScrollTime",defaultValue="0.2",type="Number")]
    ScrollTime end
    ScrollInit start
    public function get ScrollInit() : String {
    return _ScrollInit;
    myPropInit.ScrollInit = true;
    public function set ScrollInit(value : String) : void {
    _ScrollInit = value;
    myPropInit.ScrollInit = true;
    [Inspectable(name="ScrollInit",defaultValue="_x",type="String")]
    ScrollInit end
    PicSize start
    public function get PictureRatio() : String {
    return _PictureSize;
    myPropInit.PictureSize = true;
    public function set PictureRatio(value : String) : void {
    _PictureSize = value;
    myPropInit.PictureSize = true;
    [Inspectable(name="PictureSize",defaultValue="",type="String")]
    PictureSize end
    Step Controll start
    public function get StepControl() : Boolean {
    return _StepControl;
    myPropInit.StepControl = true;
    public function set StepControl(value : Boolean) : void {
    _StepControl = value;
    myPropInit.StepControl = true;
    [Inspectable(name="StepControl",defaultValue="false",type="Boolean")]
    Step Controll end
    Step Behaviour start
    public function get StepBehaviour() : String {
    return _StepBehaviour;
    myPropInit.StepBehaviour = true;
    public function set StepBehaviour(value : String) : void {
    _StepBehaviour = value;
    myPropInit.StepBehaviour = true;
    [Inspectable(name="StepBehaviour",defaultValue="easeInOutQuad",type="String")]
    Step Behaviour end
    DataProviderstart
    public function get DataProvider() : Object {
    return DataProvider;
    public function set DataProvider(value : Object) : void {
    DataProvider = value;
    myPropInit.StepBehaviour = true;
    [Inspectable(name="DataProvider",defaultValue="",type="Collection")]
    DataProvider end
    >> end get set INSPECTABLES
    private function init() : void {
    myModel .handleData();
    public override function toString() : String {
    return super.toString();
    [/as]
    bw
    matthias

  • How to include multiple image components into a single custom component???

    How to include multiple image components into a single custom component???

    Hi Marcel,
    an ABAP transaction can only run or at least be started on one single system. A portal transaction can be assigned using a URL. This doesn't need any logical component.
    Regards
    Andreas

  • Best practice question for implementing a custom component

    I'm implementing a custom component which renders multiple <input type="text" .../> controls as part of it. The examples I've seen that do something similar use the ResponseWriter to generate the markup "by hand" like:
         writer.startElement("input", component);
         writer.writeAttribute("type", "text", null);
         writer.writeAttribute("id", "foo", null);
         writer.writeAttribute("name", "foo", null);
         writer.writeAttribute("value", "hello", null);
         writer.writeAttribute("size", "20", null);
         writer.endElement("input");
    I don't know about anyone else, but I HATE having to write code that manufactures this stuff - seems to me that there are already classes that do this, so why not just use those? For example, the above could be replaced with:
         HtmlInputText textField = new HtmlInputText();
         textField.setId("foo");
         textField.setValue("hello");
         textField.setSize(20);
         // just to be safe, invoke both encodeBegin() and encodeEnd(),
         // though it seems like encodeEnd() actually does the work in this case,
         // but who knows if they might change it at some point
         textField.encodeBegin(context);
         textField.encodeEnd(context);
    So my question is, why does everyone seem to favor the former over the latter? Why not leverage objects that already do the (encoding) work for you?

    Got it!
    You JSP should have this:
    <h:panelGroup styleClass="jspPanel" id="jspPanel1"></h:panelGroup>
    And your code page ValueChangeListener/ActionListner should have this:
              if (findComponent(getForm1(),"myOutputText") == null)
                   FacesContext facesCtx = FacesContext.getCurrentInstance();
                   System.out.println("Adding component");
                   HtmlOutputText output =
                        (HtmlOutputText) facesCtx.getApplication().createComponent(
                             HtmlOutputText.COMPONENT_TYPE);
                   output.setId("myOutputText");
                   output.setValue("It works");
                   getJspPanel1().getChildren().add(output);          
                   System.out.println("Done");
                   DebugUtil.printTree(FacesContext.getCurrentInstance().getViewRoot(),System.out);
              else
                   System.out.println("component already added");
    I just have to figure out this IOException on the closed stream - probably has to do with [immidiate="true"].
    Thanks.
    [9/15/04 13:05:53:505 EDT] 6e436e43 SystemErr R java.io.IOException: Stream closed
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at java.lang.Throwable.<init>(Throwable.java)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at java.lang.Throwable.<init>(Throwable.java)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:294)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:424)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:452)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.faces.component.UIJspPanel$ChildrenListEx.add(UIJspPanel.java:114)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at pagecode.admin.Test.handleListbox1ValueChange(Test.java)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at java.lang.reflect.AccessibleObject.invokeImpl(Native Method)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:199)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at java.lang.reflect.Method.invoke(Method.java:252)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at javax.faces.component.UIInput.broadcast(UIInput.java:492)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:284)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:342)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
    [9/15/04 13:05:53:536 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
    [9/15/04 13:05:53:552 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
    [9/15/04 13:05:53:552 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [9/15/04 13:05:53:552 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
    [9/15/04 13:05:53:567 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    [9/15/04 13:05:53:567 EDT] 6e436e43 SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    [9/15/04 13:05:53:567 EDT] 6e436e43 SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
    [9/15/04 13:05:53:567 EDT] 6e436e43 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:435)
    [9/15/04 13:05:53:567 EDT] 6e436e43 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
    [9/15/04 13:05:56:146 EDT] 6e436e43 SystemOut O Done

  • Custom component property value handling at run time

    I would like to develop simple custom component which has three properties PROP1, PROP2 & RESULT . These parameters are bound to excel sheet cells as follows..
    cell A1 connected to PROP1
    cell A2 connected to PROP2 and
    cell A3 connected to RESULT.
    In excel A1 cell has excel formula set as =IF(A2<5,10,0).
    Custom component would be simple button display at runtime and on click of the same, I would like to perform following actions in sequence with N number of times.
    1. First push any random number to PROP2. (which is simple task, I believe)
    2. Pick new value of PROP1 which is changed due to existance of excel formula (+ using dispatchevent I could able to pass value to excel cell A2. But not able to read new value of PROP1+)
    3. check new PROP1 value equal to 10. If it is 10 then count it otherwise again push new random value to PROP2.
    4. Continue step 1 to 3 till N number of times. and finally
    4. Push number of counts for PROP1 value 10 to RESULT parameter.
    All the parameters are bindable (getter/setter with [Bindable]) in Flex component application and flex propertysheet application use binding ID to bind with cell address. with binding direction BOTH and SINGLETON
    Here is flex function code which triggered at button click.
    public function test002():void {
    while ( N < 100)
      this.PROP2 = Math.round(Math.random()*1000);
      dispatchEvent(new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE, false, false, PropertyChangeEventKind.UPDATE, "PROP2", null, PROP2, this));
         if (this.PROP1 == 10)
          cnt++;
       this.RESULT = cnt;
    My observations are as follows.
    - new push of value to PROP2 get reflected to excel A2 when button click event is over, not at the time of while loop process execution.
    - Also I observed PROP1 value never changes and it is the value which is recorded just before button click event of component at run time and remain the same till button click event is over.
    - Further to this I notice as click event is over, new value of PROP2 reflected in cell A2 and change value (if it passes IF formula of excel ) in A1 as well. Next button click action takes these new A1 and A2 values in consideration and process the function "test002".
    I would like to understand possibility of custom component event execution process, which can able to pass as well as read value from component parameters to underlying excel with changes due to excel formula existance.  If it is not limitations (If so) what is the set of commands which can be helpful to achieve this. I appreciate if anybody explain typical event execution required in such scenarios with some actionscript code directions.
    Thanks
    Sandesh
    Edited by: Sandesh Darne on Feb 8, 2010 11:48 AM
    Edited by: Sandesh Darne on Feb 10, 2010 5:23 AM

    Marton,
    I have tried your solution. It works well immediately after xcelsius dashboard get displayed or preview. It does not wait click event to happen. So I modified further by adding one switch ( "switch001" in code piece shown below) to control iteration by click event. That stops running of iteration immediate after dashboard display.
    In order to see iteration I have to click twice on button. First click does send "frm" parameter value to excel and excel formula operates. The excel formula result send back to component via SETTER of "frmResult" . But it stops over there. If I click second time the iteration starts for 100 times.
    Also I try to export this to PDF. PDF file get generated. If I try to open PDF file it raise error.
    My code is attached here.
    "frm" is the parameter that sends random number to excel.
    "frmResult" parameter receives excel formula output and send it back to component.
    "test()" function operate on button click event and set switch001 and then calls "Calc" function for iterations.
    MXML code..........
      <mx:VBox>
           <mx:TextInput id="frmResultLabel" width="100" />
           <mx:Button label="test..." click="test()"/>
      </mx:VBox>
    Actionscript code
    public var cnt:int;
              public var N:int = 0;
              public var sum:int = 0;
              public var switch001:Boolean = false;
             public function test():void {
                   N = 0;
                   sum = 0;
                   switch001 = true;
              public function Calc():void {
              if (switch001 == true)
                if (N < 100)
                    this.frm = Math.round(Math.random() * 1000);
                else if (N == 100)  // return the result
                     this.frmResult = sum;
                     // Label component use to display frm and frmResult values at runtime
                     frmResultLabel.text = sum.toString() + ">" + this.frm + ">" + this.frmResult;
                 N++;
              [Bindable]
              private var _frm:int;
              private var _frmChanged:Boolean = true;
              [Bindable]
              public function get frm():int
                   return _frm;
              public function set frm(value:int):void
                   //if (value == null)  value = 0;
                   if (_frm != value)
                        _frm = value;
                        _frmChanged = true;
                        invalidateProperties();
              override protected function commitProperties():void
                 super.commitProperties();
                 if (_frmResultChanged == true)
                        // start the cycle again by generating a new random number,
                        // or write out the result
                        Calc();

  • Can I define a constructor for a Custom Component?

    I have a custom component which I instantiate through ActionScript.  For the sake of clean code, I would like to be able to assign the variables through the constructor like any other class:
    var myComp:CustomComponent = new CustomComponent(arg1, arg2, ...);
    However, when I try to write a constructor in the Script block for the component, it gives me a compile error telling me that I have multiple constructors:
    //In Script tag//
    public function CustomeComponent(arg1, arg2 ...):void { ... }
    Are we not able to define constructors for Custom Components?

    If this post helps, please mark it as such.
    If you create an array variable in your MXML component, and then set it with myVar="[val1, val2, val3]" in the opening tag of your component, then you basically have a constructor in MXML.
    You can use the [Bindable] metadata tag in three places:
    Before a public class definition.
    The [Bindable] metadata tag makes usable as the source of a binding expression all public properties that you defined as variables, and all public properties that are defined by using both a setter and a getter method. In this case, [Bindable] takes no parameters, as the following example shows:
    [Bindable]
    public class TextAreaFontControl extends TextArea {}
    The Flex compiler automatically generates an event named propertyChange, of type PropertyChangeEvent, for all public properties so that the properties can be used as the source of a data binding expression.
    If the property value remains the same on a write, Flex does not dispatch the event or update the property, where not the same translates to the following test:
    (oldValue !== value)
    That means if a property contains a reference to an object, and that reference is modified to reference a different but equivalent object, the binding is triggered. If the property is not modified, but the object that it points to changes internally, the binding is not triggered.
    Note: When you use the [Bindable] metadata tag before a public class definition, it only applies to public properties; it does not apply to private or protected properties, or to properties defined in any other namespace. You must insert the [Bindable] metadata tag before a nonpublic property to make it usable as the source for a data binding expression.
    Before a public, protected, or private property defined as a variable to make that specific property support binding.
    The tag can have the following forms:
    [Bindable]
    public var foo:String;
    The Flex compiler automatically generates an event named propertyChange, of type PropertyChangeEvent, for the property. If the property value remains the same on a write, Flex does not dispatch the event or update the property.
    You can also specify the event name, as the following example shows:
    [Bindable(event="fooChanged")]
    public var foo:String;
    In this case, you are responsible for generating and dispatching the event, typically as part of some other method of your class. You can specify a [Bindable] tag that includes the event specification if you want to name the event, even when you already specified the [Bindable] tag at the class level.
    Before a public, protected, or private property defined by a getter or setter method.
    You must define both a setter and a getter method to use the [Bindable] tag with the property. If you define just a setter method, you create a write-only property that you cannot use as the source of a data-binding expression. If you define just a getter method, you create a read-only property that you can use as the source of a data-binding expression without inserting the [Bindable] metadata tag. This is similar to the way that you can use a variable, defined by using the const keyword, as the source for a data binding expression.
    The tag can have the following forms:
    As far as binding, you can add the [Bindable] tag before the class declaration to make bindable all public properties defined as variables, and all public properties defined by using both a setter and a getter method.

  • Button in custom component not showing

    I made a very simple custom component with a TextField and Button but when I add multiple instances of it to a Layout, only the first Button shows up while the other show only when I focus the corresponding TextField. I'm quite new to fx and I'm not sure I did everything correctly but I don't see any obvious error in my code.
    The component:
    public class TestComponent extends BorderPane {
        @FXML
        private Button browseButton;
        @FXML
        private TextField textField;
        public TestComponent() {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("TestComponent.fxml"));
            fxmlLoader.setRoot(this);
            fxmlLoader.setController(this);
            try {
                fxmlLoader.load();
            } catch (IOException exception) {
                throw new RuntimeException(exception);
    The fxml
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.HBox?>
    <fx:root type="javafx.scene.layout.BorderPane" xmlns:fx="http://javafx.com/fxml/1"
        xmlns="http://javafx.com/javafx/2.2">
        <center>
            <TextField fx:id="textField" prefWidth="200.0" />
        </center>
        <right>
            <Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"
                minHeight="-Infinity" prefHeight="${textField.height}" text="Browse"
                textAlignment="CENTER"  />
        </right>
    </fx:root>
    and the test code
    @Override
        public void start(Stage primaryStage) {
            VBox box = new VBox(5);
            box.setPadding(new Insets(5));
            TestComponent a = new TestComponent();
            TestComponent b = new TestComponent();
            TestComponent c = new TestComponent();
            box.getChildren().addAll(a, b, c);
            Scene scene = new Scene(box);
            primaryStage.setScene(scene);
            primaryStage.show();
    I'm running on Ubuntu with jdk-8-ea-bin-b111-linux-i586-10_oct_2013. I tested with jdk 1.7.0_40 and the buttons don't show.
    I'd include screenshots but the button to add images is disabled.
    Thanks for the help

    The issue is with the bind definition in the FXML, if you remove that definition, the buttons will display.
       prefHeight="${textField.height}"
    I think the binding is working, but when there is some kind of error (bug) in the layout process such that the scene is not automatically laid out correctly when the binding occurs.
    You can get exactly the same behaviour by removing the binding definition in FXML and placing it in code after the load.
                browseButton.prefHeightProperty().bind(textField.heightProperty());
    When the scene is initially displayed, the height of all of the text fields is 0, as they have not been laid out yet, and the browser button prefHeight gets set to 0 through the binding.
    That's OK and expected.
    Then the scene is shown and a layout pass occurs, which sets the height of the text fields to 26 and the prefHeight of all of the browser buttons adjust correctly.
    That's also OK and expected.
    Next the height of one of the buttons is adjusted via a layout pass.
    That's also OK and expected.
    But the height of the other buttons is not adjusted to match their preferred height (probably because a layout pass is not run on them).
    That is not OK and not expected (and I think a bug).
    If you manually trigger a layout pass on one of the components which did not render completely, the button will be displayed - but that should not be necessary.
    You can file a bug against the Runtime project at:
       https://javafx-jira.kenai.com/
    You will need to sign up at the link on the login page, but anybody can sign up and log a bug.
    Here is some sample code.
    import javafx.application.Application;
    import javafx.geometry.Insets;
    import javafx.scene.Scene;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ComponentTestApp extends Application {
      @Override
      public void start(Stage primaryStage) {
        VBox box = new VBox(5);
        box.setPadding(new Insets(5));
        TestComponent a = new TestComponent();
        TestComponent b = new TestComponent();
        TestComponent c = new TestComponent();
        box.getChildren().addAll(a, b, c);
        Scene scene = new Scene(box);
        primaryStage.setScene(scene);
        primaryStage.show();
        b.requestLayout(); // I don't understand why this call is necessary -> looks like a bug to me . . .
      public static void main(String[] args) {
        launch(args);
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.fxml.FXML;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.control.Button;
    import javafx.scene.control.TextField;
    import javafx.scene.layout.BorderPane;
    import java.io.IOException;
    public class TestComponent extends BorderPane {
        private static int nextComponentNum = 1;
        private final int componentNum = nextComponentNum;
        @FXML
        private TextField textField;
        @FXML
        private Button browseButton;
        public TestComponent() {
          nextComponentNum++;
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("TestComponent.fxml"));
            fxmlLoader.setRoot(this); 
            fxmlLoader.setController(this); 
            try { 
                fxmlLoader.load();
                browseButton.prefHeightProperty().bind(textField.heightProperty());
                System.out.println(componentNum + " " + browseButton + " prefHeight " + browseButton.getPrefHeight());
                textField.heightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + textField + " height " + newValue);
                browseButton.prefHeightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + browseButton + " prefHeight " + newValue);
                browseButton.heightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + browseButton + " height " + newValue);
                    new Exception("Not a real exception - just a debugging stack trace").printStackTrace();
            } catch (IOException exception) {
                throw new RuntimeException(exception); 
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.HBox?>
    <fx:root type="javafx.scene.layout.BorderPane" xmlns:fx="http://javafx.com/fxml/1"
             xmlns="http://javafx.com/javafx/2.2">
        <center>
            <TextField fx:id="textField" prefWidth="200.0" />
        </center>
        <right>
            <Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"
                    minHeight="-Infinity" text="Browse"
                    textAlignment="CENTER"  />
            <!--<Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"-->
                    <!--minHeight="-Infinity" prefHeight="${textField.height}" text="Browse"-->
                    <!--textAlignment="CENTER"  />-->
        </right>
    </fx:root>
    Here is the output of the sample code:
    1 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    2 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    3 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    1 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    1 TextField[id=textField, styleClass=text-input text-field] height 26.0
    2 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    2 TextField[id=textField, styleClass=text-input text-field] height 26.0
    3 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    3 TextField[id=textField, styleClass=text-input text-field] height 26.0
    2 Button[id=browseButton, styleClass=button]'Browse' height 26.0
    java.lang.Exception: Not a real exception - just a debugging stack trace
      at testcomponent.TestComponent$3.changed(TestComponent.java:69)
      at testcomponent.TestComponent$3.changed(TestComponent.java:65)
      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:347)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.beans.property.ReadOnlyDoubleWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:177)
      at javafx.beans.property.ReadOnlyDoubleWrapper.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:143)
      at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
      at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:146)
      at javafx.scene.layout.Region.setHeight(Region.java:915)
      at javafx.scene.layout.Region.resize(Region.java:1362)
      at javafx.scene.layout.BorderPane.layoutChildren(BorderPane.java:583)
      at javafx.scene.Parent.layout(Parent.java:1063)
      at javafx.scene.Parent.layout(Parent.java:1069)
      at javafx.scene.Scene.doLayoutPass(Scene.java:564)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2341)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:329)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:479)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
      at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    java.lang.Exception: Not a real exception - just a debugging stack trace
      at testcomponent.TestComponent$3.changed(TestComponent.java:69)
      at testcomponent.TestComponent$3.changed(TestComponent.java:65)
      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:347)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.beans.property.ReadOnlyDoubleWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:177)
      at javafx.beans.property.ReadOnlyDoubleWrapper.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:143)
      at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
      at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:146)
      at javafx.scene.layout.Region.setHeight(Region.java:915)
      at javafx.scene.layout.Region.resize(Region.java:1362)
      at javafx.scene.layout.BorderPane.layoutChildren(BorderPane.java:583)
      at javafx.scene.Parent.layout(Parent.java:1063)
      at javafx.scene.Parent.layout(Parent.java:1069)
      at javafx.scene.Scene.doLayoutPass(Scene.java:564)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2341)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:329)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:479)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
      at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    1 Button[id=browseButton, styleClass=button]'Browse' height 26.0

  • Clarifications on Custom component in adobe LC

    Hi,
    I am new to custom component. I just know when a desired result is not provided by stadard activities by adobe lc then we need to create custom components.
    1.Could anyone post me a small sample.
    2.How to use it in adobe lc as acitivity to get desired result.
    3.I have used invoke web services activity to get the result but what is other way to build a custom component.
    4.if i have a java class. which accept input parameters and results into some output. How do i use this java class as custom object.
    if possible please post study material on this.
    thanks in advance
    regards
    Sunil Gupta

    My first bit of advice would be to get the DSC development plugin from Labs.  It will make your development and deployment much easier
    http://labs.adobe.com/technologies/lcwcdtool/
    The official documentation is pretty good around DSCs:
    http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001404.html
    I wrote a couple of articles on DSC development ages ago.  Its a bit out of date (before the tooling was available) but it may help you with the basics:
    http://www.adobe.com/devnet/livecycle/articles/dsc_development.html
    http://www.adobe.com/devnet-archive/livecycle/articles/dsc_development_pt2.html

  • Custom component composed of other components

    Hello.
    I have a form (long, but simple) that is reused a few times across my applicaition. It would be great if I could package it as a JSF component. But I see no obvious way to create an UIComponent composed of other UIComponents.
    Are UIComponents really meant to be written from scrach, each parsing it's own request parameters and outputting raw html? Am I missing something?
    Thanks.

    Thanks for the quick reply, but I'm still stuck...
    How do I go about writing a composite custom
    component? Instanciating all sub components and
    delegating encoding and decoding to each? That's the road I try to take first.
    - Construct a SMALL test-bed application to develop your component.
    - consider implementing the naming container interface if you add components as children
    - consider acquiring "JSF in Action" from Kito Mann, it's the book with most samples for component building
    - announce "absences" to your family. It takes longer than you think beforehand ;-)
    - If your servlet-container starts up in less than 10 seconds it's better...
    I'm afraid to be asking too much, but does anyone
    know where can I find an example of this? I'm
    currently browsinng the MyFaces code, but so far
    whithout much luck....Well the myfaces code is the second best source after JSF in action and then there are a few tutorials on the net... time to surf to google and http://www.jsftutorials.net/
    hope this helps
    Alexander

Maybe you are looking for

  • How can I delete a music file directly from iPhone? Or not possible?

    Can I delete a music file directly from iPhone?

  • How to change the language in General on the software?

    Recently just purchased the software from the Apple store, however, due to my existing in Saudi Arabia and upon my account was created in Saudi's basis terms and conditions. I came to realize after the installation completed, the interface of the sof

  • WRE54G Cannot route traffic

    Hi all, My WRE54G version 2 cannot route the WIFI traffic to my Belkin router after setup. The setup was made by connecting the WRE54G directly to Belkin router with the following configurations with the Web configuration tool in WRE54G. WRE54G Name:

  • How do styles get translated from Pages for iPad to/from Word?

    I can't seem to get the styles of Pages on the iPad and Word 2004 on the Mac to match up. Can anyone offer advice? When I import a Word doc to the iPad, the Normal style does not get converted to a specific Pages style; the Style box in the ruler rem

  • Phone is grayed out

    my new iphone 5 is grayed out alot.but when it does work the network takes a while to show up.aswell as this the wifi keeps dropping on phone.im wondering if it is a hardware problem?i have reset network settings and restored phone alot etc...