Start a new topic

Is it possible to hide an DataView

 I have wrapped a dataview in an If condition.

 

      <If test='#table_type.equals("VIEW")'>
        <DataView id="cockroachdb-view-source" icon="Source" label="Source" viewer="text">
          <Input name="dataColumn" value="CreateView"/>
          <Input name="formatSQL" value="true"/>
          <Command idref="cockroachdb.getViewSource">
            <Input name="database" value="${database}"/>
            <Input name="view" value="${view}"/>
          </Command>
        </DataView>
      </If>

Is this possible to hide the dataview this way?  I get the following error in the Debug Window:

 

2018-03-30 16:01:27.481 INFO   352 [ExecutorRunner-pool-2-thread-10 - K.ᅣチ] Evaluate expression: '#table_type.equals("VIEW")'
java.lang.NullPointerException: target is null for method equals
	at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:862)
	at ognl.ASTMethod.getValueBody(ASTMethod.java:73)
	at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
	at ognl.SimpleNode.getValue(SimpleNode.java:190)
	at ognl.ASTChain.getValueBody(ASTChain.java:109)
	at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
	at ognl.SimpleNode.getValue(SimpleNode.java:190)
	at ognl.Ognl.getValue(Ognl.java:333)
	at ognl.Ognl.getValue(Ognl.java:378)
	at ognl.Ognl.getValue(Ognl.java:357)
	at com.onseven.dbvis.sql.K.ᅣチ(Z:2082)
	at com.onseven.dbvis.sql.K.ᅣチ(Z:244)
	at com.onseven.dbvis.sql.K.ᅣツ(Z:3235)
	at com.onseven.dbvis.objects.xml.L.ᅣチ(Z:21)
	at com.onseven.dbvis.objects.xml.L.ᅣツ(Z:934)
	at com.onseven.dbvis.objects.xml.L.ᅣチ(Z:2545)
	at com.onseven.dbvis.objects.xml.L.ᅣチ(Z:2833)
	at com.onseven.dbvis.objects.xml.L.ᅣチ(Z:2833)
	at com.onseven.dbvis.objects.xml.L.ᅣツ(Z:1479)
	at com.onseven.dbvis.objects.xml.L.ᅣツ(Z:728)
	at com.onseven.dbvis.sql.V.ᅣチ(Z:750)
	at com.onseven.dbvis.db.I.L.ᅣテ(Z:1579)
	at com.onseven.dbvis.db.I.H.ᅣᄡ(Z:1849)
	at com.onseven.dbvis.db.I.K.ᅣᄡ(Z:3063)
	at com.onseven.dbvis.db.I.D.ᅣᄄ(Z:1756)
	at com.onseven.dbvis.K.C.W.ᅣᅠ(Z:2613)
	at com.onseven.dbvis.K.C.J.ᅣツ(Z:1374)
	at com.onseven.dbvis.K.C.J.doInBackground(Z:1521)
	at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at javax.swing.SwingWorker.run(SwingWorker.java:334)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

 I have the table_type defined in the group node.


 

        <GroupNode type="Views" label="Views">
          <DataNode type="View" label="${cockroachdb.getViews.table_name}" isLeaf="true">
            <SetVar name="view" value="${cockroachdb.getViews.table_name}"/>
            <SetVar name="table_type" value="${cockroachdb.getViews.table_type}"/>
            <Command idref="cockroachdb.getViews">
              <Input name="database" value="${database}"/>
            </Command>
          </DataNode>
        </GroupNode>

 


Hi Roger,
I seem to remember you telling me this before.  Thanks for your help.
Nathan

 

Hi Nathan,


Profile conditions are evaluated only when the profile is loaded at connect. Conditions cannot be evaluated once the profile has been loaded to respect for example results of queries. More info in:


http://confluence.dbvis.com/display/UG100/Conditional+Processing


Regards


Roger

Login or Signup to post a comment