Setting control parameters programmatically - using variables...

Please excue typos - I lost my glasses the other day and I'm waiting on a new pair to come in.
I need to be able to change the 'editable' and 'enabled' properties on a variety of controls programmatically. I'm adding 'after the fact' Role support to an application and the customer has asked for a way to change the visibility and editability on specific controls.
I've created a role management system where the controls are stored in an XML file and the application administrator has the ability to define roles by changing what a user (belonging to a Role) can see and change.
based on:
<filename canAccess="false" fileName="canSearch.mxml" friendlyName="Claim Search">
  <controls>
    <control controlID="control ID" controlLabel="control ID" controlType="type" editable="false" visible="false"/>
    <control controlID="control ID" controlLabel="control ID" controlType="type" editable="false" visible="false"/>
  </controls>
</filename>
I could:
if(controlType == whatever)
     display based on xml information
but I'd have to add new code for each additional control type that we may add later..
what I'd like to do is:
var controlID:controlType;
controlID.editable = controls.control.@editable;
but of course,
"Type was not found or type was not a compile-time constant: controlType"
Is there a way to do this entirely programmatically?

This is the code I'm testing:
for each(var control:XML in roleInfo.role.(name == rolesA[0]).filename.(@fileName == calledFileName).controls.control)
     var tempControlID:String = control.@controlID;
     this[tempControlID].enabled = control.@enabled;
     this[tempControlID].editable = control.@visible;
against the following XML structure:
<roles>
<role>
    <name>Claims Viewer</name>
    <description>This User can only view claims.</description>
    <filename canAccess="false" fileName="canSearch.mxml" friendlyName="Claim Search">
      <controls>       
        <control controlID="txtTIN" controlLabel="TIN:" controlType="Text Input" editable="true" visible="true"/>
        <control controlID="txtNPI" controlLabel="NPI:" controlType="Text Input" editable="true" visible="true"/>
      </controls>
    </filename> 
    <filename canAccess="true" fileName="canNewClaim.mxml" friendlyName="New Claim">
      <controls>
         <control controlID="txtPatientID" controlLabel="Patient ID:" controlType="Text Input" editable="true" visible="true"/>
         <control controlID="txtSubscribe" controlLabel="Subscriber ID:" controlType="Text Input" editable="true" visible="true"/>
         <control controlID="txiDOB" controlLabel="Patient DOB:" controlType="Text Input" editable="true" visible="true"/>
      </controls>
    </filename>
  </role>
</roles>
The idea is to be able to change editable, enabled, and other properties such as 'includeInLayout' based on the role restrictions contained in the XML file.
I am hoping to be able to do this without having to resort to:
if(controlType == mxLabel)
  apply settings
else ig(controlType == someOtherControl)
apply settings
(repeat until all control types are covered)
The problem is that not all controls use all, or even the same, properties e.g; <mx:Label> doesn't support 'editble' so evein this method may not be optimal.  I was thinking to use a try-catch block with it to contain errors, but that sounds a little too 'brute-force'.
for each(var control:XML in roleInfo.role.(name == rolesA[0]).filename.(@fileName == calledFileName).controls.control)
     var tempControlID:String = control.@controlID;
     this[tempControlID].enabled = control.@enabled;
     try
       this[tempControlID].editable = control.@visible;
     catch(e:ErrorMessage)
          //handle 'editable' differently
Where rolesA[0] is the Claims role from the User database that we want to match to the applicable role in the XML file, and calledFileName is the name of the file we want to manage the controls for.
I am using an XSD to support the XML file, so I may change the XML structure to have appropriate controls for each control type, however that would make the page that supports modifying the XML very difficult to code (for me , at least)
On the boolean conversions, could I do this?
this[tempControlID].enabled = control.@enabled as Boolean;
Does this make any sense, or am I overcomplicating things?

