Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Blama
    replied
    Hi zaj,

    please rethink the outerJoin-issue. You need to either have the outerJoin or required="true" for prfk because otherwise records will get "lost" in the UI because they do not have a join-partner.

    The issue with the not filled productionlineBize is expected - the record is not saved, so the SELECT for the new values after UPDATE/ADD was not executed.
    If you care only for the information and not for the design issue, you could do what I suggested earlier with a custom ComboBoxItem.
    Other options include change handlers (I did not do this, yet), or, if you are OK with a display of "linename (linesize)" a combination of custom ComboBoxItem for the editing, two hidden includeFrom fields (needed!) and another field (used as new displayField for prfk with a customSelectExpression that creates the "linename (linesize)".

    Best regards
    Blama

    Leave a comment:


  • zaj
    replied
    Blama, I got rid of that joinType and I got near to my end goal. Only one thing which is not working is that when I want to enter a new record i select the Production Line from the combobox its corresponding Batch Lien is not showing. what could be going wrong here. But when I fetch the listgrid it is showing the saved records Batch line. Please help. My datasource looks like this now

    Code:
    <DataSource ID="productionlinedetailDS" serverType="sql" tableName="proined">
    	<fields>
    		<field name="id" type="sequence" hidden="true" primaryKey="true" />
    		<field name="prfk" title="Production Line" type="integer" foreignKey="productionlineDS.id" displayField="productionlineName" editorType="ComboBoxItem"/>
    		<field name="productionlineName" includeFrom="productionlineDS.name" hidden="true" />
    		<field name="productionlineBize" includeFrom="productionlineDS.bize"/>

    Leave a comment:


  • Blama
    replied
    Hi zaj,

    please read the docs for the outerJoin attribute and set useAnsiJoins either globally or for your .ds.xml one by one.

    Best regards
    Blama

    Leave a comment:


  • zaj
    replied
    Thanks Blama for your help. I get this error.By the way my database is MSSQL 2008.


    java.sql.SQLException: The query uses non-ANSI outer join operators ("*=" or "=*"). To run this query without modification, please set the compatibility level for current database to 80, using the SET COMPATIBILITY_LEVEL option of ALTER DATABASE. It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). In the future versions of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
    at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1311)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
    at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:695)
    at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:550)
    at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:543)
    at com.isomorphic.sql.SQLDriver.getScalarResult(SQLDriver.java:729)
    at com.isomorphic.sql.SQLDriver.executeScalar(SQLDriver.java:1020)
    at com.isomorphic.sql.SQLDataSource.runRowCountQuery(SQLDataSource.java:2957)
    at com.isomorphic.sql.SQLDataSource.executeWindowedSelect(SQLDataSource.java:2361)
    at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1908)
    at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:443)
    at com.isomorphic.sql.SQLDataSource.executeFetch(SQLDataSource.java:388)
    at com.isomorphic.datasource.DataSource.execute(DataSource.java:1922)
    at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:726)
    at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
    at com.isomorphic.application.AppBase.execute(AppBase.java:491)
    at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2548)
    at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:220)
    at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:185)
    at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152)
    at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:117)
    at com.isomorphic.servlet.IDACall.doPost(IDACall.java:76)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
    at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:83)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at com.behsa.server.login.AppAuthenticationFilter.doFilter(AppAuthenticationFilter.java:46)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:745)

    Leave a comment:


  • Blama
    replied
    Note that if you set up you ComboBoxItem manually, you can also show the resulting batch size in the dropdown before leaving the row. See the picklist-methods in ComboBoxItem.

    Leave a comment:


  • Blama
    replied
    Hi zaj,

    please try:

    <field name="prfk" title="Production Line" type="integer" foreignKey="productionlineDS.id" joinType="outer" displayField="productionlineName" editorType="ComboBoxItem"/>
    <field name="productionlineName" includeFrom="productionlineDS.name" hidden="true" />
    <field name="productionlineBize" includeFrom="productionlineDS.bize"/>
    Your problem was that an includeFrom-field is always readOnly, therefore no editor was shown.
    So you need to have a normal foreignKey field, but add the displayField attribute.

    Also check your need for an outerJoin-foreignKey.

    Best regards
    Blama

    Leave a comment:


  • zaj
    replied
    OK, I managed to get one step ahead. That is I managed to display the PRoduction Lien and Batch number col. But the problem now I have is when I hit the NEW button to enter a new record, the production Line col is no more active i.e. it does not display the Combo box which I had before. The thing I did is in my productionlinedetailDS,i made some changes to the field Production Line,like so.you can compare to my previous version in my original post. In the below DS I just copied the field which we need to concentrate on

    Code:
    <DataSource ID="productionlinedetailDS" serverType="sql" tableName="proined">
    	<fields>
    		<field name="id" type="sequence" hidden="true" primaryKey="true" />
    		<field name="name" nativeName ="prfk" title="Production Line" type="integer" foreignKey="productionlineDS.id" includeFrom="productionlineDS.name" editorType="ComboBoxItem"/>
    		<field name="bize" title="Batch Size" includeFrom="productionlineDS.bize"/>
    Attached Files
    Last edited by zaj; 24 May 2015, 21:20.

    Leave a comment:


  • zaj
    replied
    Thanks Blama for your feedback.

    The thing is when i add the field hidden=true for bize then it is not getting displayed in the listgrid,which is not what i intend.

    i have these 2 tables proine and proined. the proine.id is called prfk in table proined.
    Now I have created a listgrid which is set to datasource productionlinedetailDS. so the listgrid shows all those cols which i defined in the DS file productionlinedetailDS. SO far so good.
    Now I want to show an additional col called Batch Size(bize) from the DS file productionlineD which is also getting achieved by doing this

    Code:
    <field name="bize" title="Batch Size" includeFrom="productionlineDS.bize"/>
    The problem i have is the Production Line col which is the proine.id in the proined table is not getting displayed in the listgrid and the other issue is when i select a data from the ComboBox i want its respective Batch size to be shown in the Batch size column. I have also attached screenshot to try to explain what my issue is and how to resovle it.
    Appreciate your help.
    Attached Files

    Leave a comment:


  • Blama
    replied
    Also, as productionlinedetailDS.prfk seems not to be required="true", you might(?) wanna add joinType="outer" to it (please read the docs for it carefully if your result is no different (=no outer join generated)).

    Best regards
    Blama

    Leave a comment:


  • Blama
    replied
    Hi zaj,

    please try the following:
    Code:
    <field name="prfk" title="Production Line" type="integer" foreignKey="productionlineDS.id" displayField="[B]bize[/B]" editorType="ComboBoxItem"/>
    <field name="bize" title="Batch Size" includeFrom="productionlineDS.bize" [B]hidden="true"[/B] />
    Only one field displayed and should solve your case when displaying as well as when editing.

    Best regards
    Blama

    Leave a comment:


  • zaj
    started a topic IncludeFrom field not populating data

    IncludeFrom field not populating data

    Hello there,

    I am using SmartClient Version: v10.0p_2015-05-08/PowerEdition Deployment (built 2015-05-08) on FF26

    I have two datasource file,like so,

    Code:
    <DataSource ID="productionlineDS" serverType="sql" tableName="proine">
    	<fields>
    		<field name="id" type="sequence" hidden="true" primaryKey="true" />
    		<field name="name" title="Description" type="ntext" required="true"/>
    		<field name="bize" title="Batch Size" type="integer" required="true"/>
    		<field name="pu" title="Unit" type="text" length="5" required="true">
    		<valueMap>
                    <value>Kg</value>
                    <value>Liter</value>
                    <value>Pcs</value>
                    <value>Other</value>
                </valueMap>
            </field>
            <field name="ways" title="Maximum Work Day" type="integer" required="true"/>
    	</fields>
    </DataSource>

    Code:
    <DataSource ID="productionlinedetailDS" serverType="sql" tableName="proined">
    	<fields>
    		<field name="id" type="sequence" hidden="true" primaryKey="true" />
    		<field name="prfk" title="Production Line" type="integer" foreignKey="productionlineDS.id" displayField="name" editorType="ComboBoxItem"/>
    		<field name="bize" title="Batch Size" includeFrom="productionlineDS.bize"/>
    		
    		<field name="pu" title="Unit" type="text" length="5">
    		<valueMap>
                    <value>Kg</value>
                    <value>Liter</value>
                    <value>Pcs</value>
                    <value>Other</value>
                </valueMap>
            </field>
    		 <field name="up" title="Single Unit Package / Batch" type="integer"/>
    		 <field name="ups" title="Multiple Unit Package / Batch" type="integer"/>
    		 <field name="amc" title="Multiple Unit Package Content" type="integer"/>
            <field name="was" title="Production Staff" type="integer"/>
    	</fields>
    </DataSource>
    Now I have a listgrid on which I call the productionlinedetailDS file. the listgrid is filling the Combo box prfk field with appropriate data but then i want the next field to get its corresponding data "bize" but nothing happens.
    Can somebody please tell me what I am doing wrong.

    cheers
    Zolf
    Attached Files
Working...
X