Validate datatype of an attribute

Hi,
Need to validate whether value of an attribute is an instance of the datatype of the attribute.
Will the following code work ?
IWDNodeElement element = wdContext.nodePlants.getCurrentElement();
IWDAttributeInfo attrInfo = (IWDAttributeInfo)element;
if (element.getAtrributeText("test") instanceof attrInfo.getDataType()){
  //code here
Do let me know.
Thanks !
Sri

Hi
See u need not write any piece of code suppose where u r trying to Validate will Take care of that but ur Action shuld be Validating Action instead of Non-Validating  Action.
See the Order of Actions is
1. WebDynpro will Validate First its own rules
2.  Next is ur customized Validations will Take Place.
Try having some Empty Action on Input Field i.e onEnter of InputField Like that
See while creating Action for the Button Submission u Dont Check the CheckBox.
if u check it webDynpro will not Validate if not it Validates.
Hi
U need to check whether it is null or not but need not Validate whether it is Numeric or Not.
Wishes
Krishna kanth
Message was edited by: krishna  kanth
Message was edited by: krishna  kanth

Similar Messages

  • Firefox 4 does not validate REGEX in "pattern" attribute of INPUT (type = text) when diacritic characters are includes (Chrome does).

    Using HTML5 and Firefox 4.0.1, following code :
    <form>
    <input type="text" name="my_input"
    pattern="^[A-Z]([a-zA-Zçéèâêîôûäëïöü-]{1,47}|.)" />
    </form>
    fails to validate input like "François" or "André" but "Francois" ou "André" is accepted. The problèm occurs with string including any diacritic character.
    (The REGEX validates using "Expresso" Regular Expression Editor.)

    See https://developer.mozilla.org/en/HTML/element/input
    <blockquote>pattern HTML5:
    A regular expression that the control's value is checked against. The pattern must match the <u>entire</u> value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is text, search, tel, url or email; otherwise it is ignored.</blockquote>
    <pre><nowiki>pattern="^[A-Z]([a-zA-Zçéèâêîôûäëïöü-]{1,47}|.)$"</nowiki></pre>

  • Validate datatype

    how can i validate an input from user is in a correct datatype? for example, the user input a wrong datatype string into an int datatype field. in that case i need to notify the user and allow him to re-enter the value.

    If you are expecting an int, then check whether the given string is an int.
    This is a way for doing this
    try{
      Integer.praseInt(inputString);
      //no problem..
    catch(Exception e){
      //Inform user that you expect an int
    In the same way check for other data types
    -apppu

  • Cannot modify datatype of mapped attribute

    com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(DisplayEmpLeave.Year): must not modify the datatype of a mapped attribute
    IWDAttributeInfo attinfo=wdContext.getNodeInfo().getAttribute("Year"); ISimpleTypeModifiable modinfo=attinfo.getModifiableSimpleType();
    IModifiableSimpleValueSet valset=modinfo.getSVServices().getModifiableSimpleValueSet();

    Hi,
    It is not possible to map the this variable to a controller.
    So if u remove the mapping, the code will work.
    For that, right click the atrribute <b>"Year"</b>->Delete Context Mapping.
    If u want to pass the value to controller, create one context variable of type string, map it to controller and get the value from the variable <b>Year</b> to this
    Regards
    Fahad Hamsa

  • Hi Friends, i have to validate the min.length attribute using Regular expression, The min.length accepts single value digit only which accepts =5 & min.length accepts =9 please guide me as soon as possible

    dfdsfds

    User,  we need to know your jdev version!
    It would be helpful if your question would not only the header of the post.
    Can you please rephrase your question? Somehow i don't understand xour question.
    Timo

  • Problem creating in some attribute options for class through java API

    Hello everyone,
    I am successfully creating class and its attributes but i am not able to create attributes with its option like IS REQUIRED, IS INDEXED, IS SETTABLE and READ ONLY.....
    public void create_class(String cname,String cdesc,String scname)
    try
    ClassObjectDefinition cod = new ClassObjectDefinition(csession);
    cod.setSuperclassName(scname);
    cod.setName(cname);
    ClassObject co = (ClassObject)csession.createSchemaObject(cod);
    AttributeDefinition ad2 = new AttributeDefinition(csession);
    ad2.setAttributeByUpperCaseName("NAME",AttributeValue.newAttributeValue("Divya"));
    ad2.setAttributeByUpperCaseName("DATATYPE",AttributeValue.newAttributeValue(Attribute.ATTRIBUTEDATATYPE_STRING));
    ad2.setAttributeByUpperCaseName("DATALENGTH",AttributeValue.newAttributeValue(151));
    ad2.setAttributeByUpperCaseName("DESCRIPTION",AttributeValue.newAttributeValue("This the attribute number 2"));
    //here is some problem,,, Is Required is not been able to set
    //ad2.setAttributeByUpperCaseName("REQUIRED",AttributeValue.newAttributeValue(true));
    co.addAttribute(ad2);
    catch(IfsException e)
    e.printStackTrace();
    }

    Hi Kabilesh,
    Could you please let me know the exast soution u had for this?
    I even set the SHLIB_PATH in the environment, but still this problem persists.
    I am compiling the program and making into a shared library as
    cc -c -g -n +z -I$JAVA_HOME/include -I$JAVA_HOME/include/hp-ux -L/opt/java1.4/jre/lib/PA_RISC2.0/server -ljvm Test.c -o Test.o
    ld -b Test.o -L/opt/java1.4/jre/lib/PA_RISC2.0/server -ljvm -o Test.slMy java code is looks like this :
    void create_Jvm()
        JNIEnv * env;
        JavaVM * jvm;
        //JDK1_1InitArgs vm_args;
        /* Note : In JNI1.2 and Java2 SDK 1.4, the new structure JavaVMInitArgs has been introduced.*/
        JavaVMInitArgs vm_args;
        //JavaVMOption options[1];
        jint res;
        vm_args.nOptions = 0;
        vm_args.ignoreUnrecognized = JNI_TRUE;
        /* IMPORTANT: specify vm_args version # if you use JDK1.1.2 and beyond */
        vm_args.version = JNI_VERSION_1_4;
        //vm_args.version = JNI_VERSION_1_2;
        /*In JNI1.2 and Java2 SDK 1.4 the JNI_GetDefaultJavaVMInitArgs method call is not required.*/
        //JNI_GetDefaultJavaVMInitArgs( & vm_args);
        res = JNI_CreateJavaVM( &jvm, (void**)&env, &vm_args);
        if (res < 0) {
            fprintf(stderr, "Can't create Java VM\n Error is :%ld\n ", res);
            exit(1);
        iJvmInitialized = 1;
    } hi
    Check the lib path
    May be u have not included : at the end of the lib
    path that u have added
    THis was the mistake that i did
    kabilesh

  • Very Urgent - Transient attribute setting and getting problems

    Hi,
    I am using a DFF to set date but since DFF can store only varchar data and I need date datatype for the same,
    I have create a EO based on per_all_people_f table of HRMS.
    Then I created a VO based on this EO and added a column to_date(substr(attribute11,1,10), 'RRRR/MM/DD') to get a date column so that I can display date calendar on my OAF page.
    Then I created a page based on this VO and creaed a table region and selected this new column instead of attribute11 column.
    A date field is diaplayed on the page but when I use calendar to set date for this field and try to get the value in processFormRequest, I get null instead of actual date.
    Its really very urgent. I wadted lot of my time on this but could not find any solution.
    Please help...

    Hi,
    Thanks for the reply and sorry I could not check your reply due to some personal proble.
    Anyway, I have used Standard Date value set for attribute11 field but since datatype of the attribute field is 'VARCHAR2', in EO and hence in VO, it is taking datatype as VARCHAR2.
    Thanks

  • Use of  date as a datatype(Jdeveloper) for varchar2(in database)

    hi, i have a column requestdate(DB column) with Varchar2 as datatype, and i am binding this column to MessageText item(Using VoAttribute) in Jdeveloper which is declared as Date datatype, I am getting the following error. I want the dataPicker to be show in my page
    Developer Mode Error - Developer Mode Exception encountered in item OrderDate Error: The item OrderDate has a type (DATE) which is incompatible with the associated VO attribute, RequestDate (VARCHAR2). Action: Make sure they are compatible by either changing the datatype or the attribute associated with the item.

    Change message text field data type to Date ( then only you will get the date picker,otherwise there is no chance of getting the date picker)
    try and let me inform whethere that it is working or not, so that i can give you an another idea.

  • Validating attributes contents in XSD

    Hi,
    Is it possible to validate the contents of attributes and throw error
    if condition is not met? I want to throw an error if attemptsMade >
    maxRetryCount in the xml element.
    Following is the xml :
    <BusinessTask name="test" attemptsMade="0" maxRetryCount="5" />
    How do I incorporate this logic in the xsd schema?
    Thanks in advance.
    Rakesh

    I'm pretty sure you cannot cross-validate things like you wish.
    There is another technology called Schematron that can be used to validate XML files. It allows this kind of comparison.
    Dave Patterson

  • Cube attribute shows data in capital letters

    I have a strange issue. I am using SQL Server 2000 analysis services cube. The backend is in in Oracle. For one of the cube attribute, the data in backend are "Centro", "Lima", "Norte" and "Sur".
    But in cube, the "Lima" is appearing as "LIMA" while other data are showing correct as "Centro", "Norte" and "Sur". The strange part is "Lima" is shown as "LIMA" in cube. The datatype
    of this attribute is Char.

    SQL Server 2000 was out of support since April,2013. I suggest you can try to install SQL Server 2005 or later version.

  • Invalid precision/scale

    hi when i select a value in my LOV AM GETING THIS ERROR invalid precision/scale
    my LOV IS
    <ViewAttribute
        Name="Orgsubtypecode1"
        IsNotNull="true"
        PrecisionRule="true"
        EntityAttrName="Orgsubtypecode"
        EntityUsage="LutOrgsubtypes"
        AliasName="ORGSUBTYPECODE1"
        LOVName="LOV_Orgsubtypecode1">
        <Properties>
          <SchemaBasedProperties>
            <CONTROLTYPE
              Value="choice"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>my stack error is
    oracle.jbo.AttrSetValException: JBO-27010: Attribute set with value DBE for Orgsubtypecode in AppModule.OrgDetails1 has invalid precision/scale
         at oracle.jbo.rules.RulesBeanUtils.createException(RulesBeanUtils.java:381)
         at oracle.jbo.rules.RulesBeanUtils.createException(RulesBeanUtils.java:360)
         at oracle.jbo.rules.AbstractValidator.createException(AbstractValidator.java:1077)
         at oracle.jbo.rules.AbstractValidator.doRaiseException(AbstractValidator.java:1120)
         at oracle.jbo.rules.AbstractValidator.raiseException(AbstractValidator.java:1109)
         at oracle.jbo.rules.JboAbstractValidator.raiseException(JboAbstractValidator.java:409)
         at oracle.jbo.rules.AbstractValidator.raiseException(AbstractValidator.java:1096)
         at oracle.jbo.rules.JboAbstractValidator.callValidateValueWithContext(JboAbstractValidator.java:239)
         at oracle.jbo.rules.JboAbstractValidator.validate(JboAbstractValidator.java:386)
         at oracle.jbo.rules.RulesBeanUtils.validateObject(RulesBeanUtils.java:716)
         at oracle.jbo.rules.RulesBeanUtils.validate(RulesBeanUtils.java:696)
         at oracle.jbo.server.AttributeDefImpl.validate(AttributeDefImpl.java:3349)
         at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:3294)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:2012)
         at ecadastre.gov.za.model.entities.UamOrganisationsImpl.setOrgsubtypecode(UamOrganisationsImpl.java:501)
         at ecadastre.gov.za.model.entities.UamOrganisationsImpl$AttributesEnum$14.put(UamOrganisationsImpl.java:159)
         at ecadastre.gov.za.model.entities.UamOrganisationsImpl.setAttrInvokeAccessor(UamOrganisationsImpl.java:531)
         at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:1920)
         at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:2363)
         at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:2165)
         at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1453)
         at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:1428)
         at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:1089)
         at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:1029)
         at oracle.jbo.server.ViewRowImpl.setAttributeValues(ViewRowImpl.java:1703)
         at oracle.adf.model.binding.DCDataControl.setAttributesInRow(DCDataControl.java:2428)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttributeValuesInRow(JUCtrlValueBinding.java:976)
         at oracle.jbo.uicli.binding.JUCtrlListBinding.setTargetAttrsFromLovRow(JUCtrlListBinding.java:2801)
         at oracle.jbo.uicli.jui.JUComboBoxCtrlBinding.updateTargetFromSelectedValue(JUComboBoxCtrlBinding.java:793)
         at oracle.jbo.uicli.jui.JUComboBoxCtrlBinding.actionPerformed(JUComboBoxCtrlBinding.java:702)
         at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1240)
         at javax.swing.JComboBox.setSelectedItem(JComboBox.java:567)
         at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:603)
         at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:817)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:481)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Can you check whats the precision/scale and datatype of the attribute from corresponding EO attribute. That will clarify things.

  • Validation at transection level

    Hello Gurus,
    I am new in adf and using jdev 11.1.2.3.
    We have the option to validate business rules at attribute level and row level, but my requirement is i want to validate at transaction level. Mean if user has added four rows i want to validated theses four row simultaneously before commit changes to database. For example i have a vo in which user is entering data. i want when he entered all the data i want to loop through all records which he entered and then if validation is paased then will save changes to db.
    Please advice how can i do this in adf.
    Thanks,

    ADF does not have direct built-in method(s) for this purpose. Declarative Enitty validators have an option to "Defer execution to Transaction level" (have a look at the "Validation Execution" tab of the "Edit Validation Rule" dialog). However, Entity validators are not suitable for validating multiple Entity instances together.
    The recommended way to implement validation among multiple Entity instances is to override the EntityImpl.beforeCommit() method. Have a look at subtopic 8.5.2 here:
    Implementing Validation and Business Rules Programmatically
    If you follow this alternative, do not forget to set a required system property in order to avoid unexpected side effects:
    Decompiling ADF Binaries: Throwing ValidationException from the beforeCommit() logic !
    The alternative of overriding the ViewObjectImpl.beforeCommit() method is not recommended. Have a look here for explanation:
    Andrejus Baranovskis's Blog: Coding Validation in ADF BC View Object Before Commit Method
    Dimitar

  • Error while setting Minimum value to  Input Number Spin Box..

    Hai
    I drag and drop a VO and created a table.In that table,i convert a column which contain an InputText field to Input Number Spin Box.At the time of page load ,the table fetches the datas from the DataBase and showing Number values in the SpinBox.After that,When i scroll the table through vertical scrollBar,the table showing *"fetching data"* and Error is throwing as *"The value must be Number"* .. In the VO,this attribute is Number.
    THIS ERROR ONLY OCCURS when i set the Minimum value of spinBox ..The purpose of setting minimum value is that i only want user to select ve value only..How can i restrict the user for selecting only ve values..?(ie,*How can i set minimum value to SpinBox?)*

    Try changing the datatype of your attribute in the EO to be Double instead of Number.

  • Code developed in NWDS 7.1 CE7.1 not working in NWDS 7.1 EHP1

    Hi,
    The code developed using NWDS CE7.1  is working fine at runtime and then migrated to NWDS 7.1 EHP1 for a new requirement.The same code in NWDS 7.1 EHP1 is not working at runtime . The problem is with one of the columns in a table.This column is binded to a value attribute in NWDS CE7.1 whereas in NWDS 7.1 EHP1, this "value attribute" is now just an"attribute".
    The column is no longer displaying the right value at runtime when deploying the code from NWDS 7.1 EHP1.
    Please help.
    Regards,
    Reinuka.

    Hi Satish,
    Thanks for the reply.
    Yes, the attribute's dataype is not effective at runtime.I had created a custom date datatype for this attribute and assigned a format"dd-MMM-yy HH.mm.ss"  which is coming fine when the track has 7.10 sap dependencies but not when using a new track having same SCA file with 7.11 sap dependencies.I found it's not a problem with NWDS but when we with the version of the SAP dependencies added to the NWDI track.Kindly suggest.
    Regards,
    Reinuka Paul.

  • Adding two expressions in ADF Groovy

    Hi All,
    I want to add two expressions in Groovy given as below. Is a Groovy reference link available for starters. Basically the below expression gives eg: "3+4" instead of 7.
    #{bindings.DefibrillationNoAmsShocks.inputValue}+#{bindings.DefibrillationNoOtherShocks.inputValue}
    Thanks

    What is the datatype of the attributes DefibrillationNoAmsShocks, DefibrillationNoOtherShocks?
    In Jdeveloper 11.1.1.4, If the datatype is of type oracle.jbo.domain.Number, both these expressions provides the desired results:
    "#{bindings.DefibrillationNoAmsShocks.inputValue.value + bindings.DefibrillationNoOtherShocks.inputValue.value}"
    "#{bindings.DefibrillationNoAmsShocks.inputValue.data + bindings.DefibrillationNoOtherShocks.inputValue.data}"Thanks,
    Navaneeth

