Hi Isomorphic,
could you add support for a new velocity variable $tableName here?
My use case is the following:
For i18n reasons I don't use anymore something like this:
This worked perfectly, but you can't have translated names that way.
So now I'm using a big lookup-table, accessed via PL/SQL function and cached in memory in the DB with a customSelectExpression:
This is working fine.
But if I now have a DataSource that inheritsFrom it's fields from this DataSource, I need to redefine the field and just change the bold part above with the name of the inheriting DataSource (because otherwise I'd get an SQL error).
This would be solved if I had $tableName available as velocity variable, as this would translate to the correct table name in both cases without the need to redefine. I also can't leave the "TABLENAME." away, as the column name itself is not unique because of joins and this would lead to SQL ambiguity problems.
Another valuable addition (I don't need it now, but I'm pretty sure that I can use it eventually) is to have the fieldName / nativeName available here, like you already do for viewRequires:
For the tablename I already tried working with the DataSource from $dsRequest, but unfortunately DataSource does not have a getTableName().
Does this enhancement make sense to you?
Thank you & Best regards
Blama
could you add support for a new velocity variable $tableName here?
My use case is the following:
For i18n reasons I don't use anymore something like this:
Code:
<field [B]foreignKey="T_LEADTEMPERATURE.ID"[/B] name="MD_LEADTEMPERATURE_ID" type="integer" displayField="MD_LEADTEMPERATURE_NAME" /> <field name="MD_LEADTEMPERATURE_NAME" [B]includeFrom="T_LEADTEMPERATURE.NAME" [/B]/>
So now I'm using a big lookup-table, accessed via PL/SQL function and cached in memory in the DB with a customSelectExpression:
Code:
<field name="MD_LEADTEMPERATURE_ID" type="integer" displayField="MD_LEADTEMPERATURE_NAME" /> <field name="MD_LEADTEMPERATURE_NAME" length="60" type="text" escapeHTML="true" hidden="true" [B]customSelectExpression="translation.gettranslation(V_LEAD_MATCHED_UNDISMISSED.TENANT_ID, 'T_LEADTEMPERATURE', MD_LEADTEMPERATURE_ID, 'NAME', $userLanguage)[/B]" />
But if I now have a DataSource that inheritsFrom it's fields from this DataSource, I need to redefine the field and just change the bold part above with the name of the inheriting DataSource (because otherwise I'd get an SQL error).
This would be solved if I had $tableName available as velocity variable, as this would translate to the correct table name in both cases without the need to redefine. I also can't leave the "TABLENAME." away, as the column name itself is not unique because of joins and this would lead to SQL ambiguity problems.
Another valuable addition (I don't need it now, but I'm pretty sure that I can use it eventually) is to have the fieldName / nativeName available here, like you already do for viewRequires:
In addition to the normal context variables available to Velocity expressions in Smart GWT, expressions you write for field-level requires clauses - viewRequires, editRequires, initRequires and updateRequires - can reference two additional variables: $fieldName and $dsName.
Does this enhancement make sense to you?
Thank you & Best regards
Blama
Comment