Validating Input characteristics using other characteristics value in PI sh

Hi,
I am currently working with PI sheet, the requirement is to validate the input characteristics using some other characteristics values, like
Char Name | Value | Input |
Acids     | 2-3   | 2.5   |
CONC      | 10-40 | 20    |
in this case consider the characteristic value from character Value to validate Input.
Please suggest.
Anmol.

Hi,
I got the solution clossing the threat, by using variables in PI sheet to create validation formula.
Thanks,
Anmol

Similar Messages

  • Validating input parameters using exception handlers

    Hi
    I have a procedure which works in a similar way to the following:
    PROCEDURE main (p_date_from times.id%TYPE)
    l_time_from varchar2(40);
    BEGIN
    l_time_from:=p_date_from
    IF l_time_from IS NULL THEN
        l_time_from:='23:59';
    ELSIF NOT regexp_replace(l_time_from,'.[0-9]{2}:.[0-9]{2}') THEN
        RAISE invalid_time
    END IF;
    EXCEPTIONS
      WHEN invalid_time THEN
        dbms_output.put_line('Not a valid time');
    END main;I want to validate p_time_from parameter so that it only accepts the following format 'NN:NN' i.e. '22:31'. I've thought that using a regular expression would work within an IF statement, however as you can see my syntax is poorly constructed at best and doesn't actually work. Is there a better way of doing this??
    Many thanks
    Edited by: tri_harder on Dec 4, 2008 11:50 AM

    Hi,
    A better solution...
    CREATE OR REPLACE PROCEDURE proc_main(p_date_from IN times.id%TYPE,
                                          p_code      OUT NUMBER,
                                          p_message   OUT VARCHAR2) IS
        v_date_from times.id%TYPE := '23:59';
        v_date      DATE;
        invalid_minute EXCEPTION;
        PRAGMA EXCEPTION_INIT(invalid_minute, -1851);
        invalid_hour EXCEPTION;
        PRAGMA EXCEPTION_INIT(invalid_hour, -1850);
        invalid_format EXCEPTION;
        PRAGMA EXCEPTION_INIT(invalid_format, -1858);
    BEGIN
        -- Initialization
        p_code    := 0;
        p_message := 'Succesful';
        IF p_date_from IS NOT NULL THEN
            v_date_from := p_date_from;
        END IF;
        -- This raises exception
        v_date := TO_DATE(v_date_from, 'HH24:MI');
    EXCEPTION
        WHEN invalid_minute
             OR invalid_hour
             OR invalid_format THEN
            -- You must handle the exception
            p_code    := SQLCODE;
            p_message := SQLERRM;
    END proc_main;Regards,

  • Can i use two characteristics in heirarchy( waiting for reply from 2 days)

    hello Guru's
    I am working on a very non-standard PnL statement report in BI and am trying to come up with a good way to maintain it. Each line item in the PnL statement is based on different characteristics. For instance, the first line item might be a range of account numbers using 0GL_ACCOUNT . The second line item may be a particular Cost Center using 0COSTCENTER and a particular GL Account.
    can i set up hierarchies on certain characteristics (0GL_ACCOUNT, 0COSTCENTER, 0COMP_CODE). Would it be somehow possible to create an entirely custom hierarchy that would use mixed characteristics to come up with each value? If this is not possible, can someone tell me that how can we handle this(query side)?
    thanks,
    sneha
    Edited by: sneha marla on Dec 9, 2008 9:57 PM
    Edited by: sneha marla on Dec 10, 2008 9:59 PM

    hello Nair,
                    i have balances for G/L accounts Ex: 9410 G/L account has balances with cost centers 1000, 2000 and 3000. I need to restrict 9410 with cost center 1000 in hierarchy
    for this i created hierarchy on 0GL_Account like. i created revenues as text node and under revenues i created acetate product as text node under this i inserted G/L account 9410. I kept 0Costcenter in external Hierarchies of 0GL_Account. by that i inserted costCenter also under Acetate product. i am not getting correct values.
    can you please sugest is there any thing.
    Thanks,
    Sneha

  • APO DP - descriptive characteristics used in consumption groups

    I am using APO DP V5.
    I need to use descriptive characteristics in consumption groups ( for use in release of DP to SNP).
    Do these descriptive characteristics have to be planning characteristics of the planning object structure, or can they also be navigation attributes?
    Thanks,
    Bob Austin

    Technically yes.  But in the business context, is this makes sense?  Descriptive characteristics are used to consume at lower level than , the level at demand is getting released from DP to SNP.  Navigational attributes are used for  N:1 relationship. Eg. Customer to Sales Region association.  When you release at Customer level, it doesn’t  put any value keeping Region as consumption group.  (Customer is already more detail level than region.. the consumption will happen at the customer level)
    -Shibu
    Thanks for rewarding point if this is helpful.

  • I am facing error while running Quickpay in Fusion payroll that "The input value Periodicity is missing for element type KGOC_Unpaid_Absence_Amount. Enter a valid input value". Any idea?

    I am facing error while running Quickpay in Fusion payroll that "The input value Periodicity is missing for element type KGOC_Unpaid_Absence_Amount. Enter a valid input value". Any idea?

    This is most probably because the Periodicity input value has been configured as "Required" and no value has been input for it.
    Please enter a value and try to re-run Quick Pay.

  • Table names to get list of characteristics used in Query

    Hello,
    I am trying to get separate list of characteristics & key figures used in query. i want that particular table which will give me the list of characteristics. & other table which will give me list of key figures used in that query. I want these characteristics & keyfigures specifically used in query.I don't want the global list dependant on infoprovider but dependant on query like (ZSJM_ZSD_C05_Q001).
    Can anybody help in getting the table names?
    Thanks in advance.

    Hi Deepak,
    You need to go to RSRREPDIR - to get the GUID of the query.
    Then you can work your way through  RS* X *REF (type in this name in SE11/SE16 and press F4 ) table to find the query elements.
    There is also a text table where you can read the component names... but dont have the system at hand, hence cant furnish you that info... I think, it may be RSZELTTXT.
    Also in my opinion the best way to get this information is from metadata repository view in admin workbench.(RSA1). Keep drilling down from the query to its characteristics.. you shall get what you need.
    Also you may use transport connection to display the elements of the query. Just go to the transport connection , in the object list, choose the required query and and transfer it to the collector area. Diplay the elements as a list... you shall then find all your query elements...
    You may not need to traverse through the tables to retrieve this information.
    Hope it helps,
    Best regards,
    Sunmit.

  • Is variable offsets can be used for characteristics, text and formulas?

    hi all,
    can anyone let me know whether variable offsets can be used for characteristics, text and formulas.
    if so cany one send me examples of using offsets to my email id [email protected]
    regds
    hari

    You use offsets on dates (0CALMONTH, 0FISCYEAR, 0DAT and so on) and of course the corresponding texts.
    If you have 0CALMONTH in your query and you want to do the same thing not only for the current month but for the past twelve months, they you just minus 1, 2....11,12 for each selections, and at the same time you can create text variable for the description of each month.
    thanks.
    Wond

  • Validating input values in Entity

    Hi,
    Is there any drawbacks while validating Input values in Entity object ?

    As your business logic remains in the model layer there is always some kind of entity level validation (at least the DB constrains are checked by the DB). There are other validations which don't touch EO at all. One is e.g. input parameters for ViewCriteria which may need to meet some conditions. As there is no EO involved you have to either make the check in the VO before executing the view criteria or you do it on the UI (if you can).
    Some simple checks are always done in the UI (e.r. required).
    So in summary you have to do validation on all levels, it just depends what you want to check. As a rule of thumb all validation which are part of the business logic should be define there (e.g. EO). ADF allows you to simply define such validation which are then enforced on the data.
    Timo

  • How to Swap the Data between 2 characteristics using FOX Code

    Dear All,
    We have a requirement to swap the data between 2 characteristics. I tried to get the data from one characteristics using BPS variable VARV() and another characteristic need to get from craters data. But using OBJV() function it is not working for that.
    If i try to swap the data between characteristics directly, they are not allowing. It says Type is not same, though it is same type as per properties wise.
    Could anybody let me know is it possible to change the characteristics data between characteristics by moving between each other in FOX Formulas. General case it is possible to change the data between same chars.
    Thanking you in advance.
    Kind Regards,
    Ram.
    Edited by: Ram

    Found the answer
    ⌘` the key above the tab.

  • "Message from Webpage (error) There was an error in the browser while setting properties into the page HTML, possibly due to invalid URLs or other values. Please try again or use different property values."

    I created a site column at the root of my site and I have publishing turned on.  I selected the Hyperlink with formatting and constraints for publishing.
    I went to my subsite and added the column.  The request was to have "Open in new tab" for their hyperlinks.  I was able to get the column to be added and yesterday we added items without a problem. 
    The problem arose when, today, a user told me that he could not edit the hyperlink.  He has modify / delete permissions on this list.
    He would edit the item, in a custom list, and click on the address "click to add a new hyperlink" and then he would get the error below after succesfully putting in the Selected URL (http://www.xxxxxx.com), Open
    Link in New Window checkbox, the Display Text, and Tooltip:
    "Message from Webpage  There was an error in the browser while setting properties into the page HTML, possibly due to invalid URLs or other values. Please try again or use different property values."
    We are on IE 9.0.8.1112 x86, Windows 7 SP1 Enterprise Edition x64
    The farm is running SharePoint 2010 SP2 Enterprise Edition August 2013 CU Mark 2, 14.0.7106.5002
    and I saw in another post, below with someone who had a similar problem and the IISreset fixed it, as did this problem.  I wonder if this is resolved in the latest updated CU of SharePoint, the April 2014 CU?
    Summary from this link below: Comment out, below, in AssetPickers.js
    //callbackThis.VerifyAnchorElement(HtmlElement, Config);
    perform IISReset
    This is referenced in the item below:
    http://social.technet.microsoft.com/Forums/en-US/d51a3899-e8ea-475e-89e9-770db550c06e/message-from-webpage-error-there-was-an-error-in-the-browser-while-setting?forum=sharepointgeneralprevious
    TThThis is possibly the same information that I saw, possibly from the above link as reference.
    http://seanshares.com/post/69022029652/having-problems-with-sharepoint-publishing-links-after
    Again, if I update my SharePoint 2010 farm to April 2014 CU is this going to resolve the issue I have?
    I don't mind changing the JS file, however I'd like to know / see if there is anything official regarding this instead of my having to change files.
    Thank you!
    Matt

    We had the same issue after applying the SP2 & August CU. we open the case with MSFT and get the same resolution as you mentioned.
    I blog about this issue and having the office reference.
    Later MSFT release the Hotfix for this on December 10, 2013 which i am 100% positive should be part of future CUs.
    So if you apply the April CU then you will be fine.
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Using a variable value in CDATA for generating an XML type in Oracle

    Hello,
    I have prepared a function given below where I have some input variables & I have to generate one XML with those input variables as tag attribute value:
    create or replace function NEW_PROJECT_DETAILS
    ( p_ReferenceId in varchar2 ,
    p_Project_No in varchar2,
    p_Project_Name in varchar2,
    p_Project_Desc in varchar2 ,
    p_Project_Type in varchar2,
    p_Project_Location in varchar2,
    p_Project_Status in varchar2 )
    return xmltype
    as
    payload xmltype;
    begin
    dbms_output.put_line('Payload Started');
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation><![CDATA[p_Project_Location]]></ProjectLocation>
    /* <ProjectLocation>'||p_Project_Location||'</ProjectLocation> */
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');
    dbms_output.put_line('Payload Comp1');
    return payload;
    end;
    This procedure works absolutely fine.
    Now the problem which I am having is that the variable p_Project_Location has value like "6747:BBO&M SBV".
    Due to the '*&*' in that value I have to use CDATA. But i dont know how to pass this variable directly in the CDATA in the XML.
    Please help me with this asap.
    Thanks & Regards,
    Divya Aggarwal
    Edited by: 784414 on Dec 2, 2010 4:15 AM
    Edited by: 784414 on Dec 2, 2010 4:16 AM

    Hi,
    If you absolutely want to use a CDATA section, then :
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation><![CDATA['||p_Project_Location||']]></ProjectLocation>
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');Alternatively, you can escape non valid characters with DBMS_XMLGEN.CONVERT, e.g. :
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation>'||dbms_xmlgen.convert(p_Project_Location)||'</ProjectLocation>
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');which outputs :
    <?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>1</RefID>
    <ProjectNo>1</ProjectNo>
    <ProjectName>PRJ1</ProjectName>
    <ProjectDesc>This is project 1</ProjectDesc>
    <ProjectType>P</ProjectType>
    <ProjectLocation>6747:BBO&amp;M SBV</ProjectLocation>
    <ProjectStatus>S</ProjectStatus>
    </ProjectDetails>Any basic XML parser should then convert back escaped characters when processing the document.
    You can also use SQL/XML functions, which will take care of that automatically.
    For example :
    SELECT appendChildXML(
            XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
            XMLForest(
             '1'                 as "RefID",
             '1'                 as "ProjectNo",
             'PRJ1'              as "ProjectName",
             'This is project 1' as "ProjectDesc",
             'P'                 as "ProjectType",
             '6747:BBO&M SBV'    as "ProjectLocation",
             'S'                 as "ProjectStatus"
    FROM dual;or,
    SELECT appendChildXML(
            XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
            XMLForest(
             '1'                 as "RefID",
             '1'                 as "ProjectNo",
             'PRJ1'              as "ProjectName",
             'This is project 1' as "ProjectDesc",
             'P'                 as "ProjectType",
             XMLCData('6747:BBO&M SBV') as "ProjectLocation",
             'S'                 as "ProjectStatus"
    FROM dual;

  • Non-Database Item Sort Using Multiple Block Values

    I need to sort the result set of a block based on a calculated item. I found several messages addressing this, however they all speak to using the columns from within the same block as input variables to the function used to calculate the non-database column value.
    My problem is that I need to use values from a different block as input variables. I have not found a way to use them since I need to use the full block.column syntax. Forms does not like this and always thows an error right at the period(.). I need to do this because the column names are the same in each block. the function compares the column values and changes the record instance background a different color based based on how many of the column pairs match. Each block is mutually exclusive from each other and doing a accurate join is not really possible.
    I tried renaming the block column name to something unique, however I get a variable not bound error when I try to use it in the order by function even though their values are in the top most block.
    For Example:
    First Block. Contains a list of cases that need to be worked because the automated process could not find a valid provider based on the values received. This list is created by a background process.
    Table: CASE_MAIN
    TIN
    CASE_ID
    FCLTY_CM
    MEDICARE_CM
    Unrelated Second Block (i.e., no join). It uses the TIN value in the first block to get a list of all of the providers for the TIN associated with the Case so that a person can assign the correct Provider to the case (A TIN has a provider and address associated with it). As a result there is no link to the results of this table and the CASE_ID. That's what the users needs to do manually
    Table: PROVIDER_MAIN
    FCLTY
    MEDICARE
    I need to take the values in the first block and compare them in the second block so that I can recolor the background based on matching logic in the function below.
    order by clause = get_vals( ''||:FCLTY_CM||''
    ,''||:MEDICARE_CM||''
    ,fclty
    ,medicare) desc
    I am able to do the coloring within the form easily, however I need to order them by how many values match exactly so the ones that match to most value pairs show at the top. Hence ordering by the result of the function. I return a 0,1, or 2 based on the matches. 0 for none and 2 for both.
    I cannot create a view because the sources of the information I need to compare are NOT related to each other, yet. that is what the application is designed to do. I have a case without a
    provider assigned, but I have a tax id number that possible identifies the provider. I use this TIN to query the provider table for all of the possible providers under that TIN. As a result there is no link between the case information and provider information. The goal is to get this list compare the values from the target information and put the most likely matches on top, with
    the ones with the most matches first. I can create a function many ways that takes in various parameters. For example Case ID and Provider Id and query the records in subselects
    individually like so;
    select count(*)
    from (select fclty, medicare from case_main where case_id p_case_id) cm
    ,(select fclty, medicare from provider_main where prv_id = p_prv_id) pm
    where cm.fclty = pm.fclty
    and cm.medicare = pm.medicare
    If the number is greater than zero I know I have a match with that provider and I can sort accoringly. I can also pass in the target information from case_main and the provider inforation from provider_main and then do an if/then statement for comparing. Then I can use this function to create a column value for each record and then use the same reference to the function in the order by clause to order by that value.
    The problem comes in trying to reference the case_id or target information from a different block than where the fucntion needs to be used. I get a variable bound not error message. What am I missing here. Why can I not reference a uniquely named block item as a input variable to a function in a different block? Does Forms first figure out what it needs to retrieve and then executes the SQL for each block in isolation, or does the first block's result set get retrieved, then the second, third, etc. Based on the message i am getting I would suspect the former since it appears their is no value in subsequent blocks. If so is there anyway around this? thanks.

    Don't quite understand your problem completely. But this might help. I sure hope your Provider_Main is a single-record block ...otherwise, how would you supply a list of values of FCLTY and MEDICARE to the function that does the sorting? Be awere, too, that the order-by is processed by the server, and NOT by Forms.
    Assuming it is a single-record block, you can put the values into parameters:
    :Parameter.Fclty := :Provider_Main.Fclty;
    :Parameter.Medicare := :Provider.Medicare;
    Execute_Query;
    And your order-by clause would be
    get_vals( ''||:FCLTY_CM||'',''||:MEDICARE_CM||'',
    :Parameter.Fclty,
    :Parameter.Medicare) desc
    By the way, the first line of your order-by looks strange. Shouldn't it be:
    get_vals( FCLTY_CM || ',' || MEDICARE_CM,
    or even better, get_vals should take in 4 parameters:
    get_vals(Fclty_cm, Medicare_cm, :parameter.Fclty, :parameter.Medicare)

  • Need to isolate error with output with valid input (code included)

    Hey guys, this code will be a bit lengthy as I am posting from two separate Java files: Rectangle.java and RectangleTest.java - Basically I am stumped as to why even valid input keeps resulting in this message: System.out.println("\nThis is a SQUARE, not a Rectangle...Quiting...\n"); . Why am I getting this output? I seriously cant figure this out, and really what I am trying to do is take user input for four sets of coordinates, store them, do some simple math with them to determine if the object they form is a Rectangle and not a square. In the long run I am probably doing the whole thing wrong.
    Here is the Rectangle.java code:
    public class Rectangle {
         private int x1,x2,x3,x4,y1,y2,y3,y4;
         private int length;
         private int width;
         public Rectangle ()
              this.x1 = 0;
              this.y1 = 0;
              this.x2 = 0;
              this.y2 = 0;
              this.x3 = 0;
              this.y3 = 0;
              this.x4 = 0;
              this.y4 = 0;
         public Rectangle ( int x1, int x2, int x3, int x4, int y1, int y2, int y3, int y4)
              this.setX1(x1);
              this.setX2(x2);
              this.setX3(x3);
              this.setX4(x4);
              this.setY1(y1);
              this.setY2(y2);
              this.setY3(y3);
              this.setY4(y4);
              // First set x1, y1
              if (x1 > 0 && x1 < 20)
                   setX1(x1);
              else
                   this.x1 = 0;
              if (y1 > 0 && y1 < 20)
                   setY1(y1);
              else
                   this.y1 = 0;
              // Second set x2,y2
              if (x2 > 0 && x2 < 20)
                   setX2(x2);
              else
                   this.x2 = 0;
              if (y2 > 0 && y2 < 20)
                   setY2(y2);
              else
                   this.y2 = 0;
              // Third set x3,y3
              if (x3 > 0 && x3 < 20)
                   setX3(x3);
              else
                   this.x3 = 0;
              if (y3 > 0 && y3 < 20)
                   setY3(y3);
              else
                   this.y3 = 0;
              // Last set x4,y4
              if (x4 > 0 && x4 < 20)
                   setX4(x4);
              else
                   this.x4 = 0;
              if (y4 > 0 && y4 < 20)
                   setY4(y4);
              else
                   this.y4 = 0;
         }// exit constructor
         // Enter methods
         public int getArea()
              return length * width;
         public int getPerimeter()
              return (2*length) + (2*width);
         public boolean isSquare()
              if (length == width)
                    return true;
              else return false;
         public boolean isRectangle()
              if (length != width && length > width)
                    return true;
              else return false;
         // Enter Setters and Getters
         public void setLength(){
              this.length = ((x2-x1)^2 + (y2-y1)^2);
         public int getLength(){
              return length;
         public void setWidth(){
              this.width = ((x4-x1)^2 + (y4-y1)^2);
         public int getWidth(){
              return width;
         public void setX1(int x1) {
              this.x1 = x1;
         public int getX1() {
              return x1;
         public void setX2(int x2) {
              this.x2 = x2;
         public int getX2() {
              return x2;
         public void setX3(int x3) {
              this.x3 = x3;
         public int getX3() {
              return x3;
         public void setX4(int x4) {
              this.x4 = x4;
         public int getX4() {
              return x4;
         public void setY1(int y1) {
              this.y1 = y1;
         public int getY1() {
              return y1;
         public void setY2(int y2) {
              this.y2 = y2;
         public int getY2() {
              return y2;
         public void setY3(int y3) {
              this.y3 = y3;
         public int getY3() {
              return y3;
         public void setY4(int y4) {
              this.y4 = y4;
         public int getY4() {
              return y4;
    Code for RectangleTest.java:
    import java.util.Scanner;
    public class RectangleTest {
         public static void main(String[] args)
              int choice;
              int xFirst, xSecond, xThird, xFourth, yFirst, ySecond, yThird, yFourth;
              Scanner input = new Scanner(System.in);  // Scans or reads the inputs from the keyboard of user
              do {
                   System.out.print("\nTo START Enter '1'; ");
                   System.out.print("\nOr to QUIT Enter '0'; ");
                   choice = input.nextInt();
                   if (choice == 1)
                  // First Set
                  System.out.println("\nPlease enter the FIRST set of Coordinates\n");
                  System.out.print("Enter X1: ");
                  xFirst = input.nextInt();
                  System.out.print("Enter Y1: ");
                  yFirst = input.nextInt();
                  // Second Set
                  System.out.println("\nPlease enter the SECOND set of Coordinates\n");
                  System.out.print("Enter X2: ");
                  xSecond = input.nextInt();
                  System.out.print("Enter Y2: ");
                  ySecond = input.nextInt();
                  // Third Set
                  System.out.println("\nPlease enter the THIRD set of Coordinates\n");
                  System.out.print("Enter X3: ");
                  xThird = input.nextInt();
                  System.out.print("Enter Y3: ");
                  yThird = input.nextInt();
                  // Third Set
                  System.out.println("\nPlease enter the FOURTH set of Coordinates\n");
                  System.out.print("Enter X4: ");
                  xFourth = input.nextInt();
                  System.out.print("Enter Y4: ");
                  yFourth = input.nextInt();
                  // Instantiating the Rectangle class to test it
                  Rectangle rectangle1 = new Rectangle(xFirst, xSecond, xThird, xFourth, yFirst, ySecond, yThird, yFourth);
                  int lengthRectangle1 = rectangle1.getLength();
                  int widthRectangle1 = rectangle1.getWidth();
                  int area = rectangle1.getArea();
                  int periRect = rectangle1.getPerimeter();
                  // Check Shape type
                  if (rectangle1.isRectangle())
                       System.out.println("\nThis is a valid Rectangle\n");
                  else if (rectangle1.isSquare());
                        System.out.println("\nThis is a SQUARE, not a Rectangle...Quiting...\n");
         }while (choice != 0);
         System.out.println("Bye for now!");
    }

    NPP83 wrote:
    Essentially, I am trying to achieve the following:
    1. Store the Cartesian coordinates for the four corners of a Rectangle
    2. Verify that the supplied coordinates (by the user) do infact make a Rectangle and not a Square.
    Since I don't physically have a Length and Width, but just points, I have to use a little math to create a Length and Width and I came up with ((x2-x1)^2 + (y2-y1)^2) to find the length of one side. I thought I would store this as the way to set the Length/Width (setLength & setWidth), but I havent been able to find a way to bridge the user's input in the main() method of the test program to use the values in this formula. Even then, I am not sure if this simple step would at all help validate the object created by the four sets of points is a Rectangle. I thought that a Rectangle might be created by simply by deductive math where if the Length > Width or Length < Width and Width != Length then I would have a what I was looking for.One side is (X2 - X1) the next side is (Y3 - Y2) the 3rd and 4th sides are: (X4 - X3) and (Y4 - Y1).
    Edited by: morgalr on Mar 29, 2010 3:40 PM -- the following comment added:
    You should check out getBounds, it may be what you are looking for.

  • Autosubmit in input text changing other fields

    Hi,
    I have an af:inputText set to autosubmit. When it gets called it is changing the value of an already set selectonechoice to null. This is causing some major issues in usability. Is this normal behavior? I am using JDeveloper 11.1.1.6
    Here is what my page has:
    <af:selectOneRadio label="#{makepaymentviewcontrollerBundle.XX}"
    requiredMessageDetail="#{makepaymentviewcontrollerBundle.YY}"
    id="sor1" showRequired="true"
    required="true" layout="horizontal"
    autoSubmit="true" immediate="true"
    binding="backingBeanScope.YY.sor1"
    value="#{backingBeanScope.YY.paymentMethod}">
    <af:selectItem label="11" value="11" id="si2"/>
    <af:selectItem label="22" value="22" disabled="true"
    id="si1"/>
    </af:selectOneRadio>
    and
    <af:inputText label="#{makepaymentviewcontrollerBundle.11}"
    id="it4"
    validator="#{backingBeanScope.YY.it4_validator}"
    required="true"
    value="#{backingBeanScope.YY.line1}"
    autoSubmit="true" immediate="true" columns="28">
    Is there anyway to avoid the behavior that the input text is changing the values of the radio button in the managed bean ?
    Edited by: 919315 on Mar 16, 2012 12:11 AM
    Edited by: 919315 on Mar 16, 2012 12:14 AM

    The problem seems to be that you have the value for the radio button bound to backing bean scope. The docs say this about backing bean scope:
    backingBeanScope: Used for managed beans for page fragments and
    declarative components only. The object is available for the duration between the
    time an HTTP request is sent until a response is sent back to the client. This scope
    is needed because there may be more than one page fragment or declarative
    component on a page, and to avoid collisions between values, any values must be
    kept in separate scope instances. Use backingBeanScope scope for any
    managed bean created for a page fragment or declarative component.Backing bean scope (and request scope) beans lose their state in between requests.
    John

  • STRUTS: client-side validation in jsp using  DynaValidatorForm

    I am supposed to work on struts on as project and it is like learning a crash course and work the next day.
    In Struts 1.1 enviroment, I am using DynaValidatorForm to create a bean form and then perform validation.
    1. I write a DynaValidatorForm definition in struts-config.xml
    2. I write xml for action so that when /getQuotes.do in invoked by a jsp form, the form data is put into the QuoteDetailsBean.
    3. add the plugin script for ValidatorPlugIn
    xml fragment from struts-config:
    //form bean
    <form-beans>
    <form-bean name="QuoteDetailsBean" type="org.apache.struts.validator.DynaValidatorForm">
        <form-property name="forename" type="java.lang.String"/>
       <form-property name="surname" type="java.lang.String"/>
    <form-bean>
    </form-beans>
    <action
            path="/getQuotes"
            type="com.kainos.quickquotes.struts.QQGetQuotesAction"
            validate="true"
            name="QuoteDetailsBean"
            input="/userform1.do"
            parameter="save"
            scope="session">
            <forward name="success" path="/pages/jsp/result.jsp"/>
            <forward name="back" path="/userform1.do"/>
    </action>
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
         <set-property
             property="pathnames"
             value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
      </plug-in>Now I write a validation code for getQuotes.do. note that I can write the validation code with
    <form name="QuoteDetailsBean"> but this form bean is shared by many jsp, so i am using the name of the action
    (getQuotes) as the name of the form in the validation.xml.
    So far this looks okay, as I am going by some example.
    xml fragment from validation.xml:
    <formset>
              <form name="/getQuotes">
                 <field property="forename" depends="required,minlength">
                    <arg0 key="QuoteDetailsBean.forename" />
                    <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                    <var>
                       <var-name>minlength</var-name>
                       <var-value>2</var-value>
                    </var>
                 </field>
                 <field property="surname" depends="required,minlength">
                <arg0 key="QuoteDetailsBean.surname" />
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <var>
                   <var-name>minlength</var-name>
                   <var-value>2</var-value>
                </var>
                 </field>
    </formset>Now I write the JSP. I use the <html:javascript> tag to allow front-end validation based on the xml in validation.xml.
    The jsp code:
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <html:html locale="true">
    <head>
    <title><bean:message key="welcome.title"/></title>
    <html:base/>
    <html:javascript formName="/getQuotes"
                method="validateForm"
                dynamicJavascript="true"
                staticJavascript="false"
                cdata="false" />
    </head>
    <body bgcolor="#FFCC9F">
    <html:errors />
    <html:form action="getQuotes.do" onsubmit="return validateForm(this);" >
    Forename:</td> <td>���<html:text property="forename"/></td></tr>
    <tr> <td>Surname:</td> <td>���<html:text property="surname"/></td></tr>
    <html:submit value="Quotes" /></td></tr>
    </html:form>
    </body>
    </html:html>Does this looks okay. I wrote so far based on some tutorials n help online.
    Now when I open the JSP and then do a submit, there is no validation (I tried by submitting with empty forename and surname. I mean i could invoke the action class and the invoke class
    redirects(forwards) to the appropriate path. so the code works fine except validation is not done
    Q1. So what should i do more to get client-side validation?
    What actually happens in client-side validation? does a pop up alert appears?
    nothing happens so far in my case.
    Q2. What should I do more for server side validation. Since the form is incomplete, what happens?
    I thought the same form returns and the error messages are printed in the jsp page since i have the <html:errors />
    tag just below the <body> tag.
    The action class is pretty simple so far:
    public class QQGetQuotesAction extends Action {
        public QQGetQuotesAction(){
    public ActionForward execute(ActionMapping mapping,
                 ActionForm form,
                 HttpServletRequest request,
                 HttpServletResponse response)
        throws Exception {
            DynaValidatorForm dynaform = (DynaValidatorForm)form;
            System.out.println("forename:"+dynaform.get("forename");
            System.out.println("surname:"+dynaform.get("surname");
            return forward=mapping.findForward("back");
    }Please help me out. I think I am missing something which i need to do
    thanks
    Tanveer

    I think the validations are to be declared on the form
    name and not the action path.
    Your formName is QuoteDetailsBean but your are using
    the action path(/getQuotes) both in the validation
    rules and the jsp tags. Use the formName on both the
    places.
    Also your html:javascript tag will not generate the
    static javascript to validate the fields. For this you
    will have to add code like below.
    <html:javascript dynamicJavascript="false"
    staticJavascript="true"/>
    Other options is to set the attribute
    staticJavascript="true" in your html:javascript tag.
    Hope it helps.hi
    staticJavascript="true" did the trick. :)
    I think the validations are to be declared on the form name and not the action path.It is not necessary. You can declare the validation on the action class. This is essential if a form bean is shared by several JSPs having its own action class. This is as per as I read in a tutorial and it works.

Maybe you are looking for

  • Safari 4 Loses Webpage Color with External Monitor

    Hey All, So I have a Dell 22 inch monitor plugged in with my MacBook Pro. When ever it is plugged in and I run safari the second I start scrolling down on a page the color fades. If I hit to select all then the color reappears. I only noticed this st

  • Dreamweaver 8 - Height of tables keeps changing when images added to another table

    Greetings! i have a rather annoying problem on my hands with dreamweaver. Currently for a small college project i am being asked to design a small yet effective website to show students in the future what will be expected. So i've drawn up my templat

  • Update PHP with IMAP (installing SugarCRM on 10.5.4)

    I have seen parts of this covered before for 10.4.x but i am now trying to include c-client on 10.5.4. see http://discussions.apple.com/thread.jspa?messageID=4598819&#4598819 I get sugar installed fine but on OSX when i try and set up mail it gives m

  • CSS difference in Integrated Weblogic and Development Server

    I'm using JDeveloper 11.1.1.2.0 I noticed that when i was developing in my Integrated WLS, CSS and inline Styles was just working the way it was showing up when i was running tests on my app. But the moment it was deployed in a development server, in

  • Premiere Pro CC won't play audio from video file

    I've been trying to edit videos recorded with Bandicam in Premiere Pro CC. The video file itself is fine, when I play it in Windows Media Player it all checks out, but once I get it into a sequence in Premiere Pro CC despite it showing the audio trac