At 01:01 PM 4/23/99 -0800, [EMAIL PROTECTED] wrote:
>Hi,
>
>I want to filter a DataObject using the UserId variable session.
>
>i.e. If the field name of the dataobject is equal to the userId variable
session so Show the record, if no than hide 
>then SKIP the record.
>
>I'm trying to use the OnDisplay Event of the Repeated Object.
>
>
>
>       int command = PROCEED;  
>       
>                     // User Session Variable
>           String UserID = CSpider.getUserSessionObject("ssUserID").stringValue();
>                     // TextBox with the Field to be compared.
>           String User_Name = getDisplayFieldValue("*hdUserName").stringValue();
>           
>         // If different don�t show the record.  
>           if (UserID.trim() != User_Name.trim())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
** I see Aby has already replied, and I agree that you should test your
session object value against the _source_ of the value in the field, much
cleaner since it is not dependent on the value having been loaded into the
field.

**** But, also, the above line caught my eye, and it is probably the direct
cause of your symptoms.
This is a very common java error that people make.

it should be:
 if (UserID.trim().equals(User_Name.trim()))

if (stringA.equals(stringB)) means "do stringA and stringB contain the same
value?"

if (stringA==stringB) means "are stringA and stringB references to the same
object in the JVM?"  Except in rare cases this will always evaluate FALSE.

---- Curt



>              {
>              command = SKIP; 
>              }
>
>     return (command);
>
>
>
>It doesn't work. the "User_Name" variable is ever empty. ???????
>
>
>
>Help
>_________________________________________________________________________
>
>For help in using, subscribing, and unsubscribing to the discussion
>forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
>For dire need help, email: [EMAIL PROTECTED]
> 
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to