Programmatically set clientAttribute

Hello
I know that if you want to pass a value to a JS function, you set af:clientAttribute to a component, and then retrieve the value in JS using component.getProperty(...);
I want to add the value of this attribute programmatically, but the only method I see is setClientAttributes(java.util.Set); This the javadoc it is written: "Sets a set of client attribute names. "
So only the name of the attributes can be set, but how can I set the value ?
Thanks
agruev
Edited by: a.gruev on Oct 27, 2009 11:06 AM

Thank Arun for the quick reply
I didn't try your solution because I just found a working one (thanks to a post Enabling Drag & Drop in RichPanelGroupLayout )
                RichCommandToolbarButton rctb = (RichCommandToolbarButton)button;
                java.util.Set<String> clientAttributes = rctb.getClientAttributes();
                if (clientAttributes == null)
                    clientAttributes = new java.util.HashSet<String>(3);
                    rctb.setClientAttributes(clientAttributes);
                clientAttributes.add("tableID");
                rctb.getAttributes().put("tableID", tableID);Edited by: a.gruev on Oct 27, 2009 11:41 AM

Similar Messages

  • Trying to programmatically set the data-source for a Crystal reports report.

    I've got the following existing procedure that I need to add to in order to programmatically set the data-source (server, database, username, and password) for a Crystal reports report.
     I added the connectionInfo parts, but can’t figure out how to attach this to the existing
    this._report object.
    This is currently getting the connection data from the report file, but I now need to populate this connection data from a 'config.xml' text file.
    Am I trying to do this all wrong?
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using CrystalDecisions.CrystalReports.Engine;
    using WGS.Reports.Reports;
    using CrystalDecisions.Shared;
    using WGS.Reports.Forms;
    namespace WGS.Reports
    public class ReportService
    ReportClass _report;
    ParameterFields paramFields;
    ConnectionInfo connectionInfo; // <- I added this
    public ReportService()
    public void DisplayReport(string reportName, int allocationNo)
    if (reportName.ToLower() == "allocationexceptions")
    this._report = new AllocationExceptions();
    PrepareConnection(); // <- I added this
    PrepareAllocationExceptionReport(allocationNo);
    this.DisplayReport();
    private void PrepareConnection() // <- I added this
    //test - these will come from the config.xml file
    this.connectionInfo = new ConnectionInfo();
    this.connectionInfo.ServerName = "testserv\\test";
    this.connectionInfo.DatabaseName = "testdb";
    this.connectionInfo.UserID = "testuser";
    this.connectionInfo.Password = "test";
    this.connectionInfo.Type = ConnectionInfoType.SQL;
    private void PrepareAllocationExceptionReport(int allocationNo)
    this.paramFields = new ParameterFields();
    this.paramFields.Clear();
    ParameterField paramField = new ParameterField { ParameterFieldName = "@AllocationNo" };
    ParameterDiscreteValue discreteVal = new ParameterDiscreteValue { Value = allocationNo };
    paramField.CurrentValues.Add(discreteVal);
    paramFields.Add(paramField);
    private void DisplayReport()
    frmReportViewer showReport = new frmReportViewer();
    showReport.ReportViewer.ReportSource = this._report;
    showReport.ReportViewer.ParameterFieldInfo = paramFields;
    showReport.ShowDialog();
    showReport.Dispose();
    Any help would be much appreciated.

    Hi Garry,
    Please post SAP Crystal Reports questions in their own forums here:
    SAP Crystal Reports, version for Visual Studio
    We don't provide support for this control now. Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to programmatically set initial password when a user is created in OID

    We are using the odihragent synchronization process to automatically create users in OID when an employee record is created. We would like to set the initial password for the newly created user to their last name + the last 4 digits of their SSN.
    The odihragent process is successfully creating the user in OID and populates the last name and the last 4 digits of the SSN in OID. According to an open SR I have with Oracle, we cannot use the odihragent process to set the initial password because any time the employee record is updated, the synchronization process will reset the password to last name + SSN. They have recommended that we use a pl/sql plug-in to set the password using the WHEN_ADD plug-in procedure.
    I am new to using OID and plug-ins and the examples provided in the Developer's Guide are limited.
    I would like to know if anyone else is using plug-ins or another process to set initial passwords when a user is created? If you are using plug-ins would you be willing to share a code sample?

    I am surprised that I have not received any responses... Surely there are others who are experienced with programmatically setting passwords when new users are programmatically created. Does anyone have any pointers on how to best accomplish this?

  • How to programmatically set an error message for a validation rule of an EO

    Hello,
    Is there a way to programmatically set an error message when validating any data on an EO?
    It seems the API of the EO interface does not have any method to be defined for my needs..
    thanks

    The other option is that for the error message you can define a groovy expression to call an EO method.
    I documented this on my blog
    http://blogs.oracle.com/grantronald/entry/dynamic_error_messages_from_a
    Regards
    Grant

  • I've got an error when trying to programmatically set a CrystalReports data-source

    I've got the following existing process that I needed to add to in order to programmatically set the data-source (server, database, username, and password) from a config.xml file.
    I added the ‘addDBConnection’ and ‘searchConfig’ parts, and this seems to be updating the existing this._report object, but I’m getting the following error and can’t figure out what is happening.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;
    using CrystalDecisions.CrystalReports.Engine;
    using WGS.Reports.Reports;
    using CrystalDecisions.Shared;
    using WGS.Reports.Forms;
    namespace WGS.Reports
        public class ReportService
            ReportClass _report;
            ParameterFields paramFields;
            public ReportService()
            public void DisplayReport(string reportName, int allocationNo)  
                if (reportName.ToLower() == "allocationexceptions")
                    this._report = new AllocationExceptions();
                    addDBConnection(this._report);
                    PrepareAllocationExceptionReport(allocationNo);
                    this.DisplayReport();
            private void addDBConnection(ReportDocument report)
                //Get connection parameters from config.xml file
                string servername = searchConfig("SERVER");
                string databasename = searchConfig("CATALOG");
                string userid = searchConfig("USER");
                string password = searchConfig("PASSWORD");
                //Loop through each table in the Report and subReports, and apply the new login information
                foreach (Table cTable in report.Database.Tables)
                    TableLogOnInfo loi = cTable.LogOnInfo;
                    loi.ConnectionInfo.ServerName = servername;
                    loi.ConnectionInfo.DatabaseName = databasename;
                    loi.ConnectionInfo.UserID = userid;
                    loi.ConnectionInfo.Password = password;
                    cTable.ApplyLogOnInfo(loi);
                foreach (ReportDocument subReport in report.Subreports)
                    foreach (Table cTable in subReport.Database.Tables)
                        TableLogOnInfo loi = cTable.LogOnInfo;
                        loi.ConnectionInfo.ServerName = servername;
                        loi.ConnectionInfo.DatabaseName = databasename;
                        loi.ConnectionInfo.UserID = userid;
                        loi.ConnectionInfo.Password = password;
                        cTable.ApplyLogOnInfo(loi);
            private void PrepareAllocationExceptionReport(int allocationNo)
                this.paramFields = new ParameterFields();
                this.paramFields.Clear();
                ParameterField paramField = new ParameterField { ParameterFieldName = "@AllocationNo" };
                ParameterDiscreteValue discreteVal = new ParameterDiscreteValue { Value = allocationNo };
                paramField.CurrentValues.Add(discreteVal);
                paramFields.Add(paramField);
            private void DisplayReport()
                frmReportViewer showReport = new frmReportViewer();
                showReport.ReportViewer.ReportSource = this._report;
                showReport.ReportViewer.ParameterFieldInfo = paramFields;
                showReport.ShowDialog();
                showReport.Dispose();
            private string searchConfig(string searchText)
                XDocument doc = XDocument.Load("Config.xml");
                string returnValue = "";
                var list = from x in doc.Descendants("param")
                           select new
                               Item = x.Descendants("item").First().Value,
                               Value = x.Descendants("value").First().Value
                foreach (var item in list)
                    if (item.Item == searchText) returnValue =item.Value;
                    //Console.WriteLine("Item ({0}) has a value of {1}", item.Item, item.Value);
                return returnValue;
    Am I trying to do this wrong, or do I need to do more to add the correct connection information?
    Any help would be very much appreciated.

    The code looks good - as long as the variables are correct. (You may want to consider hard coding the logon values as part of your troubleshooting steps).
    Database Vendor Codes are passed by the DB client through the report engine unmodified. E.g.; look at your database documentation for the error. I did not find anything googling the error, so do check the db docs.
    If that does not help, let us know the following:
    Does the report work in the designer?
    What version of CR? Including any Service Packs applied.
    What version of .NET?
    What database?
    How are you connecting to the database? (32 or 64 bit?)
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Looking for a way to programmatically set the visible portion of the front panel when a subVI opens

    I am looking for a way to programmatically set the visible portion of the front panel when a subVI opens.  Haven't found any posts that relate, but I'm not sure how to ask the right question.  To be clear, I want to write a helper VI to go through a list of subVIs to make sure the background images are all in the same place when their respective subVIs open.  I hate manually playing with scroll bars before I save each of the VIs...  I'm figuring I need to find the top/left location of the background image (know how to do this already) and then set a VI FP property to  these values or some offset, but I can't find the relevant property. FP:run-timeposition:custom looked promissing, but only affects the location of the window, not the area of the front panel the window is displaying.
    Solved!
    Go to Solution.

    Cool.  Getting closer.  The way I implemented your suggestion affects the subVI only if it is open.  I can use this to do what I'm after, perhaps putting the code into each subVI.  Maybe open all subs, run the helper, and save.    Seems like I'm missing the elegant version...
    My proof of concept code:

  • How to programmatically set the real-time CVI startup DLL?

    Dear NI Support Engineer:
    I'm part of a team of software engineers working on a real-time aerospace app at Honeywell (Coon Rapids, MN campus).  We're using LabWindows/CVI 9.0 and three LabView 8.6 real-time modules.
    Up until now, we've been using the CVI debugger to launch our real-time apps or just copying the app DLL to C:\ni-rt\cvi on the real-time box and setting it as the default startup DLL.
    What we need to do now is create our own directory structure at the root of C: on the real-time box (which, by the way, is using the Reliant file system).
    In fact, we have created directory ug7500 at the root of C: on the realtime box, and two subdirectories (one for data and one for results) directly under directory ug7500.  We'd like to place all of our app DLLs in the ug7500 directory and have the ability to change the default startup DLL programmatically.
    We've been using your LabWindows/CVI Real-time File Copy Utility to set the startup DLL whenever we're not using the debugger.  That was just fine for the first stage of our development.
    At this stage, however, we need be able to set the startup DLL programmatically.  We have not been able to find out how to do this from reading the real-time module documentation.
    Can you either point us at some documentation on programmatically setting the default startup DLL, or e-mail us the instructions, or give us a phone call and explain what steps we must take.
    Thank you very much.
    Vic
    763-957-4168

    Hello All,
    For the reference of anyone else trying to do this, you can modify the INI file to change the startup DLL. Using the INI instrument that ships with CVI (C:\Program Files\National Instruments\CVI90\toolslib\toolbox), you can find the StartupDLLs tag and replace the last value with your startup DLL, such as:
    #include "inifile.h"
    #include <cvirte.h>
    static int status;
    static IniText myINIFile;
    int main (int argc, char *argv[])
     if (InitCVIRTE (0, argv, 0) == 0)
      return -1;    /* out of memory */
     myINIFile = Ini_New (0);
     status = Ini_ReadFromFile (myINIFile, "c:\\ni-rt.ini");
     status = Ini_PutRawString (myINIFile, "LVRT", "StartupDLLs", "c:\\NI-RT\\system\\cvi_lvrt.dll;c:\\ni-rt\\system\\nidevldp.dll;nisysapirpc.dll;niorbp.dll;c:\\ni-rt\\system\\mxsemb.dll;c:\\ni-rt\\system\\nipxism.dll;c:\\NI-RT\\cvi\\myStartup.dll;");
     status = Ini_WriteToFile (myINIFile, "c:\\ni-rt.ini");
     return 0;
    Right now, there are some caveates with using CVI 9.0 to manipulate an INI file to be used on an RT target. The INI functions currently add line breaks automatically for large tag values and adds quotes around the values. For many INI files this is ok (such as TestStand INI files), but it will not work on an RT target. To remove these features, modify the following lines of the inifile.c file located in the same directory as the INI instrument:
    1. On line 38, change the default value of INI_NUM_CHARS_PER_LINE from 80 to a large number such as 8000.
    2. Comment out line 953 (newEntry->addMarkerQuotes = addMarkerQuotes;
    Now you should be able to programmatically change the INI file of your target machine and, therefore, change the startup DLLs.

  • How to Programmatically Set the limit (max, min input) of a control inside a cluster?

    I want to programmatically set the limit (max, min input) of a control inside a cluster. (see attached VI).
    The max, min value will be read from a file. The input of the control must be within the range defined by the max and min value.
    Can anyone tell me how to do it?
    Thanks a lot for your kind help.
    Xiaogang

    Accessing the properties of a cluster (or array) is not a trivial operation until you have done it once. It's a two step (at least) process : first, ask for a reference (array of...) to the objects contained in the cluster, then tell LV what kind of object you are adressing.
    See the attachment.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    How to set limit[1].vi ‏52 KB

  • How to programmatically set the Visibility of an Iview INVISIBLE ?

    Hi ..... I need to programmatically set the visibility of an IView for a user Invisible - In order to achieve that , I am trying the below code....But getting errors-
    Code -
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sapportals.portal.pcd.gl.PcdInitialContextFactory");
                 env.put("com.sap.portal.jndi.requested_aspect","com.sap.portal.pcd.gl.PersistencyAspect");
    env.put("java.naming.factory.object", "__IPcdContext__");
    InitialContext iCtx = null;
    String iViewID = "pcd:portal_content/ABC/1Portal/mywork/iviews/XYA_iViews/adf.ivw_ess_jspdynpage";
                 iCtx = new InitialContext(env);
                 IiView result =(IiView)iCtx.lookup(iViewID);     
                 IiViews iViewSrv = (IiViews)PortalRuntime.getRuntimeResources().getService(IiViews.KEY);
    INewObjectDescriptor IVtoCreate =(INewObjectDescriptor) iViewSrv.instantiateDescriptor(CreateMethod.NEW,"par:/applications/com.sap.km.cm/components/navigation",request.getUser());
    IVtoCreate.putAttribute("com.sap.portal.navigation.invisible", true);
    the above method putAttribute is not apllicablt for (String,Boolean)\
    Please suggest as to how can I programmatically set an Iview Visible/Invisible .

    I think the property is com.sap.portal.navigation.Invisible with a capital I for invisible...
    This blog has an example: Hiding portal role content with a simple iView

  • How to programmatically set formatted javascript dates for validation?

    How does one programmatically set formatted javascript dates for validation?
    "12/31/2011" does not seem to work?

    ourDate.rawValue = "2011-12-31";  // works
    NOTE:  if you have a hierarchy issue you may need something like
    root.body.table.detail.ourDate.rawValue = "2011-12-31";

  • Programmatically setting user principal

    Hi,
    Is there any way through which we can programmatically set the user principal with the OC4J container in 9.0.3 (or above) ?
    In other words, given a user name and password, is there any public API through which an application provider can set the user principal in the J2EE container at the Web/EJB tier ?
    Thanks,
    Krishnendu

    I have the same issue. If I check regional settings for a user via /_layouts/regionalsetng.aspx?Type=User I can view and update e.g. Timezone.
    If I retrieve the same user via Powershell from SPSite.RootWeb.SiteUsers and check regional settings there they will not match. I can update them successfully and it will actually be reflected in SharePoint
    but if I instantiate a new SPSite object and retrieve the user again the regional settings will not have changed. E.g.:
    $site = Get-SPSite http://some.sitecollection.url
    $web = $site.RootWeb
    $users = $web.SiteUsers
    $user = $users | where { $_.UserLogin -like "DOMAIN\someusername*" }
    $regSettings = new-object Microsoft.SharePoint.SPRegionalSettings($web, $true);
    $regSettings.TimeZone.ID = 10
    $user.RegionalSettings = $regSettings
    $user.Update()
    This above does as expected and is changed when viewed with SharePoint.
    But if I go ahead and run the first four lines again I don't get the same regionalsettings value I set but rather the default.
    Any ideas?

  • Need to Programmatically Set IRR Filter on Date Field Due to APEX 4.1 Bug

    There may be another work around but, here is the problem that we are encountering...
    We have a huge table that is partitioned on a DATE field and an IRR that reports on this table. By default, we want to show the most recent 3 days of data. There is a built-in filter for "is in the last 3 Days." Sounds Great! Unfortunately APEX generates the code using TIMESTAMP rather than DATE functions. As a result of this, the query does not perform partition pruning and, as a consequence, it is doing a full table scan which takes forever. Note the use of the "LOCALTIMESTAMP" function in the query that is generated by APEX for this filter:
    SELECT   "BUSINESS_DATE",
             COUNT ( * ) OVER () AS apxws_row_cnt
      FROM   (SELECT   *
                FROM   (SELECT   *
                          FROM   position_delta_his p) r
               WHERE   ("BUSINESS_DATE" BETWEEN *LOCALTIMESTAMP*
                                                - NUMTOYMINTERVAL (:APXWS_EXPR_1,
                                                                   'year')
                                            AND  *LOCALTIMESTAMP*)) r
    WHERE   ROWNUM <= TO_NUMBER (:APXWS_MAX_ROW_CNT)If, instead, APEX used the SYSDATE function, as the underlying column is a DATE, this returns instantly, after partition pruning.
    SELECT   "BUSINESS_DATE",
             COUNT ( * ) OVER () AS apxws_row_cnt
      FROM   (SELECT   *
                FROM   (SELECT   *
                          FROM   position_delta_his p) r
               WHERE   ("BUSINESS_DATE" BETWEEN *SYSDATE*
                                                - NUMTOYMINTERVAL (:APXWS_EXPR_1,
                                                                   'year')
                                            AND  *SYSDATE*)) r
    WHERE   ROWNUM <= TO_NUMBER (:APXWS_MAX_ROW_CNT)
    The bug is that APEX should base the underlying function on the data type of the filtered column.
    As a work around, if we create a filter where BUSINESS_DATE >= '4/13/2012' (three business days ago), again, this returns instantaneously. The issue is that we can only set this filter by using the APEX GUI. We need to be able to:
    1. Determine the date for 3 business days ago
    2. Set this as the default filter.
    I tried creating a BEFORE HEADER PL/SQL page process but, it does not appear to be having any effect. Here is that code:
    DECLARE
        ldt_Filter DATE;
        CURSOR lcsr_GetMaxBusinessDate IS
            SELECT Max(BUSINESS_DATE)
            FROM POSITION_DELTA_HIS;
        DAYS_AGO CONSTANT NUMBER := 3;       
    BEGIN
        APEX_UTIL.IR_CLEAR( :APP_PAGE_ID );
        OPEN lcsr_GetMaxBusinessDate;
        FETCH lcsr_GetMaxBusinessDate INTO ldt_Filter;
        CLOSE lcsr_GetMaxBusinessDate;
        ldt_Filter := ( Trunc( ldt_Filter ) - 3 );
        APEX_UTIL.IR_FILTER( p_page_id       => :APP_PAGE_ID,
                             p_report_column => 'BUSINESS_DATE',
                             p_operator_abbr =>'GTE',
                             p_filter_value  => TO_CHAR( ldt_Filter, 'YYYYMMDDHH24MISS' ) );
    END;Can anyone tell me:
    1. How to set this filter programmatically (also needs to be displayed on the page so the user can see the current filter...as if it were created via the GUI) ***OR***
    2. Some other work around for this issue..
    Thanks,
    -Joe

    Actually, now that I look further, I don't think it is going to work to simply set the filter programmatically. The end user can still click the column heading where they are only given the choice of the LOCALTIMESTAMP based filters. If they pick one, the page is going to be out to lunch for them.
    We really need some other fix. We really need a way to actually address the underlying issue.
    -Joe

  • JTable - programmatically setting the left column and top row

    I have a JTable in a JScrollPane. I would like to be able to programmatically scroll the table so that a certain column is shown as the left most column in the table, and/or a certain row is shown as the first visible row in the table.
    This is to allow a user to enter a value for the column or row that the want to be on the left or top of the viewport (ie, it is up to the user how they want to move the initially see the table).
    Any help would be much appreciated,
    Cheers, Sean

    Here is one way to do it:
    1) use the getCellRect(row,column,false) to get a rectangle for the cell you wish to display in the upper left corner
    2) use the getVisibleRect() method to get the viewport
    3) set the viewport x and y coordinate to be the same as the cell x,y coordinate
    4) use the scrollRectToVisible method to scroll to the desired area
    For example:
    Rectangle cellRect=myTable.getCellRect(5,10,false);
    Rectangle vis=myTable.getVisibleRect();
    vis.x=cellRect.x;
    vis.y=cellRect.y;
    myTable.scrollRectToVisible(vis);
    Caveat: posted code has not been tested!
    ;o)
    V.V.

  • Programmatically set email address column in incoming email settings in discussion fourm

    hi,
    I have to set up incoming email settings in my discussion forum in my subsite.
    but the issue  is that i am creating hundreds of sub sites based on a savedsite template.
    can anyone help, how to set the incoming email settings' email address  columns programmatically, ie, when the sub site is getting created i wanna set this property of my discussion forum list[ my discussion forum is also part of the saved site template].

    Use Event Handler when a new site is created and set incoming email. Refer to the following post for more information
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebeventreceiver.webadding(v=office.14).aspx
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebeventreceiver.webprovisioned(v=office.14).aspx
    http://www.novolocus.com/2009/04/15/programmatically-create-and-configure-mail-enabled-lists/
    --Cheers

  • Programmatically set af:query attributes value

    Hello,
    Is there an option to programmatically execute af:query search giving some attributes value?
    I have a query component for the view criteria like:() Group
    Attrib1 =
    AND Attrib2 =
    AND Attrib5 =There are almost 30 attributes in this VO that can be used in a query with advanced search mode, so I wouldn't like to create 30 bind variables for them (not sure that would be a solution either).
    Maybe there are some methods in QueryModel or QueryDescriptor to archieve this?
    // set some attributes in a key/value style
    query.setAttribute("AttribX", 123);
    // execute query
    JSFUtils.resolveMethodExpression("#{bindings.InformationSearchVCQuery.processQuery}", null,
    new Class[] { QueryEvent.class }, new Object[] { queryEvent });Thanks.
    ADF 11.1.2.2

    You can use something like this to iterate through VC and set values:
    http://adf-code-corner.blogspot.com/2012/08/programmatically-changing-validation.html
    Dario