Maybe you are looking for

  • Reusing memory modules

    Can the 2x2Gb memory modules (to be removed to upgrade to 16 Gb) from a 2011 3.4 GHz i7 iMac be successfully used to increase the memory on a 2009 2.8 GHz i7 iMac?

  • How Can I limit the bandwith of my internet connection on linux?

    Hello, I have 2 Pc's, one for my brother, and the other for me. And well, always we have problems about downloads and lags when we are playing. For example, when I download packages from pacman, it is done at maximum speed "eating" all connection, an

  • Ecc6.0 , po return with excise using cst some error is showing in the po

    hai all     i am facing one problem in the return po with excise. i entered vendor and line items and selected the return tick mark when i was clicking the return tick mark this error is showing " Negative delivery costs not allowed". This is releate

  • Chinese characters show up as white boxes when doing captions

    I am using Premiere Pro CC 2014 on a late 2013 MacBook Pro. I am trying to add Traditional Chinese subtitles to my video. I have imported a .dfxp file and added it to the timeline on V2 above my video track on V1. I have rendered the timeline. I have

  • Guitar going in the line in on an x-

    Hello all?I am just curious as to how well?my guitar?is going to perform through my Xtrememusic card. I am going to use a Behringer blues stomp box between guitar and PC, a blues pedal that outputs at k ohm. Is this going to work ok?. I have the driv