NetTalk Central

Author Topic: Cannot get conditional display to work  (Read 2794 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Cannot get conditional display to work
« on: January 07, 2012, 04:10:36 AM »
I have a child browse alongside a list of contacts. I want to display certain fields in the child browse only if alongside that form. The procedure name is "BrowseContact".

I have successfully used conditional filters when opening the child browse separately based on the procedure I am coming from but this is slightly different.

So on the child browse I go to the field properties I wish to hide. I select the conditional tab and in there enter as my condition:

loc:parent<>'browsecontact' - I even tried = in case it required it the other way round.

'browsecontact' is the name of the procedure and has to be in lower case.

However it does not work. Surely I do not have to enter the field name as well as these are the properties for that field.

What could I be missing?

John


John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Cannot get conditional display to work
« Reply #1 on: January 08, 2012, 01:20:44 AM »
Maybe a better explanation will help ...

A Browse has 10 fields. This is the "default" view. But I also use the Browse in a Lookup/Select scenario.

When in that scenario (and I can find that by using loc:parent='procedure') I want to NOT show most of the fields.

On the Browse I have conditional filters that filter the data when the parent form is detected and that works fine but I cannot seem to get the fields to display (or not) using the same method.

Anyone got any clues please? Please see attached for the invividual field settings I wish to hide.

Thanks

john

[attachment deleted by admin]

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Cannot get conditional display to work
« Reply #2 on: January 08, 2012, 08:55:22 AM »
Here is a test app to show the issue.

Add a Contact and now add some patients. Note that the Browse Patient has the names Contact and Patient as the header.

I want these to display when the Browse Patient form is displayed on it's own but NOT when called from the BrowseContact.

So in the name field properties I set a conditional property of loc:parent<> 'browsecontact'

I have checked using trace that the loc:parent value is 'browsecontact' and have tried reversing the condition. I believe there is a bug here as now matter how I test it is fails every time.

Hope fully someone might prove me wrong.

John

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11181
    • View Profile
Re: Cannot get conditional display to work
« Reply #3 on: January 08, 2012, 10:13:48 PM »
In your attached zip file, on the BrowsePatient procedure,Con:Name column;
the Column Condition is set to :
  loc:parent <> 'updatecontact'

So on the UpdateContact form, (when the drop down is set to one, and the Patient tab appears) the BrowsePatient control shows just the name. Which is what I think you want there.

If you extend the condition to
loc:parent <> 'updatecontact' and loc:parent <> 'browsecontact'

then when viewing the BrowseContact browse, where the BrowsePatient appears to the right, you get the same effect.

cheers
Bruce


John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Cannot get conditional display to work
« Reply #4 on: January 09, 2012, 02:17:13 AM »
Erm sorry Bruce. I have gotten a  bit lost <g>

Attached are the two browses and the idea is to hide Name on the right hand browse (patient).

Also my example has the condition as loc:parent <> 'BROWSEcontact' not UPDATEcontact.

I agree that my code does work on Update contact whch hides Patient name. However that is not my main concern.

It is how to hide the name on the screenshot.

I tried changing the condition but that does not work. In fact the screenshot is with the new condition in.

HTH and thanks.

John


[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11181
    • View Profile
Re: Cannot get conditional display to work
« Reply #5 on: January 09, 2012, 05:05:17 AM »
if you download the test1.zip you posted, you'll see my answer is accurate, and indeed does what you want.

cheers
Bruce

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Cannot get conditional display to work
« Reply #6 on: January 09, 2012, 06:53:13 AM »
Please see private email Bruce (easier for the screenshots) as we are talking about 2 different things. Now it does work though so thanks.

John