Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Problem with the Image View
Problem with the Image View [message #988605] Fri, 30 November 2012 11:50 Go to next message
Eclipse UserFriend
Hi,


Thank You for wonderful Eclipse Scout Tutorial.

I have created a form in Scout, where I have added an Image Field in the Mainbox and I am able to load an icon which is available in Scout or an Url image into that field. But I am unable to load an image from the SQL database into the Image Field. Can you please help me with this or give some pointers.

Another thing I wanted to ask is, I have created a Table Page with some values displayed in table page and a Form within it to display the selected values. I am able to display the Form when I right click on the selected value of a TablePage, where the Form appears. Now I need to display that Form when I double clicked (Left Click) on the selected value of the TablePage, where again I am struck.
Can u please provide me with some pointers .

Thank You in Advance.
Re: Problem with the Image View [message #988673 is a reply to message #988605] Fri, 30 November 2012 19:18 Go to previous messageGo to next message
Eclipse UserFriend
Never tried to load image so i can't help you there, to open form with a double click on a table you should override in the table :

    @Override
    protected void execRowAction(ITableRow row) throws ProcessingException {
        // here you can call i thin the menu option to open the form 
        // or just create the form here
    }


I'm no expert but it works for me.... it's only executed when you double click or hit Enter key while row selected (so if you navigate with keyboard is useful).

luck!
Sebastian


Re: Problem with the Image View [message #988683 is a reply to message #988673] Sat, 01 December 2012 04:00 Go to previous messageGo to next message
Eclipse UserFriend
Thank you very much Sebastian for the solution for displaying the Form when double clicked, it worked.
Re: Problem with the Image View [message #988689 is a reply to message #988673] Sat, 01 December 2012 05:43 Go to previous messageGo to next message
Eclipse UserFriend
Regarding loading an image from a database: Let's assume that in your database there is a table IMAGE with columns ID and CONTENT. To fetch the image content from the server you could add a loadFile method on some FileTransferProcessService server service as follows:

  @Override
  public byte[] loadFile(String id) throws ProcessingException {
    ByteArrayHolder contentHolder = new ByteArrayHolder();
    SQL.selectInto("SELECT CONTENT INTO :content FROM IMAGE WHERE ID=:id", new NVPair("content", contentHolder), new NVPair("id", id));
    return contentHolder.getValue();
  }


using this server method you can display the image in your form by adding the method execInitField to the image filed in your form:

@Override
protected void execInitField() throws ProcessingException {
  String id = <<here goes your file id>>;
  byte[] content = SERVICES.getService(IFileTransferProcessService.class).loadFile(id);
  setImage(content);
}


let us know if that's what you were looking for

matthias
Re: Problem with the Image View [message #988703 is a reply to message #988689] Sat, 01 December 2012 10:45 Go to previous message
Eclipse UserFriend
Thank You very much Matthias, it worked great. Thanks for your solution.
Previous Topic:How to get image in Image view
Next Topic:Scout queries
Goto Forum:
  


Current Time: Fri Jul 25 08:49:49 EDT 2025

Powered by FUDForum. Page generated in 0.08163 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top