Doesn't return true value .........

Hi All,
please check the following code.
password (originalPassword) from the database is : xyz
password (password) from the login page is : xyz
when I try for equality for the password :
if(originalPassword.equalsIgnoreCase(password)) {
it doesn't return true value while the password is same that is : xyz ?
I an stuck in the problem.
Please look into the code and solve my problem.
Thanks
public boolean verifyPassword(String username, String password) {
        String originalPassword=null;
        try {
            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
           Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://sqlserver:1433","harish","harish");
           PreparedStatement pstmt = con.prepareStatement("select password from registration where username='"+username+"'");          
           //ResultSet rs = pstmt.getResultSet();
           ResultSet rs = pstmt.executeQuery();
           if(rs.next()) {
               originalPassword=rs.getString(1);              
           pstmt.close();
           if(originalPassword.equalsIgnoreCase(password)) {
                          return true;
           } else {
               return false;
       } catch (Exception e){
           System.out.println("Exception: verifyPassword="+e);
           return false;
     Harish Pathak

Are you sure there's no space before or after "xyz"? Try adding some debug output to your code:
if(originalPassword.equalsIgnoreCase(password)) {
  //foo
} else {
  System.out.println("<" + password + "> does not match <" + originalPassword + ">");
}

Similar Messages

  • Apex 2.2 popup lov doesn't return chosen value

    Hey,
    I've built a page within one of my applications in apex 2.2 that has an item based on a Popup LOV. I have a pre-built dynamic LOV.
    When I run the page the popup icon appears and I can launch the popup. The filters work, and the result set appears. However, if I attempt to click on a value, nothing happens. The window remains opened and no value is returned to the parent window. The browser window shows no sign of javascript errors.
    I'm using Theme 11 and the standard popup template.
    I've tried this is a different workspace, using the same lov sql etc, and it works ok!
    I've tried it elsewhere in a new page within my problematic application, and the problem is replicated there too.
    What could be going wrong?
    Cheers,
    John

    Hi,
    I have to create a page , with dynamic Popup using query. I am using APEX_ITEM.POPUP_FROM_QUERY(). Dynamic popup is generated, i can able to open the popup, when i click the link of the generated records. It does not return the value.
    I feel that , it's like your error.
    could you please help me ou.t
    Thanks
    kam

  • What if a function doesn't return a value, and expected to hang.

    Hi, i'm using D2K, 6i forms.
    i've a function something like this:
    /* Function returns current slno for a transaction.
    create or replace function gen_auto_slno_fn
    (doc_vr varchar2,
    branch_vr varchar2)
    return varchar IS
    genslno VARCHAR2(15) ;
    BEGIN
    BEGIN
    SELECT lpad((nvl(SLNO,0)+1),5,0)
    INTO genslno
    FROM GEN_SLNO
    WHERE doc_name = doc_vr
    AND BRANCH_CODE=branch_vr;
    return(genslno);
    EXCEPTION
    WHEN no_data_found then
    Dbms_output.put_line('No data found in General Serial number for '||doc_vr);
    raise_application_error(-20100,sqlerrm);
    END;
    END;
    My problem is:
    suppose if such branch_code does not exist, then
    it will go exception part.
    I was expecting the 'No data ...error message ' in my forms.
    but Instead of that a message such as 'Unhandled exception occurs.
    I also tried returning a value like :
    EXCEPTION
    WHEN no_data_found then
    Dbms_output.put_line('No data found in General Serial number for '||doc_vr);
    return('ERROR');
    --raise_application_error(-20100,sqlerrm);
    END;
    It was working then.
    My question is: how do I display the whole error message on my form and raise form_trigger_failure ?
    ( also the one in the subject line!)
    Message was edited by:
    abhijithdev

    A comment on using exception handlers and raising exceptions.
    WHEN no_data_found then
      Dbms_output.put_line('No data found in General Serial number for '||doc_vr);
      raise_application_error(-20100,sqlerrm); DBMS_OUTPUT is superfluous and meaningless in production code. It should not be there... and if debugging is required, then it is easy to make it vastly superior than the very primitive DBMS_OUTPUT interface.
    Ditto for RAISE_APPLICATION_ERROR. Calling this system procedure directly, does not support logging and tracing and troubleshooting and debugging problems.
    One of the basic (I would call it the very most basic) rules in software development is to modularise. This includes wrapping system calls into wrappers - that allows additional flexibility and makes maintenance and development a lot easier.
    Instead of calling RAISE_APPLICATION_ERROR, create a wrapper PL/SQL procedure called something like RaiseException().
    Input parameters would typically be an error message number. The message for the error can also be passed.. though I prefer to have a message array (static PL/SQL var) that can be used to lookup the error message for that error code.
    As all exceptions are now raised via a single proc that you control, you can easily add debug information to it. Log the exception (using an autonomous transaction) in a log table. Add the PL/SQL call stack to the message. Write an error to the alert log for those real critical fubar errors. Call DBMS_OUTPUT if need be. Even send the error message to a DBMS_PIPE for an error console to pick up and display interactively.
    Designing and coding wrappers for system calls are a critical cornerstone of an application that is flexible and easy to maintain and extend.

  • APEX 4.0.1: $v() function doesn't return multiple values for checkbox?

    Hello,
    I have a report that uses apex_item.checkbox(...) to generate checkbox. This report correctly displays a checkbox for each row. The source code generated in the html page is:
    <input type="checkbox" name="f01" value="202" id="P1_CHECKBOX" />
    <input type="checkbox" name="f01" value="220" id="P1_CHECKBOX" />
    <input type="checkbox" name="f01" value="210" id="P1_CHECKBOX" />
    I want to use the javascript function $v() to get the values of the checked checkbox. I thought that this function return the values of all the checked checkbox separated by ':' but I notice that my code alert($v('P1_CHECKBOX')); returns each time only the value of the first checkbox if it is checked.
    It returns '202' if the first checkbox is checked but nothing if only the second checkbox is checked and '202' if the first and second checkbox are checked.

    Hi,
    first of all, $v, $x and $s are suppose to only work for page items and not for tabular form columns or manually generated HTML elements.
    Second, I think your HTML code is not correct, because each of your checkboxes has the same ID. But the ID has to be unique in the browser DOM tree. So the different checkbox elements should actually be named P1_CHECKBOX_1 .. P1_CHECKBOX_3. Just have a look what is actually generated for a real checkbox page item. BTW, I think you shouldn't name these checkbox elements like a page item, because they are actually not page items. I think that could be confusing for other developers.
    Hope that helps
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • SAPBEXgetConnection doesn't return proper values when BEX is open via RRMX

    had to put a lot of interactivity in some workbook based on the user profile and going far beyond the simple authorisation objects.
    Following the advice of some specialists such as Peter Knoer, I used the following code to get the user connection details:
    <i>Set myConnection = Run("SAPBEX.XLA!SAPBEXgetConnection")
    With myConnection ' call the connection
    Sheets("BAPI").Cells(27, 2).Value = myConnection.Client
    Sheets("BAPI").Cells(28, 2).Value = myConnection.User
    Sheets("BAPI").Cells(29, 2).Value = myConnection.language
    Sheets("BAPI").Cells(30, 2).Value = myConnection.SystemNumber
    Sheets("BAPI").Cells(31, 2).Value = myConnection.System
    Sheets("BAPI").Cells(32, 2).Value = myConnection.ApplicationServer
    End With</i>
    Everything works fine as long as the user first launch BEX and connect directly in BEX.
    This command function fails if BEX is launch from SAP EasyAccess Menu via the RRMX transaction.
    Any clue why this function does not work in the case of a launch via RRMX?
    I tried several alternative, is there a better Function to use to get all the user connection details in this case?
    thanks for your insights on this point.

    Hi Peter,
    why do I need to test what is the current login?
    I had the request to make truly dynamic workbook based on user profile: logo, workbook label based on user language  etc.
    To do so, I need to pass either the user name or the system number or the language to two RFC/BAPI functions from excel. Have a look at the complete macro below:
    +Sub BAPIUserDetail()
    'Declaration for the necessary objects
    Dim myConnection, myConnection2, objLogonControl, objBAPIControl, objConnection, objUserDetail, objUserName, objTranslation, objTranslationTable As Object
    Dim objTranslationDelimiter As Object
    Dim objTranslationOptions As Table
    Sheets("BAPI").Range("B27:B33").Value = ""
    Set myConnection = Run("SAPBEX.XLA!SAPBEXgetConnection")
    With myConnection ' call the connection
    Sheets("BAPI").Cells(27, 2).Value = myConnection.Client
    Sheets("BAPI").Cells(28, 2).Value = myConnection.User
    Sheets("BAPI").Cells(29, 2).Value = myConnection.language
    Sheets("BAPI").Cells(30, 2).Value = myConnection.SystemNumber
    Sheets("BAPI").Cells(31, 2).Value = myConnection.System
    Sheets("BAPI").Cells(32, 2).Value = myConnection.ApplicationServer
    '.UseSAPLogonIni = False 'important for automatic connection
    '.Logon 0, True ' This will provide a dialog to appear
    'If .IsConnected <> 1 Then
    '.Logon 0, False
    'If .IsConnected <> 1 Then Exit Sub
    'End If
    End With
    'Run "sapbex.xla!sapbexinit"
    ' if the user launch bex via SAPGUI easyaccess, sometimes the connection parameter fails
    Dim objVerifyConnection As String
    objVerifyConnection = Sheets("BAPI").Cells(27, 2).Value
    If objVerifyConnection = "" Then
    'Close completely the connection to BW !
    Run "sapbex.xla!dialOut", True, True
    'We warn-out the user that BEX connection is not correct
    MsgBox "ATTENTION: Les Parametres de Connection de votre BEX ne sont pas correctement transmis depuis votre SAPGUI. Veuillez vous reconnecter et relancer la derniere requête."
    'We recreate a new connection via SAPlogon dialog and relaunch the first query in the sequence of SAPBEXqueries worksheet
    Dim r As Range
    Set r = Range("SAPBEXqueries!SAPBEXq0003")
    Run "sapbex.xla!SAPBEXrefresh", False, r
    'We get another time all the connection parameter in the BAPI sheet
    Set myConnection2 = Run("SAPBEX.XLA!SAPBEXgetConnection")
    With myConnection2 ' call the connection
    Sheets("BAPI").Cells(27, 2).Value = myConnection2.Client
    Sheets("BAPI").Cells(28, 2).Value = myConnection2.User
    Sheets("BAPI").Cells(29, 2).Value = myConnection2.language
    Sheets("BAPI").Cells(30, 2).Value = myConnection2.SystemNumber
    Sheets("BAPI").Cells(31, 2).Value = myConnection2.System
    Sheets("BAPI").Cells(32, 2).Value = myConnection2.ApplicationServer
    End With
    End If
    'Create automatic connection for the user USER_BAPI to gather the Entity and Logo parameters linked to the user connected
    Set objBAPIControl = CreateObject("SAP.Functions") 'Create ActiveX object
    'Specify user
    objBAPIControl.Connection.User = "USER_BAPI"
    'Then password
    objBAPIControl.Connection.Password = "BOUYGUES"
    'Client
    objBAPIControl.Connection.Client = Sheets("BAPI").Cells(27, 2).Value
    'Target server address
    objBAPIControl.Connection.ApplicationServer = Sheets("BAPI").Cells(32, 2).Value
    'Language code
    objBAPIControl.Connection.language = Sheets("BAPI").Cells(29, 2).Value
    'System ID
    objBAPIControl.Connection.System = Sheets("BAPI").Cells(31, 2).Value
    'System Number
    objBAPIControl.Connection.SystemNumber = Sheets("BAPI").Cells(30, 2).Value
    'Finally, try to logon to the specified system and check if the connection established
    If objBAPIControl.Connection.Logon(0, True) <> True Then
    MsgBox "Cannot Log on to SAP" 'Issue message if cannot logon
    Else
    '  MsgBox "Logged on to SAP!"
    End If
    On Error Resume Next
    ' BAPI_USER_GET_DETAIL to get the user's parameter1 values
    Set objUserDetail = objBAPIControl.Add("BAPI_USER_GET_DETAIL")
    Set objUserName = objUserDetail.exports("USERNAME")
    objUserName.Value = Sheets("BAPI").Cells(15, 2).Value
    ' Function call
    objUserDetail.call
    ' Getting the result set in a table
    Dim objTable As Table
    Set objTable = objUserDetail.Tables("PARAMETER1")
    ' Printing the number of company codes
    'MsgBox "Row count :" & objTable.RowCount
    Sheets("BAPI").Cells(16, 2) = objTable.RowCount
    ' Clearing the PARAMETER1 Table on the Excel Sheet
    Sheets("BAPI").Range("A18:C25").Value = ""
    ' Saving the PARAMETER1 Table to the Excel Sheet
    For i = 1 To objTable.RowCount
    Sheets("BAPI").Cells(17 + i, 1) = objTable.Cell(i, 1)
    Sheets("BAPI").Cells(17 + i, 2) = objTable.Cell(i, 2)
    Next i
    'if any error then displaying the same to the users
    If Err Then
        MsgBox Err.Description
    End If
    ' Determine the standard SAP language code
    Dim language As String
    language = Sheets("BAPI").Cells(29, 2).Value
    Select Case language
    'FR
    Case "FR"
    Sheets("BAPI").Cells(16, 5).Value = "F"
    'EN
    Case "EN"
    Sheets("BAPI").Cells(16, 5).Value = "E"
    'DE
    Case "DE"
    Sheets("BAPI").Cells(16, 5).Value = "D"
    'ES
    Case "ES"
    Sheets("BAPI").Cells(16, 5).Value = "S"
    'Empty Language
    Case ""
    Sheets("BAPI").Cells(16, 5).Value = "F"
    Case Else
    Sheets("BAPI").Cells(16, 5).Value = "F"
    End Select
    ' RFC_READ_TABLE to get all the translation for the text label according to user preference
    Set objTranslation = objBAPIControl.Add("RFC_READ_TABLE")
    Set objTranslationTable = objTranslation.exports("QUERY_TABLE")
    objTranslationTable.Value = Sheets("BAPI").Cells(8, 5).Value
    Set objTranslationDelimiter = objTranslation.exports("DELIMITER")
    objTranslationDelimiter.Value = Sheets("BAPI").Cells(10, 5).Value
    Set objTranslationSkips = objTranslation.exports("ROWSKIPS")
    objTranslationSkips.Value = "0"
    Set objTranslationCount = objTranslation.exports("ROWCOUNT")
    objTranslationCount.Value = "0"
    'Define the filters for the OPTIONS table
    Dim area As String
    Dim langu As String
    area = Sheets("BAPI").Cells(14, 5)
    langu = Sheets("BAPI").Cells(16, 5)
    Set objTranslationOptions = objTranslation.Tables("OPTIONS")
    objTranslationOptions.AppendRow
    objTranslationOptions(1, "TEXT") = "AREA = '" & area & "' AND LANGU = '" & langu & "'"
    ' Function call
    objTranslation.call
    ' Getting the result set in a table
    Dim objTTable As Table
    Set objTTable = objTranslation.Tables("DATA")
    ' Printing the number of company codes
    'MsgBox "Row count :" & objTTable.RowCount
    Sheets("BAPI").Cells(12, 5) = objTTable.RowCount
    ' Clearing the  Table on the Excel Sheet
    Sheets("BAPI").Range("G7:Z10000").Value = ""
    ' Saving the  Table to the Excel Sheet
    For i = 1 To objTTable.RowCount
    Sheets("BAPI").Cells(6 + i, 7) = objTTable.Cell(i, 1)
    Next i
    'Convert to column the semicolon delimited text from the
    Dim objRange1 As Range
        'Set up the ranges
        Set objRange1 = Sheets("BAPI").Range("G7:G10000")
        'Do the first parse
        objRange1.TextToColumns _
          Destination:=Range("G7"), _
          DataType:=xlDelimited, _
          Tab:=False, _
          Semicolon:=True, _
          Comma:=False, _
          Space:=False, _
          Other:=False, _
          OtherChar:="-"
    'Replace the * by the € symbol, there is a pb with this caracter in the RFC_READ_TABLE
      Dim Cell As Variant
        For Each Cell In Sheets("BAPI").Range("K7:K1000")
            Cell.Value = Replace(Cell.Value, "*", "€")
        Next Cell
    'Insert logo in the BAPI worksheet
    Dim objPic As Object
    Dim ApplicationServer As String
    Dim logo As String
    ApplicationServer = Sheets("BAPI").Cells(32, 2).Value
    logo = Sheets("BAPI").Cells(20, 5).Value
    If logo = "Langue!" Then
    MsgBox "Attention: Il n'y a pas d'Entité et de Logo associés à votre profile! Veuillez contacter votre Administrateur."
    Else
    'Assign inserted image to an object
    Set objPic = Worksheets("BAPI").Pictures.Insert("http://" & ApplicationServer & ".bouygues-construction.com:8000/sap/bw/Mime/BEx/Bouygues%20Logos/" & logo & ".gif")
    objPic.Left = 400
    objPic.Top = 300
    objPic.Name = "MyLogo"
    objPic.Height = 100
    ' using the name reference to change width
    'Worksheets("BAPI").Shapes("MyLogo").Width = Worksheets("BAPI").Shapes("MyLogo").Width / 4
    'if any error then displaying the same to the users
    'Insert logo in the BAPI worksheet
    Dim objMainPic As Object
    'Dim ApplicationServer As String
    'Dim logo As String
    'ApplicationServer = Sheets("BAPI").Cells(32, 2).Value
    'logo = Sheets("BAPI").Cells(20, 5).Value
    'Assign inserted image to an object
    Set objMainPic = Worksheets("TBD dynamique").Pictures.Insert("http://" & ApplicationServer & ".bouygues-construction.com:8000/sap/bw/Mime/BEx/Bouygues%20Logos/" & logo & ".gif")
    objMainPic.Left = 30
    objMainPic.Top = 30
    objMainPic.Name = "MyMainLogo"
    'objMainPic.Height = 100
    ' using the name reference to change width
    Worksheets("TBD dynamique").Shapes("MyMainLogo").Width = Worksheets("TBD dynamique").Shapes("MyMainLogo").Width * 0.9
    End If
    If Err Then
        MsgBox Err.Description
    End If
    'log off for the USER_BAPI
    objBAPIControl.Connection.Logoff
    End Sub+
    But as I said the SAPBEXgetConnection  does not behave the same way if login is done directly done in BEX or via RRMX. Any Clue?

  • LOV doesn't return selected value to the base page

    Hi All,
    I have created an LOV based on VO. When I select value on the LOV page, it is not returning the selected value to the base page.
    I am getting the error when I select any value .
    Error
    You are trying to access a page that is no longer active.
    - The referring page may have come from a previous session. Please select Home to proceed.
    Can anyone please guide me which property has to be set.
    Thanks,
    Edited by: user4482525 on Apr 21, 2009 11:49 PM

    1> Go to the About this page* of the page and check whether page Root AM is extended or not?
    If the page root AM is extended then delete the extension by jdr_util.deleteDocument or using functional Adminstartor
    or
    2> See in the LOV CO, if you are using the method "releaseApplicationModule"
    If yes , then remove this.
    Thanks,
    Kumar

  • Click on a cell in formula doesn't return value, only text. why?

    When doing a simple formula like =c4-c5 in one of my sheets, when i click on the cell, it doesn't return the value, only text.
    What setting do i have enabled/disabled?
    thanks
    hamdog

    HI Hamdog,
    What you are seeing is the formula that is in that cell.
    The setting you have turned on is the first one in the bottom section of the General page of Numbers Preferences. In the English versions, it looks like this:
    With the checkbox unchecked (as mine is), the formula would read:
    =L10-P10
    Column L is labeled "Tips", Column P is labeled "Lenka", Row 10 is labeled "9. 2. 2013"
    To Copy and Paste the result, 462, click (once) on the cell and Copy, then click (once) on the cell where you want to paste the result and go Edit > Paste Values. This should be the seventh item (not including the separator line) in the Edit menu.
    Regards,
    Barry
    Regards,
    Barry

  • Query with subquery containing group clause doesn't return any rows - WHY ?

    Hi,
    My query doesn't return any values :
    select g1.NTRX from gtrx g1
    where exists
    (SELECT b.cfunctrx, b.cpro1trx, b.nmsgitrx, b.nmrc, b.ncrd, b.namtstrx,
    b.dltimtrx, b.nrtrftrx,count(*)
    FROM gtrxacq a, gtrx b
    WHERE a.ntrx = b.ntrx AND a.acq_bus_date = (SELECT curr_bus_date -1
    FROM gmbr
    WHERE nmbr = 0)
    and g1.NTRX=b.NTRX
    GROUP BY b.cfunctrx,
    b.cpro1trx,
    b.nmsgitrx,
    b.nmrc,
    b.ncrd,
    b.namtstrx,
    b.dltimtrx,
    b.nrtrftrx
    HAVING COUNT (*) > 1);
    but such query returns some number of rows :
    SELECT b.cfunctrx, b.cpro1trx, b.nmsgitrx, b.nmrc, b.ncrd, b.namtstrx,
    b.dltimtrx, b.nrtrftrx,count(*)
    FROM gtrxacq a, gtrx b
    WHERE a.ntrx = b.ntrx AND a.acq_bus_date = (SELECT curr_bus_date -1
    FROM gmbr
    WHERE nmbr = 0)
    /*and g1.NTRX=b.NTRX*/
    GROUP BY b.cfunctrx,
    b.cpro1trx,
    b.nmsgitrx,
    b.nmrc,
    b.ncrd,
    b.namtstrx,
    b.dltimtrx,
    b.nrtrftrx
    HAVING COUNT (*) > 1
    AND when i put results from query above into query :
    select g1.NTRX from gtrx g1
    where
    g1.CFUNCTRX= 200 and g1.CPRO1TRX= 000 and g1.NMSGITRX= 1240 and
    g1.NMRC= '000000000000675' and g1.NCRD= 405671**********
    and g1.NAMTSTRX=14.26 and g1.DLTIMTRX=to_date('07/08/2008 15:07:02','MM/DD/YYYY HH24:MI:SS')
    and g1.NRTRFTRX= '000414598393';
    it returns values.
    what is wrong ?
    Best Regards Arkadiusz Masny

    but such query returns some number of rows :
    /*and g1.NTRX=b.NTRX*/Add b.NTRX into group by and recheck.

  • MB52 doesn't show return quantyties values

    Dear experts
    After sales return, the qty shows under 'Returns'. But in MB51, corrosponding values are not shown under any column. can anybody guide on this issue, where i can see the return qty values? or in sap, return values doesn;t show in MB51?
    Thanks
    Venugopal

    Hi,
    This looks like a bug. A workaround is to set snapInterval=.1 as well as stepSize. Could you please log a bug on https://bugs.adobe.com/flex/?
    Thanks,
    -Kevin

  • How do I return a true value for multiple expressions?

    Hi, I hope this question makes sense...
    In, for example, cell A1, I would like to return a True value when:
    C1>B1, and
    C2>B2, and
    C3>B3, and
    C4>B4, and
    C5>B5
    That is, if all column C values are greater than all corresponding column B values, then I would like to return a True value in cell A1.
    If one or more C values are less than or equal to their corresponding B values, e.g. B4<=C4, then I would like to return a False value in cell A1.
    Can this be achieved using a single formula in cell A1? If so what would that formula be?
    Thanks

    In column D I will insert the formula:
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",IF(C>B,"",1))
    In A1 I will insert:
    =SUM(D)<0
    or
    in column D
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",C>B)
    in A1
    =COUNTIF(D,FALSE)=0
    Yvan KOENIG (from FRANCE mardi 2 septembre 2008 12:11:28)

  • [UIX] How To: Return multiple values from a LOV

    Hi gang
    I've been receiving a number of queries via email on how to return multiple items from a LOV using UIX thanks to earlier posts of mine on OTN. I'm unfortunately aware my previous posts on this are not that clear thanks to the nature of the forums Q&A type approach. So I thought I'd write one clear post, and then direct any queries to it from now on to save me time.
    Following is my solution to this problem. Please note it's just one method of many in skinning a cat. It's my understanding via chatting to Oracle employees that LOVs are to be changed in a future release of JDeveloper to be more like Oracle Forms LOVs, so my skinning skills may be rather bloody & crude very soon (already?).
    I'll base my example on the hr schema supplied with the standard RDBMS install.
    Say we have an UIX input-form screen to modify an employees record. The employees record has a department_id field and a fk to the departments table. Our requirement is to build a LOV for the department_id field such that we can link the employees record to any department_id in the database. In turn we want the department_name shown on the employees input form, so this must be returned via the LOV too.
    To meet this requirement follow these steps:
    1) In your ADF BC model project, create 2 EOs for employees and departments.
    2) Also in your model, create 2 VOs for the same EOs.
    3) Open your employees VO and create a new attribute DepartmentName. Check “selected in query”. In expressions type “(SELECT dept.department_name FROM departments dept WHERE dept.department_id = employees.department_id)”. Check Updateable “always”.
    4) Create a new empty UIX page in your ViewController project called editEmployees.uix.
    5) From the data control palette, drag and drop EmployeesView1 as an input-form. Notice that the new field DepartmentName is also included in the input-form.
    6) As the DepartmentName will be populated either from querying existing employees records, or via the LOV, disable the field as the user should not have the ability to edit it.
    7) Select the DepartmentId field and delete it. In the UI Model window delete the DepartmentId binding.
    8) From the data controls palette, drag and drop the DepartmentId field as a messageLovInput onto your page. Note in your application navigator a new UIX page lovWindow0.uix (or similar) has been created for you.
    9) While the lovWindow0.uix is still in italics (before you save it), rename the file to departmentsLov.uix.
    10) Back in your editEmployees.uix page, your messageLovInput source will look like the following:
    <messageLovInput
        model="${bindings.DepartmentId}"
        id="${bindings.DepartmentId.path}"
        destination="lovWindow0.uix"/>Change it to be:
    <messageLovInput
        model="${bindings.DepartmentId}"
        id="DepartmentId"
        destination="departmentsLov.uix"
        partialRenderMode="multiple"
        partialTargets="_uixState DepartmentName"/>11) Also change your DepartmentName source to look like the following:
    <messageTextInput
        id=”DepartmentName”
        model="${bindings.DepartmentName}"
        columns="10"
        disabled="true"/>12) Open your departmentsLov.uix page.
    13) In the data control palette, drag and drop the DepartmentId field of the DepartmentView1 as a LovTable into the Results area on your page.
    14) Notice in the UI Model window that the 3 binding controls have been created for you, an iterator, a range and a binding for DepartmentId.
    15) Right click on the DepartmentsLovUIModel node in the UI Model window, then create binding, display, and finally attribute. The attribute binding editor will pop up. In the select-an-iterator drop down select the DepartmentsView1Iterator. Now select DepartmentName in the attribute list and then the ok button.
    16) Note in the UI Model you now have a new binding called DCDefaultControl. Select this, and in the property palette change the Id to DepartmentName.
    17) View the LOV page’s source, and change the lovUpdate event as follows:
    <event name="lovSelect">
        <compound>
            <set value="${bindings.DepartmentId.inputValue}" target="${sessionScope}" property="MyAppDepartmentId" />
            <set value="${bindings.DepartmentName.inputValue}" target="${sessionScope}" property="MyAppDepartmentName" />
        </compound>
    </event>18) Return to editEmployees.uix source, and modify the lovUpdate event to look as follows:
    <event name="lovUpdate">
        <compound>
            <set value="${sessionScope.MyAppDepartmentId}" target="${bindings.DepartmentId}" property="inputValue"/>
            <set value="${sessionScope.MyAppDepartmentName}" target="${bindings.DepartmentName}" property="inputValue"/>     
        </compound>
    </event>That’s it. Now when you select a value in your LOV, it will return 2 (multiple!) values.
    A couple things to note:
    1) In the messageLovInput id field we don’t use the “.path” notation. This is mechanism for returning 1 value from the LOV and is useless for us.
    2) Again in the messageLovInput we supply “_uixState” as an entry in the partialTargets.
    3) We are relying on partial-page-refresh functionality to update multiple items on the screen.
    I’m not going to take the time out to explain these 3 points, but it’s worthwhile you learning more about them, especially the last 2, as a separate exercise.
    One other useful thing to do is, in your messageLovInput, include as a last entry in the partialTargets list “MessageBox”. In turn locate the messageBox control on your page (if any), and supply an id=”MessageBox”. This will allow the LOV to place any errors raised in the MessageBox and show them to the user.
    I hope this works for you :)
    Cheers,
    CM.

    Thanks Chris,
    It took me some time to find the information I needed, how to use return multiple values from a LOV popup window, then I found your post and all problems were solved. Its working perfectly, well, almost perfectly.
    Im always fighting with ADF-UIX, it never does the thing that I expect it to do, I guess its because I have a hard time letting go of the total control you have as a developer and let the framework take care of a few things.
    Anyway, I'm using your example to fill 5 fields at once, one of the fields being a messageChoice (a list with countries) with a LOV to a lookup table (id , country).
    I return the countryId from the popup LOV window, that works great, but it doesn't set the correct value in my messageChoice . I think its because its using the CountryId for the listbox index.
    So how can I select the correct value inside my messageChoice? Come to think of it, I dont realy think its LOV related...
    Can someone help me out out here?
    Kind regards
    Ido

  • Agilent 34970A doesn't return error when it should

    See attached subvi. When I run this in my main vi and enter nothing in the RELAY string control (which is the required scanlist for the Agilent) and click RESET, the Agilent, as expected, beeps and displays an error on the front panel but the error status in this vi doesn't go true. Why not? (The Agilent Initialize.vi occurs before this vi is run in the main vi.)
    Attachments:
    RESET.vi ‏20 KB

    Why should there be an error returned? There is no error in writing or reading. You are not doing an error query of the instrument.
    If you were to use the driver, you would find the error query function and you could place that in your code to check to see if you have sent an illegal command. What would be better though, would be to ensure that the value that is entered into the string is valid before wasting the time with the VISA Write and Read. An empty string should never be allowed to exit the while loop.

  • CI - Powershell Boolean Rule Always Returns True

    I'm trying to create a configuration baseline / item for a particular piece of software using a powershell script of data type Boolean. However, I'm having the issue that the evaluation is always returning compliant whether the workstation is or not. The
    script is as follows:
    $ErrorActionPreference = "SilentlyContinue"
    $Condition1 = (Test-Path -LiteralPath 'HKLM:\SOFTWARE\Adobe\Premiere Pro')
    $Condition2 = (Test-Path -LiteralPath 'C:\Program Files\Adobe\Adobe Premiere Pro CS6\Presets\Textures\720_govt1_bar.png')
    if ($Condition1) {
    if ($Condition2) {echo $true}
    else {echo $false}
    else {echo $true}
    This script works perfectly fine when run locally and always returns $true or $false as expected. However it only ever returns Compliant when used in a CI. It doesn't matter what the state of the 2 conditions are, it always evaluates Compliant.
    Any ideas?

    I'm beginning to wonder if there is variation between how well this feature works on Windows 7 and Windows 8.1. I'm beginning to notice that it usually works well on 7 but I have constant hell with it on 8. The last thing I tried which seemed to work (assuming
    it was not just randomness) was accepting the default "Platform" settings of the CI/CB. Before I had chosen Windows 7 and 8.1 only and was never able to return any value except Compliant on 8. Accepting the all platforms default Finally
    allowed me to show a state of Non-Compliant on 8. This was using a powershell script of string data type as discussed previously.
    My latest torment is discovering how to force a true re-evaluation of an updated CI/CB. In my non-compliant Win8 example, I have added a remediation script to an existing Monitor-Only CI and configured it to remediate. In my Win 7 members of the collection,
    everything works successfully, the condition is remediated and the state reports Compliant but on the Win8, although the local Control Panel applet shows both the CB and CI to have new revisions and the evaluation shows it has run with a new date/time,
    the remediation script never runs and changes to Compliant.
    Any suggestions how I can force an updated CI/CB to really re-evaluate, not just report it has?

  • JDBC returning default values !! Help Required

    There are certain fields in a particular table which are of type integer and these fields in teh database have a value of null ( database null)
    Even, When I try to retreive the value of the field using getString method of the ResultSet, the value returned is the default value (0) , is there any way to get the
    actual value ( null) ? . Is there any way to avoid getting the default values ?
    Regards,
    Harsha

    You meant getInt(), not getString(), right?
    The getInt() method has to return an int, and since that isn't an object, Java doesn't have the concept of "null" for it. So what you do is, after you call getInt() on the ResultSet, you call wasNull() and that returns true if the zero was really a null.

  • Return multiple values from a method

    For a school project I have to make a parameter-less constructor that can input values from the keyboard and calculate those values. Now that I have the values how do I return them? I need to return 3 values from this parameter-less method.
    I hoope someone can help.

    Qwertyfshag wrote:
    Here is the wording of the assignment. I have copied and pasted it word for word:
    "Declare and use a no-argument (or "parameter-less") constructor to input the data needed, and to do the calculations."
    Any advice???Find a teacher who isn't an idiot. That sentence is vague ("to input the data needed"? Does that mean that it's supposed to query the user (which is terrible) or that it's supposed to encapsulate the data as hardcoded values, or what?) and is a bad design. Constructors shouldn't do this sort of thing.
    Ok I have done that part and now I want to retrieve the values of the calculations. How can I get those values out of that method What do you mean "that method"? Constructors aren't methods, and they don't return values.
    I suppose you could define a class whose constructor queries the user, and which would have a method to return values. That could be pretty simple; the method signature would be like this:
    Set<Integer> getValues();
    This seems like an advanced problem.It's not advanced; it's just garbage.
    I can't post the code in hear because that may constitute cheating. I am allowed to discuss it verbally but I cannot share code, sorry.You can't get a lot of help then. We can't psychically see what you've done so far.
    In conclusion: I have to have two methods. One method is a constructorConstructors aren't methods. If your teacher told you that they are, then he/she doesn't know what he/she is doing.
    that has NO parameters that will get input from the keyboard (done) and do the calculations (done). The other method must print that values to the screen on separate lines (not done). I don't know how to get the values out of the method.If they're two methods in the same class, then the constructor just needs to store the user input into a field of the class, and the other method can read the values in that field.

Maybe you are looking for