How to make permission to enter Only Digits in String Context Attribute?

1. It is necessary to allow entry into InputField only digits.
2. The number of digits is limited to 5.
There is a context attribute "Code" of type string.
I have a code:
ISimpleTypeModifiable attributeType = wdContext.nodeCreateParams (). GetNodeInfo (). GetAttribute ( "Code"). GetModifiableSimpleType ();
attributeType.setMaxLength (5);
But I do not know how to allow entry only digits.
I would be grateful for your help!

Hi Vitaly
The problem is you cannot apply a format pattern to String based simple type.
The restriction can be overcame if you make the attribute Calculated. Then in setter-method you can perform the string parsing according to your 5-digits rule. For the purpose you can use Java class MessageFormat.
If the input string coming to the setter does not follow to the 5-digits rule, report the corresponding error message using method:
wdComponentAPI.getMessageManager().raiseInvalidContextAttributeMessage(...);
Hope this will help you.
BR, Siarhei

Similar Messages

  • How to make a real ENTER ??

    hi,
    i got problems using java and word..
    if I use a /n in the code, it makes a shift+enter in word
    how to make a real enter ??
    thanxx

    First you need to open the door :)

  • How to make textfield to take only numbers, & it wont allow us to enter any other characters

    make textfield to take only numbers, & it wont allow us to enter any other characters

    Clean up the code a little (credit goes to Sakthivel
    var oInput = new sap.ui.commons.TextField();
    oInput.onAfterRendering = function() {
      if (sap.ui.commons.TextField.prototype.onAfterRendering) {
        sap.ui.commons.TextField.prototype.onAfterRendering.apply(this, arguments);
      this.$().keydown(function(event) {
        var ctrlKey = event.ctrlKey;
        var altKey = event.altKey;
        var shiftKey = event.shiftKey;
        var key = event.keyCode;
        return (
          ctrlKey ||
          altKey  ||
          ( 47 < key && key < 58 && shiftKey === false) ||
          ( 95 < key && key < 106 ) ||
          ( key === 8) || (key === 9) ||  
          ( key > 34 && key < 40) ||
          ( key === 46)
    oInput.placeAt('content');
    -D

  • HOW TO MAKE FIELDS AS READ ONLY IN TABLE MAINTAINANCE

    HI ABAPers,
    HOW TO MAKE SOME FIELDS AS DISPLAY MODE.
    FOR SUPPOSE, THERE ARE 5 FIELDS in SM30.
    AMONG THEM 1 FIELD SHUD BE USED FOR EDITING AND THE OTHER 4 FIELDS SHUD ONLY BE USED FOR DISPLAY PURPOSE
    WHEN EVER I ENTER A VALUE IN THAT 1 PARTICULAR FIELD THEN THE DATA OF THE REMAINING 4 FIELDS SHUD BE DISPLAYED IN THE SAME SCREEN ITSELF.
    HOW CAN IT BE POSSIBLE...
    PLZ HELP.
    THNX IN ADV,
    SP.

    Hello SP,
    You can create a maintenance view for the table & here you can define the maintenance attribute for individual fields.
    For the fields you want to be READ-ONLY pass 'R' to those fields. (It is the 4th column from the left, the one to the immediate left of the Key column).
    Don't change the TMG function group directly. If you regenerate the TMG the changes would be overwritten !
    You can use the Event '01' to fulfill your requirement:
    *&      Form  f_event_01
    *       text
    FORM f_event_01.
      DATA: v_indx TYPE sy-index,
            v_land1 TYPE land1,
            v_name1 TYPE name1.
      FIELD-SYMBOLS: <vendor> TYPE lifnr,
                     <val> TYPE ANY.
      BREAK-POINT.
      "TOTAL contains all data which are read, changed and created in TMG
      LOOP AT total.
        IF <action> = neuer_eintrag " New Entry.
        OR <action> = aendern "Changed entry
        OR <action> = original. "Same as DB
          READ TABLE extract WITH KEY <vim_xtotal_key>.
          IF sy-subrc = 0.
            v_indx = sy-tabix.
          ELSE.
            CLEAR v_indx.
          ENDIF.
          ASSIGN COMPONENT 'LIFNR' OF STRUCTURE total TO <vendor>.
          CHECK sy-subrc = 0.
    *     select data from the LFA1 based on LIFNR
          SELECT SINGLE name1 land1 FROM lfa1
            INTO (v_name1,v_land1)
            WHERE lifnr = <vendor>.
          CHECK sy-subrc = 0.
    *     Populate the hidden fields NAME1 & LAND1
          ASSIGN COMPONENT 'NAME1' OF STRUCTURE total TO <val>.
          CHECK sy-subrc = 0.
          <val> = v_name1.
          ASSIGN COMPONENT 'LAND1' OF STRUCTURE total TO <val>.
          CHECK sy-subrc = 0.
          <val> = v_land1.
          MODIFY total.
          CHECK v_indx GT 0.
          extract = total. "Pass the changes in TOTAL to EXTRACT
          MODIFY extract INDEX v_indx.
        ENDIF.
      ENDLOOP.
      sy-subrc = 0.
    ENDFORM.                                                    "f_event_01
    BR,
    Suhas
    Edited by: Suhas Saha on Aug 16, 2010 11:58 AM

  • How to make a page read only

    Hi all,
    Can anyone please help me out on the following issue.
    How to make a total page read only, so that he/she can not make any changes. I want the total page read only.
    Do we have any functions to do that?
    I need to do through peoplecode only because i have to check a condition.
    Please help me.
    Thank you,
    Bye.

    Without customizing, this may be accomplished via Permission List Security.
    Go to PeopleTools - Security - Permission List
    Select the desired Permission List. Click on the Pages tab.
    Find the menu and click on "Edit Components" hyperlink.
    Find the Component on the List and click on the "Edit Pages" hyperlink.
    Click on the Display Only check box for each page in the component you wish Display Only.
    If that does not sufice, you may use PeopleCode to set the Field DisplayOnly property to true for those editable fields that you wish not to be.
    HTH
    Steven E. Davies

  • How to make report that contains only summaries?

    How to make a report in Designer/2000 that shows only summary fields? For example something like:
    select count(*) from emp;
    null

    How to make a report in Designer/2000 that shows only summary fields? For example something like:
    select count(*) from emp;
    null

  • How to make a PDF viewable only through an URL or a link?

    Hi
    I'm a newbie to Adobe Lifecycle ES. My ultimate aim to use this suite is to make my pdf viewable only through an URL or a weblink. The system must not allow the user to view the PDF without the particular URL. Is it possible to acheive this through Adobe Lifecycle ES? Please do reply as i'm in an urgency to finish my task.
    Thakns in advance

    If you are trying to control access to the actual URL where the Rights Managed PDF you would need to set up a way to authenticate users to allow them access ot the URL.  This would be done on the web\app server, not using Rights Management ES.
    You would use Rights Management ES to apply a policy to the PDF itself.  A policy controls who can view (open) the document, and once the user authenticates to the RM server to open the document, RM controls the permissions that that user has for the document (i.e. can the PDF be printed, can content be copied etc...)  RM cannot be used to control who can download a PDF form a URL.  Policies can also control if the user must be online and connected to the RM server to open the PDF, or you can allow "Offline" access for a set period of time where the user does not need a connection to view the PDF, however the user still needs to be authenticated to view the document offline.
    Regards
    Steve

  • How to make a field read only at run time by entering the value in another field.

    Hi Team,
                  Recently i got a requirement , i Have 2 dff's at header level and line level related to down payment ,and the DFF having two fields such as amount and if i enter amount that should be converted into % then populate the total amount field, at the same time % field should be gray out . if i give %(percentage) then amount field should be grayed out(read only) and then it should populates towards the total amount at header level.
    Can any one help me on this issue.
    Thanks,
    raghava

    I would to elaborate this issue...
    I have DFF's enabled at Header level and line in Purchasing Module -->Buyer WorkBeanch --> Order page here they did, as "Details". Details contains two Filed's
    1. Amount
    2.Percentage (%)
    Requirement :
    i.if i enter "down payment amount" then "down payment %" going to become read only. vise verse.
    ii. If I enter "down payment amount " or "down payment %" at header level then not allowing to enter at line level .
    thanks,
    raghava

  • How to make form field read only for users with certain permissions

    We need to make two form fields read only for users with certain permissions. Kindly guide me on how to do this in Infopath. I searched and there is an option to disable to the column, but no option to select user permissions. 
    Please give your suggestion on this. 
    thanks.

    Hi,
    See the link below:
    http://info.akgroup.com/blog-0/bid/69277/InfoPath-Restrict-visibility-to-users-in-a-SharePoint-Group
    Here you can add the fomatting action on the field to disable the field if those users belong to certain Sharepoint group (does not matter the permission levels though). Hope it helps.
    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

  • How to make for loop pass only once in a next() method

    Good Day!
    Can anyone help me or suggest any idea to resolve my problem with the below code, wherein it will only pass the for loop only once. I already tried inserting the for loop in side the if (sqlset4.isFirst()) condition but the problem is it only retrieved the first row of the resultset.
    Cheers!
                   Statement sOutput = consrc.createStatement();
                            ResultSet sqlset4 = sOutput.executeQuery(xquery);
                            ResultSetMetaData rsMetaData = sqlset4.getMetaData();
                            int numberOfColumns = rsMetaData.getColumnCount();
                            String writefld = "";
                            while (sqlset4.next()) {
                                 writefld = "";
                                 for (int i = 1; i <= numberOfColumns; i++) {
                                     if (xxformatid.equals("1") || xxformatid.equals("3")) {
                                         writefld = writefld + "sqlset4.getString(" + i + ").trim()" + "|";
                                writefld = writefld.substring(0, writefld.length() - 1) + ")";
                                output.write("\r\n");
                                output.write(writefld);
                            output.close();I am using Netbean IDE 6.8
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi

    Hi everyone!
    What I actually trying to do is that I have a multiple tables and from these tables I'm going to write each of it into a flatfile that is a pipe delimeted that is why I have to make a loop to know how many fields I am going to write. The code that was attached are actually working, my only concern is that it will take a longer time of processing cause every record of a table it will pass to the for loop(checking how many column) wherein number of column/ were already known on the first loop.
    Hi kajbj,
    I think what your trying to explain is almost the same with below code which i had already tried. The problem with this is that the every loop of the outer loop data retrieve is only the data of the first record.
                   Statement sOutput = consrc.createStatement();
                            ResultSet sqlset4 = sOutput.executeQuery(xquery);
                            ResultSetMetaData rsMetaData = sqlset4.getMetaData();
                            int numberOfColumns = rsMetaData.getColumnCount();
                            String writefld = "";
                            while (sqlset4.next()) {
                                 writefld = "";
                                 if (sqlset4.isFirst()) {
                                    for (int i = 1; i <= numberOfColumns; i++) {
                                        if (xxformatid.equals("1") || xxformatid.equals("3")) {
                                            writefld = writefld + "sqlset4.getString(" + i + ").trim()" + "|";
                                writefld = writefld.substring(0, writefld.length() - 1) ;
                                output.write("\r\n");
                                output.write(writefld);
                            output.close();

  • How to make a script treat only tables of one layer?

    Hi guys
    Could anyone  point the way to performing the below code only on one layer in  Indesign CS2?
    I also need to treat tables on "layer1" only.
    with(app.activeDocument){
    for(  storyIndex = 0; storyIndex < stories.length; storyIndex++)
                var myStory = stories.item( storyIndex );
                for (tableIndex = 0; tableIndex <  myStory.tables.length; tableIndex++)
                    //do things here
    This works on the  whole document but how can I ask Indesign to treat only tables in  "layer1". The layer object does not contain the story object, so I cant  adjust the "with" statement above.
    Basically what I need to do is untag all XMLelements within a table of layer but i have given the obove code for simplicity.
    Can anyone guide me on this?
    Thanks
    Nadia

    CS2, huh? If you have not already, you should budget for an upgrade to CS5.5 (or better yet, CS5 right now and get the free CS5.5 upgrade,so you have both, assuming that offer is still outstanding).
    Generally using with is discouraged. It makes it hard to tell what's really going on in your program and is considered bad style [at least by me]. Better to use either a temporary variable or app.activeDocument.stories explicitly.
    Stories do not themselves have a concept of a layer, because they are composed of textFrames and those could be on different layers.
    But let's assume that you care about the layer of the first textFrame in each story.
    Then:
    var
      stories = app.activeDocument.stories,
      storyIndex, myStory,
      tableIndex;
    for (storyIndex = 0; storyIndex < stories.length; storyIndex++) {
      myStory = stories[storyIndex];
      if (myStory.textFrames[0].itemLayer.name === 'layer1') {
        for (tableIndex = 0;
             tableIndex <  myStory.tables.length;
             tableIndex++
          //do things here
    (I also use stories[15] instead of stories.item(15) and declare all vars at the top.)

  • How to make Select List Read only (Keep key Data)

    I'd like to make a select list read only when the screen is in maintenance mode because the select list value is part of the key.
    However, when I make the select list read only, the update fails because it appears making it disable lose's it's value.
    How can I make a select list read only and keep it's value for update.

    In HTML Header I have
    <script type="text/javascript">
    function Disable_List(pthis,hideitem)
    if ($x(hideitem).value == 'Y')
    {   $x(pthis).disabled = "disabled";
    </script>
    <script type="text/javascript">
    function Load_Start()
    Disable_Item('P5_SUBCODE','P5_XW_HAS_VALUE');
    Disable_List('P5_LTY','P5_XW_HAS_VALUE');
    </script>
    When I click apply changes, my Validation check that doesn't allow nulls in the "P5_LTY" fires saying the field can't be null. The select list is grayed out and I see the value, but the validation check thinks it's null.
    Edited by: spuchc on Jun 15, 2010 8:03 AM

  • How to make Safari automatically enter ebay Password

    How do I get Safari to automatically put in my Ebay password. I am the only one who uses the computer and I would like to not have to enter it each day.

    HI,
    From your Safari menu bar click Safari / Preferences then select the Autofill tab.
    Select: User names and passwords.
    Go to the eBay site. Login with your user name and password. Click Yes when prompted.
    That will store that data to a new keychain for you in Keychain Access (Applications / Utilities)
    When you revisit eBay, you shouldn't have to enter your username and password.
    If you forget your eBay password, just open the Keychain Access (Applications / Utilities) Select Passwords on the left. Double click the eBay keychain. Click Show Password
    Carolyn

  • How to make the report shows only top level steps

    HI,
    I use many subsequences in my tests.  I have no interest to see them in the report.  How can I force the report to show only top level steps?
    Thanks
    Rafi

    I needed to prevent 'Skipped' steps from appearing in my reports.  One way to do this is to override the SequenceFilePostResultListEntry callback in the model.  You do this by clicking on Edit and then Sequence File Callbacks and then find SequenceFilePostResultListEntry in the list and click the Add button.
    Edit your new callback in your sequence file to check for a pre-condition.  In my case I checked for Parameters.Result.Status == "Skipped" since that parameter is set to Skipped, Done, etc. based on the result.
    If the condition was true then my only step in the callback was to set Parameters.DiscardResults = True.  The TestStand model will then throw that result away when it processes the report.  You could add a step for every type of data you wish to discard.
    A second method that is easier to implement, but time consuming, is to select each step you DON'T want in your report and bring up the Properties for that step.  Under the Run Options tab, deselect the Record Results box.  That will keep the results of that step out of the report, but you have to do this for EVERY step you don't want to have reported.  The first approach I provided acts to filter the results.
    If you aren't sure what the Parameters.Result.Status will be, then set a breakpoint after that step is executed and scan the parameters when the sequence is halted there.  You can then detect the actual text used as a result for that step, such as "Done" and can set your pre-condition appropriately.

  • How to make form as read only when another time as  user sees it..

    Hi All,
    I have a form to raise the issue. once the issue is raised it appears in the issue raised reports( that is form on a report )
    so all can view this report and click on issue no ..the form with details appear .
    but i want to restrict it , by allowing only one up manager to view the form on a report in editable format rest all can just view it .
    how can i do this?????????
    can any one help me with this ????..
    my approach is like this ...
    a column called "checked shud be added to issue table , then its values must be set to "raised" when issue is submitted for the very first time..( so it is zero when the end user is submitting it ).
    when ( the logged in user =1 up manager or checked!="raised") then
    form fields to be displayed as edited
    else
    form fields need to be read only .
    Thanks & Regards,
    Nandini Thakur.
    Edited by: Nandini thakur on Jun 26, 2010 12:04 PM

    Nandini,
    If you edit any item, you can see a section where you can specify "Read-Only" condition. Here you can write your read-only logic using SQL OR PL/SQL or predefined conditions.
    Cheers,
    Hari

Maybe you are looking for

  • Format Date Form Field in Adobe Acrobat Pro

    Thanks in advance for your help. I have date fields in an Acrobat form. Is it possible to create a script to format a date as either MM/DD/YYYY or MM/DD/YY? In other words, if someone enters MM/DD/YYYY, the date would be accepted and MM/DD/YY would a

  • Sync issues with latest version of i tunes

    new version of i tunes hasnt installed properly cant sync i pad or i phone why release new versions when they clearly dont work. have re installed to no avail. now what do i do ?

  • Cheap and effective fix for scratching DVD/CDs in iMacs

    After looking at the slot on the side of the iMac, I couldn't help but notice how sharp the edges of the sides are. That will cause huge problems for everyone of us at one point or another. After reading a number of complaints surrounding this design

  • How to backout my Function module?

    Hi All, if I have transported my inbound function module to production system, but when my code has influence on data in the production system, I want to backout my inbound function module and I don't what to delete my code, what should I do? Many th

  • Missing photos. Won't show me a path to Locate Photos

    Hello I have 3 folders marked as missing. When I click on the question mark, and say Find Missing Folder, it brings up the Mac Finder window, with a list of all the contents in my external hard drive. It does not navigate me to the missing photos. Wh