Announcement

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

    #16
    This log is again showing a viewFile request with no PK, which will clearly fail. This suggests you are not supplying the values to the form before it draws. You can verify this by turning on the "draws" log in the Developer Console and logging when you are providing values to the form.

    Note that editRecord() is a way to provide the Record to the form without having to iterate over attributes.

    Also, the Developer Console's server logs tab is handy, but there's no need to enable it to get to server logs - it's the same thing as is shown in the Eclipse "Console" tab.

    Comment


      #17
      Back from break, got this working yesterday thanks to both your suggestions. Whew!

      Here's what I learned to make this work:

      Changes to Java Code: As suggested, use editRecord() to set the record for the form, which replaces the old code that set individual field values.
      Code:
      ...
      employee.fetchData(criteria, new DSCallback() {
      
      	@Override
      	public void execute(DSResponse response, Object rawData,
      		DSRequest request) {
      
      		Record[] record = response.getData();
      				
      		// Lesson Learned:  Setting the record value is different from...
                      viewForm.editRecord(record[0]);
      				
                      // ... setting all the record's field values individually, as in old code here. 
                     //String[] attribute = record[0].getAttributes();
      
                     //for (int i = 0; i < record[0].getAttributes().length; i++) {
                     //   viewForm.setValue(attribute[i],record[0].getAttribute(attribute[i]));
                     //  }
      Changes to DataSource fieldname letter case: Many thanks bbruyn. If I create the field names with mixed case in Oracle (SIGNATURE_date_created), Oracle's default is to upper case the name. So when I then used the SGWT DS Generator to read the field names out, they were all upper (SIGNATURE_DATE_CREATED), which isn't gonna work. Your suggestion #1 was the fix: Manually edit the DataSource fieldnames back to mixed case (SIGNATURE_date_created). This works, even though the Oracle field names remain all upper (SIGNATURE_DATE_CREATED).
      Code:
      <field name="SIGNATURE" type="imageFile" canEdit="false" showFileInline="true"></field>
      <field name="SIGNATURE_filename" length="256" type="text" hidden="true"></field>
      <field name="SIGNATURE_filesize" type="number" hidden="true"></field>
      <field name="SIGNATURE_date_created" type="date" hidden="true"></field>
      This generates a successful query of
      Code:
      SELECT EMPLOYEE.AD_ACCOUNT, EMPLOYEE.EMAIL, EMPLOYEE.EMPLOYEE_ID, EMPLOYEE.IS_APPROVER, EMPLOYEE.IT_GROUP, EMPLOYEE.NAME, 
      
      EMPLOYEE.SIGNATURE, 
      EMPLOYEE.SIGNATURE_date_created, 
      EMPLOYEE.SIGNATURE_filename, 
      EMPLOYEE.SIGNATURE_filesize 
      
      FROM mySchema.EMPLOYEE WHERE (EMPLOYEE.EMPLOYEE_ID='12345')
      Your suggestion #2 (autoDeriveSchema="true") fails because this reads the field names back in Oracle's default upper case. This generates an unsuccessful query that duplicates the meta-field names w/ mixed & upper case values:
      Code:
      SELECT EMPLOYEE.AD_ACCOUNT, EMPLOYEE.EMAIL, EMPLOYEE.EMPLOYEE_ID, EMPLOYEE.IS_APPROVER, EMPLOYEE.IT_GROUP, EMPLOYEE.NAME, 
      
      EMPLOYEE.SIGNATURE, 
      
      EMPLOYEE.SIGNATURE_DATE_CREATED, 
      EMPLOYEE.SIGNATURE_FILENAME, 
      EMPLOYEE.SIGNATURE_FILESIZE, 
      
      EMPLOYEE.SIGNATURE_date_created, 
      EMPLOYEE.SIGNATURE_filename, 
      EMPLOYEE.SIGNATURE_filesize 
      
      FROM mySchema.EMPLOYEE WHERE (EMPLOYEE.EMPLOYEE_ID='12345')
      OK, one last closeout question for Isomorphic: Aside from DynamicForm's FileItem and ViewFileItem classes, which other Visual Components are able to retrieve from BLOB storage?

      Thanks!
      Last edited by tinnitus007; 5 Jan 2012, 13:10.

      Comment


        #18
        We've queued up an enhancement to make the implied binary fields like _filename by recognized regardless of letter case.

        You can use anything that takes an image URL with a binary field via DataSource.getFileURL().

        Comment


          #19
          Just happened to find the last reply to this thread buried in my inbox. Wondering whether that enhancement ever made it in?

          Comment


            #20
            Yes it did - as of last week in 3.1d builds you can use autoDeriveSchema with binary fields and SQL columns with names such as BINARY_FIELD_FILENAME will be recognized as columns where the filename should be stored for a binary field called "binary_field" or "BINARY_FIELD" (any case is allowed).

            Please let us know if you have any trouble with this.

            Comment

            Working...
            X