Hexagon Geospatial
MENU

GeoMedia Smart Client

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Regular Contributor
Posts: 170
Registered: ‎07-07-2016

How to make form control not editable using sql

Hi, 

I have two questions about 'editable' property of form controls in GMSC2016:

 

1. How can I make button not editable using sql query?

2. How can I make form table button not editable using sql query (the button can me editable or not according to row id)

 

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: How to make form control not editable using sql

like any form element it should be enough setting editable="SQL[select ...]". This post may also be relevant for inheritance:

 

http://community.hexagongeospatial.com/t5/Support-GeoMedia-Smart-Client/FormElements-with-independen...

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Regular Contributor
Posts: 170
Registered: ‎07-07-2016

Re: How to make form control not editable using sql

I have the following button and it doesn't work. Maybe sql contruction is wrong. (The same contruction works for changing visible attribute)

 

<FormAction name="button1" editable="SQL[select case when 1=1 then 1 end]" visible="true" action="SCRIPT[alert('')]" type="row" />

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: How to make form control not editable using sql

that means it is always editable, isn't it?

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Regular Contributor
Posts: 170
Registered: ‎07-07-2016

Re: How to make form control not editable using sql

[ Edited ]

Yes,

but 

 

<FormAction name="button1" editable="SQL[select case when 1=2 then 1 end]" visible="true" action="SCRIPT[alert('')]" type="row" />

 

doesn't work either.

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: How to make form control not editable using sql

because you are selecting "null".

 

you either select 

 

select case when 1=2 then 1 else 0 end

or 

 

select case  when yourcolumn=... then 1 when yourcolumn=... then 0 end from cities where ....

please always check the output of your selections within the DB directly

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Regular Contributor
Posts: 170
Registered: ‎07-07-2016

Re: How to make form control not editable using sql

Yes, You are right.

But it doesn't work on table button.

i.e.

 

<FormTable name="jcwp1520Table" label=" " editable="true" visible="true" datatype="string" lov="SQL[select id, name from table1" required="false" persisted="false" saveinsession="false" override="false" selectionmode="none" rowcount="15">
<FormAction name="b1" editable="SQL[select case when 1=2 then 1 else 0 end]" visible="true" action="SCRIPT[alert('')]" type="row" />
<FormAction name="b2" editable="SQL[select case when 1=1 then 1 else 0 end]" visible="true" action="SCRIPT[alert('')]" type="row" />
<FormTableField name="id" label="Id" datatype="string" />
<FormTableField name="name" label="Name" datatype="string" />
</FormTable>

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: How to make form control not editable using sql

please check the post I mentioned before

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Regular Contributor
Posts: 170
Registered: ‎07-07-2016

Re: How to make form control not editable using sql

In the previous post, You've suggesting to not returning null in sql. And both my sql queries don't return null. So where's the problem?

 

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: How to make form control not editable using sql

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.