Skip navigation
Currently Being Moderated

Hiding Cell Value in a Table

Jan 3, 2012 5:13 PM

If a cell in a table is less than a certain value how do you make that hidden? Which then also means if a cell value is greater than a certain value it can be seen.

 
Replies
  • Currently Being Moderated
    Jan 4, 2012 2:22 PM   in reply to cclay53

    Can you provide more information on what you are trying to do.  Is your cell pulling data from a datasource or is the user manually entering the data in?  I assume the field is numeric?

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 6, 2012 3:08 AM   in reply to cclay53

    Hi,

     

    To show / hide a field, you can use the "presence" attribute. For example on your calculate event, something like :

     

    if (this.rawValue <8) {

         this.presence = "hidden";

    } else {

         this.rawValue = this.rawValue - 8;

         this.presence = "visible";

    }

     

    Your field should be a numeric field if you're doing calculation on it.

     

    Hope this helps,

     

    Regards,

     

    Thomas

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 9, 2012 2:21 AM   in reply to cclay53

    Hi,

     

    Are Row6.ph2 and Row7.Cell3 numeric fields ?

     

    It seems that you're using Javascript. In this case, you should access the value of a field using rawValue (ie Row6.ph2.rawValue).

     

    You also need to give a relative (this.parent ...) or absolute path (xfa.resolveNode("form.table.Row7")) to access Row6 and Row7, for example :

     

    this.rawValue=(Number(this.parent.Row6.ph2.rawValue) + Number(this.parent.Row7.Cell3.rawValue));

    if Row6 and Row7 are in the same subform as the total field.

     

    After testing the script quickly, it seems that if you put the rest of the script in the layoutReady event, it works fine.

     

    if (this.rawValue <8) {

         this.presence = "hidden";

    } else {

         this.rawValue = this.rawValue - 8;

         this.presence = "visible";

    }

     

    I don't really know why it doesn't work in the calculate event, there is no error in the javascript console ...

     

    Anyway, be careful with the layoutReady event though, because if you have a really big form and a lot of script in this event, this could slow the execution / display of your form.

     

    Regards,

     

    Thomas

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 10, 2012 1:16 AM   in reply to cclay53

    this.parent only retrieves the parent object of the one you're putting the script on. You may need to use this.parent.parent.textField for example. Another way to find your field (your node) is xfa.resolveNode("SOMEXPRESSION"); this function returns the node of the somExpression.

     

    You can't hide only the value, but you can hide all the field. What you can do is wrap your field in a subform and draw a border on this subform. This way if you hide the numericField, you can still see a border !

     

    You can use this.rawValue = "";, but you loose your value if you want it later ... Depends of your needs.

     

    I saw you asked about a scripting reference manual, but since your message was edited I think that you found it. Anyway I'll post the link for others that could need it : http://help.adobe.com/en_US/livecycle/es/lcdesigner_scripting_referenc e.pdf

     

    Regards,

     

    Thomas

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points