Similar Messages

  • Transport request for Set Control Parameters for Actual Data.

    Hi Viewers,
    I am unable to create the transport request for the below settings
    Controlling->Profit Center Accounting->Basic Settings->Controlling Area Settings->Activate Direct Postings->Set Control Parameters for Actual Data.
    Is it possible to move the request through transport request or do we need to create the settings directly in the target system.
    Thanks
    Aswin.

    Hi,
    Please read the IMG help at the given path.  There are certain profit center accounting settings which cannot be transported directly from the same path, but there is another node in SPRO path for doing this.  If possible I will try to locate the path but I am not sure I can post it immediately as I am not having system handy.
    thanks,
    Kumar

  • How to create a subreport link programmaticly using java RAS sdk

    Hi,
    I want to create subreport link for couple of main report parameters programmaticly using RAS sdk.
    Main report has Param1 and Param2. I need to link these parameters to sub-report which doesn't have any parameters, so I can pass the parameters value just once when running the report and consume it's value in the sub-report.
    Below is the code I tried but I get "Invalid field name"error when I try to save the main report.
    ISubreportClientDocument subReportDoc = subReportCntrl
                      .getSubreport(subReports.getString(i));
    SubreportLinks srLinks = subReportCntrl.getSubreportLinks(subReports.getString(i));
    SubreportLink subRptLink1 = new SubreportLink();
    Fields paramFields = reportClientDoc.getDataDefinition().getParameterFields();
    subRptLink1.setMainReportFieldName(paramFields.get(0).toString());
    subRptLink1.setSubreportFieldName(paramFields.get(0).toString());
    SubreportLink subRptLink2 = new SubreportLink();
    subRptLink2.setMainReportFieldName(paramFields.get(1).toString());
    subRptLink2.setSubreportFieldName(paramFields.get(1).toString());
    srLinks.add(subRptLink1);
    srLinks.add(subRptLink2);
    subReportCntrl.setSubreportLinks(subReports.getString(i), srLinks);
    Thanks,

    Hi,
    I want to create subreport link for couple of main report parameters programmaticly using RAS sdk.
    Main report has Param1 and Param2. I need to link these parameters to sub-report which doesn't have any parameters, so I can pass the parameters value just once when running the report and consume it's value in the sub-report.
    Below is the code I tried but I get "Invalid field name"error when I try to save the main report.
    ISubreportClientDocument subReportDoc = subReportCntrl
                      .getSubreport(subReports.getString(i));
    SubreportLinks srLinks = subReportCntrl.getSubreportLinks(subReports.getString(i));
    SubreportLink subRptLink1 = new SubreportLink();
    Fields paramFields = reportClientDoc.getDataDefinition().getParameterFields();
    subRptLink1.setMainReportFieldName(paramFields.get(0).toString());
    subRptLink1.setSubreportFieldName(paramFields.get(0).toString());
    SubreportLink subRptLink2 = new SubreportLink();
    subRptLink2.setMainReportFieldName(paramFields.get(1).toString());
    subRptLink2.setSubreportFieldName(paramFields.get(1).toString());
    srLinks.add(subRptLink1);
    srLinks.add(subRptLink2);
    subReportCntrl.setSubreportLinks(subReports.getString(i), srLinks);
    Thanks,

  • Unable to set kernel parameters using Reource Control

    HI,
    I'm trying to install DB2 8.2 on solaris 10.the problem i'm encountering in installation is unable to set MSGMAX and MSGMNB kernel parameters. I tried setting the new replacement parameter process.max-msq-qbytes through projects->Resource Control from the management console.but still uinable to set the parameters.
    Can anyone help me in setting the above kernel parameters.
    Its not possible to set it thru /etc/system.
    thanx
    guru

    I finally had some time to find the actual syntax for tuning process.max-msq-qbytes and process.max-msg-messages. prctl will change those paramaters for an existing process.
    As a proof of concept I changed process.max-msg-messages to a 64k. process 2221 is my shell.
    prctl -n process.max-msg-messages  -r -v 64k 2221
    bash-3.00# prctl 2221
    process: 2221: -csh
    NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
    process.max-port-events
            privileged      65.5K       -   deny                                 -
            system          2.15G     max   deny                                 -
    process.max-msg-messages
            privileged      64.0K       -   deny                                 -
            system          4.29G     max   deny                                 -
    process.max-msg-qbytes
            privileged      64.0KB      -   deny                                 -
            system          4.00GB    max   deny                                 -And now to make this persist across reboots...
    So long as I'm experimenting, I'll use projadd and add a new project which just includes me and not the rest of the users in the group staff.
    bash-3.00# projadd -p 115 -U testuser \
    -K "process.max-msg-messages=(priv,64K,deny)" \
    -K "process.max-msg-qbytes=(priv,64K,deny)" \
    user.me This creates the following /etc/project:
    (note the last line is all on one line in the real file minus the \.)
    placer% cat /etc/project
    system:0::::
    user.root:1::::
    noproject:2::::
    default:3::::
    group.staff:10::::
    user.me:115::testme::\
    process.max-msg-messages=(priv,64000,deny);process.max-msg-qbytes=(priv,65536,deny)After a reboot I checked the values by loging in under my user and running prctl.
    placer% prctl $$
    process: 419: -csh
    NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
    process.max-port-events
            privileged      65.5K       -   deny                                 -
            system          2.15G     max   deny                                 -
    process.max-msg-messages
            privileged      64.0K       -   deny                                 -
            system          4.29G     max   deny                                 -
    process.max-msg-qbytes
            privileged      64.0KB      -   deny                                 -
            system          4.00GB    max   deny                                 -
    process.max-sem-ops
            privileged        512       -   deny                                 -
            system          2.15G     max   deny                                 -
    ...Solaris 10 has different tunables and default values from 8 and 9. It's default tunables should be good for most applications per a given system's hardware. There are some great blog articles, and discussions on opensolaris.org and blogs.sun.com on tuning that explain the intent of tuning and why we shouldn't have to tune.
    Cheers,
    ~~sa

  • Unable to set kernel parameters using Reource Control in solaris 10

    HI,
    I'm trying to install DB2 8.2 on solaris 10.the problem i'm encountering in installation is unable to set MSGMAX and MSGMNB kernel parameters. I tried setting the new replacement parameter process.max-msq-qbytes through projects->Resource Control from the management console.but still uinable to set the parameters.
    Can anyone help me in setting the above kernel parameters.
    Its not possible to set it thru /etc/system.
    thanx

    HI,
    I'm trying to install DB2 8.2 on solaris 10.the problem i'm encountering in installation is unable to set MSGMAX and MSGMNB kernel parameters. I tried setting the new replacement parameter process.max-msq-qbytes through projects->Resource Control from the management console.but still uinable to set the parameters.
    Can anyone help me in setting the above kernel parameters.
    Its not possible to set it thru /etc/system.
    thanx

  • After time capsule 7.6 Firmware upgrade I can't set up Access Control / Timed Access using mac adresses.

    After time capsule 7.6 Firmware upgrade I can't set up Access Control / Timed Access using mac adresses.
    I have a Time Capsule and an Airport express and when I change access control parameters on whatever one of those
    two devices through Airport Utility its duplicating the same setup on the other device !
    What a mess !
    I had to choose "Not Enabled" in the Access Control stup window.
    Has anyone experienced same problem ?
    Jean.

    I did downgraded firmware to 7.5.2 ...
    and the Acess Control Setting from Airport Utility is back to normal behaviour.
    Jean.

  • Unable to set  kernel parameters using solaris 10

    HI,
    I'm trying to install DB2 8.2 on solaris 10.the problem i'm encountering in installation is unable to set MSGMAX and MSGMNB kernel parameters. I tried setting the new replacement parameter process.max-msq-qbytes through projects->Resource Control from the management console.but still uinable to set the parameters.
    Can anyone help me in setting the above kernel parameters.
    Its not possible to set it thru /etc/system.
    thanx
    guru

    HI,
    I'm trying to install DB2 8.2 on solaris 10.the problem i'm encountering in installation is unable to set MSGMAX and MSGMNB kernel parameters. I tried setting the new replacement parameter process.max-msq-qbytes through projects->Resource Control from the management console.but still uinable to set the parameters.
    Can anyone help me in setting the above kernel parameters.
    Its not possible to set it thru /etc/system.
    thanx
    guru

  • Using SET GET parameters in ITS

    Hi All,
    Is it possible to use set get parameters in ITS. We want to set some parameters in a BADI and read the value in ITS Template .
    Or is there any other method to do this?
    Thanks,
    Anubhav

    Sure. In your abap program use the following code
    *  ITS macros
    INCLUDE avwrtcxm.
    GET PARAMETER ID 'YOUR_PARAMETER' FIELD SAVE_PARAMETER.
    field-set u2018~YOUR_PARAMETERu2019 1 SAVE_PARAMETER.
    field-transport.
    in the template you can now use ~YOUR_PARAMETER.
    regards,
    Klaus
    Edited by: Klaus Layer on Feb 3, 2009 5:05 PM

  • How to use SET & GET Parameters in Module Pool

    Hi Friends,
    Can anyone please tell how to use SET / GET parameters and PARAMETER ID for a text box (Input / Output field ) in module pool? What is the purpose and where do we need to do coding for it?
    Note : I will definitely give the marks for good responses.
    Thanks in advance,
    Pradeep

    Hi Pradeep,
    You can save values in the SAP memory using a parameter ID. These
    are user and terminal-session specific, but available to all internal and
    external sessions.
    SET Parameter copies the corresponding field contents into the SAP
    System memory in the PAI processing block.
    GET Parameter copies the corresponding field contents from the SAP
    memory at the end of the PBO processing block, after data has been
    transferred from the program, if the screen field still has its initial value
    You can link an input/output field to an area of the SAP memory in the
    ABAP Dictionary.
    When you use an input/output field that is defined in the ABAP
    Dictionary, its parameter ID is displayed in the Dictionary attribute
    Parameter ID in the Screen Painter.
    Usage
    SET PARAMETER ID: ’CAR’ FIELD space,
    ’CON’ FIELD space,
    ’DAY’ FIELD space.
    Here is the link that explains the usage of GET/SET in detail
    <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm</a>
    Regards,
    Sharadha

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • Set "url" in HTTPService using String variable

    Hi,
    How can I set "url" in HTTPService using String variable (see below). I've tried different formats of string & variable concatenations.
    privtate var myurl:String = "http://localhost/";
        <mx:HTTPService id="post_submit_service"
            url="{myurl+'test.php'}"
            method="POST"
            resultFormat="text"
          result="result_handler(event)"
          fault="fault_handler(event)">
            <mx:request xmlns="">
          </mx:request>
        </mx:HTTPService>
    Thanks,
    ASM

    try following:
    url="{myurl}test.php"

  • Using "Set Control Value" to pass a reference

    Hi,
    every time I tried to passe a Control Reference using "Set Control Value" I have the Error 1 (invalid input parameter at invoke node). Why is it not possible to pass a control reference using the invoke node??
    Thanks
    Golzio

    Hi,
    This is possible. Trick is, the type of the control reference needs to be
    the same as the input. E.g. a string control reference is a different type
    as a numeric control reference (, or a control reference).
    To avoid this conflic, make sure the input of the vi is a control reference
    (and not a e.g. string control reference). Also make sure the to convert the
    reference you pass to a control reference (using Application Control>To More
    Generic Class).
    Regards,
    Wiebe.
    "Golzio" wrote in message
    news:506500000008000000C1F00000-1079395200000@exch​ange.ni.com...
    > Hi,
    > every time I tried to passe a Control Reference using "Set Control
    > Value" I have the Error 1 (invalid input parameter at invoke node).
    > Why is it not possible to pass a control re
    ference using the invoke
    > node??
    >
    > Thanks
    > Golzio

  • Can I re-use a parameterized manual test case with different set of parameters in a different test plan?

    Can I re-use a parameterized manual test case with different set of parameters in a different test plan without impacting the parameters in the first test plan?

    Hi ssteele_1,
    Thank you for posting in MSDN forum.
    Generally, I know that if you want to re-use a parameterized manual test case and without impacting the parameters in the first test plan.
    I suggest you could try to right click this parameterized manual test case ->Select the Create copy and add to suite option like the following screen shot.
    Then the parameterized manual test case can be re-used as a new test case in this MTM and it will did not impact the original parameterized manual test case.
    Best Regards,
    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.

  • "Set-aduser -clear" using variables

    Hello all,
    Is it possible to clear an attribute from a user using variables? For example, this little command works fine:
    get-aduser User31 | set-aduser -clear extensionattribute2, extensionattribute3
    However, I'd like to use this command with variables, like if I didn't know what attributes I wanted to clear beforehand, and could add these attributes to a variable and then pass them to set-aduser:
    $Variables = "extensionattribute2, extensionattribute3"
    get-aduser User31 | set-aduser -clear $Variables
    This command will not work, and I'm not sure if it's possible to use variables with the "-clear" parameter of "set-aduser"?

    Hi,
    You can do that this way:
    $attributes = 'extensionAttribute2','extensionAttribute3'
    Set-ADUser -Identity tester1 -Clear $attributes
    Examples:
    Before:
    Get-ADUser -Identity tester1 -Properties extensionAttribute2,extensionAttribute3 |
    Select SamAccountName,extensionAttribute2,extensionAttribute3
    SamAccountName extensionAttribute2 extensionAttribute3
    tester1 ex2 ex3
    After:
    SamAccountName extensionAttribute2 extensionAttribute3
    tester1
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • I just set up family share, but my kids show up as adults using their existing Apple ids. I want their statis to be child so I can set some parameters. Can this be changed?

    I Just set up family share using my children's existing Apple ids. But theit statis show up as adult, is there a way to change this?

    No, it's only with family sharing that child accounts can now be created (by the family organiser), you can't change existing accounts to be child accounts. You will either have to keep them with their existing adult accounts, or you can create new child accounts for them : Family Sharing and Apple IDs for kids - Apple Support