Maybe you are looking for

  • Initial category is invalid error while running Locaton Hueristic

    Folks While running Locaton Hueristic, system is throwing and error '"Initial category is invalid". I had created a copy of 9ASNP02 PA, PB and DV, added a new KF and assigned a new categry group to this KF under all the aggregates. It was running fin

  • Double space period please in MAIL App!!!!!

    Apple - Anyone at Apple - Please please please tell someone to have a double space create a period at the end of sentences. Switching back and forth between the keysets is maddening. It's such a simple request... please.

  • Need a Advice for move from  peoplesoft to SAP BI

    Hi Experts, I am working as a peoplesoft Technical consultant in a MNC past 2 yrs . I want to change my domain to SAP BI. I need a suggestion. SAP BI Training already completed. But in my it's not possible for change so please advice how i will highl

  • Transaction log usage grows due to replication even if I don't use replication at all

    Hi The transaction log usage keeps growing a lot on my user database since few days back. the database is in full recovery model and I do transaction log backups every 10 minutes. The DB was part of Database Mirroring but I removed it. The usage was

  • Connecting to OS X file shares from Linux

    I need to connect to file shares on an OS X computer and mount them on a Linux server. Every resource I've seen seems to try to do this the other way around. I can ping the OS X computer so I know it can see it. I have enable SMB under sharing and se