question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Field visibility binding

See original GitHub issue

I have the following field and I would like to make the text only visible if the checkbox is ticked. Can I bind the visibility?

image

<form>
  <title>RENAL TRACT ULTRASOUND</title>
  <heading>Patient details</heading>
  <row>
    <col>
      <text>Name: {ContextBinding FirstName} {ContextBinding LastName} ({ContextBinding GenderAsString})</text>
    </col>
    <col>
      <text>DOB: {ContextBinding DateOfBirth} ({ContextBinding AgeString})</text>
    </col>
  </row>
  <row>
    <col>
      <text>Patient ID: {ContextBinding PatientId}</text>
    </col>
    <col>
      <text>Accession: {ContextBinding PatientId}</text>
    </col>
  </row>
  <hr />
  <heading>Findings</heading>
  <row>
    <col >
      <text>Liver:</text>
    </col>
    <col>
      <input
        type="bool"
        name="NAD"
        label="NAD"></input>
    </col>
    <col>
      <input
        type="bool"
        name="ECHOGENIC"
        label="ECHOGENIC"></input>
    </col>
  </row>
  <br />
  <row>
    <col
      width="2">
      <row>
        <col>
          <input
            type="bool"
            name="has-portalVein"
            label="Portal Vein"></input>
        </col>
      </row>
      <row>
        <col>
          <input
            type="bool"
            name="has-cbd"
            label="CBD"></input>
        </col>
        <col>
          <input
            type="string"
            name="cbdVol"
            label="Vol (mm)"></input>
        </col>
      </row>
      <row>
        <col>
          <input
            type="bool"
            name="has-gallbladder"
            label="Gallbladder"></input>
        </col>
        <col>
          <input
            type="string"
            name="BladderVol"
            label="Vol (mm)"></input>
        </col>
      </row>
      <row>
        <col>
          <input
            type="bool"
            name="has-GBWall"
            label="GB Wall"></input>
        </col>
        <col>
          <input
            type="string"
            name="GBWallVol"
            label="(mm)"></input>
        </col>
      </row>
      <row>
        <col>
          <input
            type="bool"
            name="has-Pancrease"
            label="Pancrease:"></input>
        </col>
        <col>
          <input
            type="string"
            name="PancreaseComments"
            label="comments"></input>
        </col>
      </row>
      <row>
        <col>
          <input
            type="bool"
            name="has-Spleen"
            label="Spleen:"></input>
        </col>
        <col>
          <input
            type="string"
            name="SpleenVol"
            label="(mm)"></input>
        </col>
      </row>
      <row>
        <col>
          <input
            type="bool"
            name="has-RightKidney"
            label="Right Kidney:"></input>
        </col>
        <col>
          <input
            type="string"
            name="RightKidneyVol"
            label="(mm)"></input>
        </col>
      </row>
      <row>
        <col>
          <input
            type="bool"
            name="has-LeftKidney"
            label="Left Kidney:"></input>
        </col>
        <col>
          <input
            type="string"
            name="LeftKidneyVol"
            label="(mm)"></input>
        </col>
      </row>
      <row>
        <col>
          <input
            type="bool"
            name="has-Aorta"
            label="Aorta:"></input>
        </col>
        <col>
          <input
            type="string"
            name="AortaVol"
            label="(mm)"></input>
        </col>
      </row>
    </col>
    <col></col>
  </row>
  <row>
    <col>
      <text>Comments:</text>
    </col>
    <col>
      <input
        type="bool"
        name="NADcomments"
        label="NAD"></input>
    </col>
    <col>
      <input
        type="bool"
        name="other"
        label="Other"></input>
    </col>
  </row>
  <row>
    <textarea
      name="Comments"
      label="Comments" />
  </row>
  <row>
    <input
      type="string"
      name="Sonographer"
      label="Sonographer"></input>
  </row>
  <row>
    <action
      name="reset"
      content="RESET"
      icon="close"
      resets="true" />
    <action
      name="submit"
      content="SUBMIT"
      icon="check"
      validates="true" />
  </row>
</form>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
edongashicommented, Jun 12, 2018

Boolean expressions now support converters by trailing |Converter

This will convert the final result of the evaluated expression

<form>
   <input type="bool" name="MyCondition1" />
   <input type="bool" name="MyCondition2" />
   <input type="string" name="BladderVol" visible="{Binding MyCondition1} &amp;&amp; {Binding MyCondition2} |HideOnFalse" label="Vol (mm)" />
</form>
1reaction
edongashicommented, Jun 11, 2018

This should do it:

        <col>
          <input
            type="string"
            name="BladderVol"
            visible="{Binding has-gallbladder}"
            label="Vol (mm)"></input>
        </col>

the view jumps a little when you toggle it though, we should probably support a minHeight for row elements.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Binding Visibility for DataGridColumn in WPF - xaml
First of all, DataGridTextColumn (or any other supported dataGrid column) does not lie in the Visual tree of the DataGrid .
Read more >
Xamdatagrid field visibility
I am trying to hide the column from the data grid by changing the visibility ... <Setter Property="Visibility" Value="{Binding DataContext.
Read more >
The "visible" and "hidden" bindings
The visible and hidden bindings cause the associated DOM element to become hidden or visible according to the value you pass to the...
Read more >
How to adjust the visibility of smart fields?
Type in the desired binding in the Visibility expression to adjust the smart field visibility. It should be noted that using VisibilityType.
Read more >
Dynamic Binding of dependent field visibility not working
I am trying to Set an Amount Field visible based on Indicator is True (manipulating/modifying this indicator value in AfterModify Event). In UI ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found