Maybe you are looking for

  • My iWeb problem stumped the Genius Bar

    Hello all , first post , apologies in advance for its length . I got a problem thats really frustrating me . The Genius man in the apple shop couldn't help , he'd never seen this problem before so he suggested I try here . Here's the thing . I've mad

  • Win XP Pro SP3 to SP2??

    Hi New new T61 will arrive Tuesday. It will have XP Pro, I think SP3.. My kids have told me no body wants SP3 and/or IE 7,, in IBM/Northrop-Grumman/Accenture,, Stay with SP2 & IE 6.. Before I get into trouble, I need so help  1)What is the consensus:

  • Problem in Publishing the certificate to directory server

    I am having problem regarding the publishing the certificate.I am using iPlanet CMS 4.7 and iPlanet directory server 5.1 In the CMS >certificate manager > publishing module > mapper It provides(manuals) two options to enable the publishing to directo

  • Problem with Tcode: PT91_ATT : SAP-HR Standard to Zprogram

    Hello Experts, I have created the zreport from attendance in HR-payroll ( Tcode: PT91_ATT ). Actually I have copy the whole satandard report code (with Tcode: PT91_ATT ) to my zreport for the customized requirement. Also we have to add in selection p

  • E-mail issue after using Desktop Manager

    I am a new BB user (Curve 8530). So I am confused with this issue. Couple of days back I connected phone to my laptop and used desktop manager (ver 5.0.0.11). I just wanted to explore the features of DM. After I disconnected from laptop, the company