App - C++ ListView sample

Hello

Does anyone know how to make this work in C++? My problem is coming on the description and State of the element. Is there a way I can customize such as:

GroupDataModel temp = new GroupDataModel (QStringList<>

temp.setItemDescription (QStringList<>

temp.setItemStatus (QStringList<>

I scoured the docs nothing is done.

import bb.cascades 1.0
 
{Page}
content: {container
Create a ListView that uses a model of XML data
{To ListView
dataModel: {XmlDataModel}
Source: "models / items.xml.
}
 
listItemComponents:]
{ListItemComponent}
type: "header.
 
Use a predefined header to represent "header."
elements
{To header
Title: ListItemData.title
subtitles: ListItemData.subtitle
}
},
{ListItemComponent}
type: "listItem".
 
Use a predefined StandardListItem to represent "listItem".
elements
{StandardListItem}
Title: ListItemData.title
Description: ListItemData.subtitle
status: ListItemData.status
}
} / / end of the second ListItemComponent
] / / end of the list of listItemComponents
} / / end of ListView
} / / end of the container
} / / end of Page

I solved my problem. See the sample application (Cookbook of waterfalls).

Tags: BlackBerry Developers

Similar Questions

  • ALT Option key PS CC using the mouse or Tablet drags the app instead of sampling window when using Clone too

    When I open the CC PS on my Mac Mini (latest version Mavericks), or my MBPr (same OS.v)

    Here are the steps.

    MacMini and Mac:

    1. Open Photoshop
    2. Open any image
    3. Switch to the pen tool, tool buffer or any tool that uses the button Option key as a modifier
    4. Draw a few points, sample,.
    5. Now, try to change an anchor point using the tool anchor to convert or sample using the stamp tool. Just hold down the option key and drag.
    6. WOAH! My entire application moves and the modifier does not, instead change the XY of the application window.

    Find out what... When I do that on my side of my MBPr friends, that's fine. Infact I do editing on his sidebecuase of it. I just noticed that he was doing this at work. I do not use PS a lot at work, for the most part Illutsrator.

    in any case...

    Anyone else having this problem?

    Devices... it is replicated.

    M$ mouse on MacMini

    Intuous4 on MBPr WacomTablet

    Just tried to use the touchpad, MBPr, and that's fine.

    I'm starting to think it's drivers wacom or something.

    I wonder what 3rd party applications you are running. A quick Internet search seems to indicate that a tool like HyperDock can allow you to use windows by alt clicking on (http://superuser.com/questions/223318/mac-os-x-altleft-click-move-window-possible-in-10-5-et-up)

  • ListView filling does not

    Hi all

    ListView in my app is not filling, here is the code snippet

    ListView {
                        id:sectionlistview
                        objectName: "sectionlistview"
    
                        ///dataModel: groupDataModel
                        listItemComponents: [
                            ListItemComponent {
                                id:row
                                type: "item"
                                CustomListItem {
                                    dividerVisible: true
                                    highlightAppearance: HighlightAppearance.Default
                                    Container{
                                        opacity: 0.9
                                        background: Color.create("#c0c0c0")
                                        layout: StackLayout {
                                         orientation: LayoutOrientation.TopToBottom
                                        }
                                        Label {
                                            text: ListItemData.name
                                            textStyle.base: myStyle.style
                                            textStyle.color: Color.create("#ffffff")
                                        }
                                    }
                                }
    
                            }
                        ]
                    }
    
    void ApplicationUI::fetchData(){
            listView = root->findChild("sectionlistview");
            model = new GroupDataModel(QStringList() << "name");
            model->clear();
            model->setGrouping(ItemGrouping::None);
            model->insert(dataName);
            listView->setDataModel(model);
    }
    

    dataName is a QVariantMap variable. The data are available in the variable, I checked that.

    The following, almost identical to yours works for me. There are a few things in your code, which I don't see, so it is difficult to check every detail. First, create a new application and replace applicationui.cpp, applicationui.hpp and main.qml with my code and then test it. If it works, check if your code against mine. If not, let me know the device and the version of the OS that you are testing.

    #ifndef ApplicationUI_HPP_
    #define ApplicationUI_HPP_
    
    #include 
    
    namespace bb
    {
        namespace cascades
        {
            class Application;
            class LocaleHandler;
        }
    }
    
    class QTranslator;
    
    /*!
     * @brief Application object
     *
     *
     */
    
    class ApplicationUI : public QObject
    {
        Q_OBJECT
    public:
        ApplicationUI(bb::cascades::Application *app);
        virtual ~ApplicationUI() { }
        Q_INVOKABLE void fetchData();
    
    private slots:
        void onSystemLanguageChanged();
    private:
        QTranslator* m_pTranslator;
        bb::cascades::LocaleHandler* m_pLocaleHandler;
    
    };
    
    #endif /* ApplicationUI_HPP_ */
    

    applicationui. HPP

    #include "applicationui.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    static AbstractPane *root = 0;
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app)
    {
        // prepare the localization
        m_pTranslator = new QTranslator(this);
        m_pLocaleHandler = new LocaleHandler(this);
    
        bool res = QObject::connect(m_pLocaleHandler, SIGNAL(systemLanguageChanged()), this, SLOT(onSystemLanguageChanged()));
        // This is only available in Debug builds
        Q_ASSERT(res);
        // Since the variable is not used in the app, this is added to avoid a
        // compiler warning
        Q_UNUSED(res);
    
        // initial load
        onSystemLanguageChanged();
    
        // Create scene document from main.qml asset, the parent is set
        // to ensure the document gets destroyed properly at shut down.
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // Create root object for the UI
        root = qml->createRootObject();
    
        // Set created root object as the application scene
        app->setScene(root);
    
        qml->setContextProperty("app", this);
    
    }
    
    void ApplicationUI::onSystemLanguageChanged()
    {
        QCoreApplication::instance()->removeTranslator(m_pTranslator);
        // Initiate, load and install the application translation files.
        QString locale_string = QLocale().name();
        QString file_name = QString("SupportListView_%1").arg(locale_string);
        if (m_pTranslator->load(file_name, "app/native/qm")) {
            QCoreApplication::instance()->installTranslator(m_pTranslator);
        }
    }
    
    void ApplicationUI::fetchData()
    {
    
        QVariantMap dataName;
        dataName["name"] = "Martin";
        ListView* listView = root->findChild((const QString) "sectionlistview");
        GroupDataModel* model = new GroupDataModel(QStringList() << "name");
        model->clear();
        model->setGrouping(ItemGrouping::None);
        model->insert(dataName);
        listView->setDataModel(model);
    }
    

    applicationui.cpp

    import bb.cascades 1.2
    
    Page {
        Container {
            //Todo: fill me with QML
            Label {
                // Localized text with the dynamic translation and locale updates support
                text: qsTr("Hello World") + Retranslate.onLocaleOrLanguageChanged
                textStyle.base: SystemDefaults.TextStyles.BigText
            }
            Button {
                text: "Fetch Data"
                onClicked: {
                    app.fetchData();
                }
            }
            ListView {
                id: sectionlistview
                objectName: "sectionlistview"
    
                ///dataModel: groupDataModel
                listItemComponents: [
                    ListItemComponent {
                        id: row
                        type: "item"
                        CustomListItem {
                            dividerVisible: true
                            highlightAppearance: HighlightAppearance.Default
                            Container {
                                opacity: 0.9
                                background: Color.create("#c0c0c0")
                                layout: StackLayout {
                                    orientation: LayoutOrientation.TopToBottom
                                }
                                Label {
                                    text: ListItemData.name
                                    textStyle.base: myStyle.style
                                    textStyle.color: Color.create("#ffffff")
                                }
                            }
                        }
    
                    }
                ]
            }
        }
    }
    

    hand. QML

    Good luck!

    Martin

  • loading of objects to qml

    Hello

    I'm doing the following.

    I created a home page that displays a list. Now when I click on one of the items in this list another page opens. What I want to do now is to fill the page loaded information. So far, it is just a page with ListViews and WebViews containers.

    Here is a code:

    NavigationPane {
        id: navigationPane
    [...]
        Page {
    [...]
            content: Container {
    
                ListView {
                    id: listview
    [...]
                    onTriggered: {
                        var selectedItem = dataModel.data(indexPath);
                        var GoToSecondPage = secondPageDefinition.createObject();   // here I create the second page with its containers, ListView, etc.
                        Qt.app.fillPageWithContent();     // here I want to add content to the lists
                        navigationPane.push(GoToSecondPage);
                    }
    
                    objectName: "listview"
                    // end of listItemComponents list
                }
    
            } // end of Container
    [...]
        }
    
        attachedObjects: [
            // Definition of the second Page, used to dynamically create the Page above.
            ComponentDefinition {
                id: secondPageDefinition
                source: "asset:///PageDetails/PageDetails.qml"
            }
        ]
    }
    

    Can anyone give me a tip how do I do this?

    I also recommend that you only download a couple of the ListView sample applications that do exactly what you're trying to do.

    Looking at their willingness to code better help understand you what is needed.

    Samples can be found here...

    http://developer.BlackBerry.com/native/sampleapps/

    I recommend the quote and stamp collector.

  • BBUI &amp; 2.0 Webworks - just don't get it

    Hello

    Although I have never developed before that I'd like to think that I can follow a few basic instructions. After trying to get a bar single action appears on my Q10 for over a week, I gave up and decided to charge the samples on my device.

    If I create a project webworks and then copy the contents of the sample BB10 folder in my www folder I wouldn't be able to see an app to work samples? All I get is a blank white screen.

    The examples BB10 folder contains the BBUI.js, BBUI.css, index.htm (plus all the htm additional files), images, js and css + subfolders files and config.xml file. Looks like everything I need is here.

    Hope someone can help me understand this and get something... anything on my screen.

    Kind regards

    Tim

    EDIT: I am running OS 10.2.1

    Hi Tim,.

    I would check the 'standard of BfB for bbUI '. There is a version that works on WebWorks 2/Cordova there.

    You will have all this BB10 UI right out of the box, and it will probably save you a ton of time.

    There are instructions for details on how to build the sample (quite easy, just need to add plugins for most) as well.

    https://github.com/BlackBerry/BB10-WebWorks-samples/tree/WebWorks-2.0/BFB-boilerplate-bbUI.js-0.9x

  • BB10 WebWorks Debug Error - Please enter a valid application id

    Need help to solve a WebWorks BB10 issue when debugging.

    Packaging error question

    The command line, I ran the command standard packing

    bbwp [location of project].zip -d -o [locationofoutput]
    

    Resulting in:

    [INFO]       Populating application source
    [INFO]       Parsing config.xml
    [INFO]       Error: Please enter a valid application id
    

    Here is my file config.xml, I'm actually building the sample bbUI.js

    
    http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.2">
      App name
      A sample description
      My Name
      
      
      
        
      
      
      http://chart.apis.google.com" subdomains="true" />
      
      
      
      
      
      
      
      
    
    

    issue of token bbwp. Properties & debug
     

    Also... I know in the previous SDK WebWorks, you edit bbwp.properties and add a line pointing to the location of your debugging token.

    Question:

    • Where is the bbwp.properties file in the new SDK? Where can I specify my symbolic debug location?

    Thank you!

    Hello

    The id is an alphanumeric property of the principal element of the .  It cannot contain spaces or

    
    http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.2" id="yourIDhere">
    

    You don't need to edit the bbwp.properties file.  The Debug documentation token specifies where to put the debugging token file.  To enable debugging symbolic support, simply build your application with the d flag.

    Hope that helps!

  • Cannot open the input XML source

    Hello

    I'm trying to retrieve an RSS feed in XML format and display in the QML file.

    Here is the code snippet:

                    QByteArray dataArray = reply->readAll(); //reply is QNetworkReply
            qDebug() << "dataArray " << dataArray.data();
    
            bb::data::XmlDataAccess xda;
    
            QVariant channelRootData = xda.load(dataArray, "/rss/channel/");
            if (xda.hasError()) {
                bb::data::DataAccessError error = xda.error();
                qDebug() << "JSON loading error: " << error.errorType() << ": "
                        << error.errorMessage();
                return;
            }
    

    HTTP request is successful but XmlDataAcess is unable to analyze the recovered data.

    but the same XmlDataAcess is able to analyze the static XML file with the following code

    QVariant channelRootData = xda.load("app/native/assets/sample.xml", "/rss/channel/");
    

    Could someone help me.

    Try using this function instead:
    xda.loadFromBuffer (dataArray, "/ channel/rss /")

    XDA. Load() treat the buffer as file name.

  • BB10 Webworks camera API?

    I was updated an application and found that the HTML5 WebWorks camera API (for example, "blackberry.media.camera.takePicture") is not usable for BB10.

    I dug through the poriton BB10 and did not find any direct appeal was once used.  Y at - it another option to use the camera in a webworks HTML5 app?  any sample taken in charge?

    Thanks in advance!

    In BB10, is in the stuff of Invoke

  • No sound from bb::multimedia:MediaPlayer

    If I use the following

      musicPlayer = new bb::multimedia::MediaPlayer(this);
      MediaError::Type anError = musicPlayer->setSourceUrl(QUrl("asset:///sounds/music/sample.mp3"));
      if (anError == bb::multimedia::MediaError::None)
          musicPlayer->play();
    

    There is no sound coming out. I've linked libraries.

    Documentation:

    Permissions: Applications that call this class should be the play_audio, the access_shared permission.

    If I add play_audio to the bar-descriptor - there is an error that play_audio is not recognized.

    No idea why there is no sound coming out?

    This library must be sufficient to make work of Beta 3 and following (there are more limitations in the beta 2 release).

    For your problem 'no sound', I guess you could miss one of the things below (can you double check the following things...)

    1. No logs errors or traces are produced which contains more details. Note that by default, nothing appears on the console in Beta 3. More information about registration or tracing display can be found here: http://devblog.blackberry.com/2012/10/blackberry-10-sdk-console-logging/
    2. Play/pause state is changing in fact (from distribute the signals of the MediaPlayer object)
    3. If you read a file packaged in the 'active' folder, the absolute path, you set the input energy is something like the following (using the traces of the program):

      /Accounts/1000/appdtata/[UniqueFolderForYourApp]/app/native/assets/sample.MP3

    4. The device is actually correct and audio plays through other applications (for example, the browser or application previewer of default media, through as part of the call)
    5. The volume of the device is actually maximum. In other words, use the UP/DOWN buttons on the device itself and play other media files through the browser or other
    6. Try to play something "folders" instead using the authorization of "access_shared" (as explained above)
    7. The file you are trying to play is actually correct (plays through other players) and is one of the supported formats
      https://developer.BlackBerry.com/DevZone/develop/supported_media/bb_media_support_at_a_glance.html

    Hope this helps and let us know how it goes.

    See you soon,.

    Rashid

  • Changing variables of C++ QML UI (json source and sorting keys)

    Hello

    I have a tabbed two tabbed pane. I want to fill each tab with a dfifferent JSON (list (not XML). I managed to fill the first tab with the first json file... following the example of application stampcollector. All the UI is QML but JSON loading and groupdatamodel of adjustment is done in C++.

    1. now I want to fill the tab page of the 2nd with another JSON list. How can I go about it? Create a new class or can I change the JSON source when the 2nd tab fires?

    2 just like in the application of stampcollecctor, I use sort keys. I have a few elements of the action in QML, that when you press on, I want that sort of change lists. So let's say that the first action to sort A - Z, the second action Z - A, the third of the population, action action 4th by area.  How to access and change the sort key?

     

    3. is there in any case to sort alphabetically in reverse order, from Z - A?

    Code I have so far is below... just no idea where to start...

    hand. QML

    import bb.cascades 1.0
    
    TabbedPane {
        id: mainTabPage
        showTabsOnActionBar: true
    
        // Country Tab
        Tab {
            title: "Countries"
            NavigationPane {
                id: countryTabNav
                property variant _countryView;
                Page {
                    Container {
                        ListView {
                            id: countryList
                            objectName: "countryList"
                            listItemComponents: [
                                ListItemComponent {
                                    type: "listItem"
                                    StandardListItem {
                                        title: ListItemData.country
                                        status: ListItemData.population
                                        description: ListItemData.capital
                                    }
                                }
                            ]
    
                            onTriggered: {
                                var chosenItem = dataModel.data(indexPath);
                                _countryView = chosenItem;
                                countryTabNav.deprecatedPushQmlByString("countryDetail.qml");
                            }
                        }
    
                        //-- define tab content here
                        layout: StackLayout {
                        }
    
                    }
                }
            }
        }
    }
    

    App.cpp

    #include "app.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace bb::data;
    
    App::App() {
        QmlDocument *qml = QmlDocument::create("main.qml");
        //-- setContextProperty expose C++ object in QML as an variable
        //-- uncomment next line to introduce 'this' object to QML name space as an 'app' variable
        //qml->setContextProperty("app", this);
    
        AbstractPane *root = qml->createRootNode();
    
        // ListView Model
        ListView *countryList = root->findChild("countryList");
        setupCountryListModel(countryList);
    
        Application::setScene(root);
    }
    
    void App::setupCountryListModel(ListView *countryList) {
        JsonDataAccess jda;
        QVariantList mainList = jda.load("app/native/assets/countries.json").value();
    
        if (jda.hasError()) {
            bb::data::DataAccessError error = jda.error();
            qDebug() << "JSON loading error: " << error.errorType() << ": "
                    << error.errorMessage();
            return;
        }
    
        GroupDataModel *countryModel = new GroupDataModel(QStringList() << "country");
        countryModel->setParent(this);
        countryModel->insertList(mainList);
        countryModel->setGrouping(ItemGrouping::ByFullValue);
    
        countryList->setDataModel(countryModel);
    
    }
    

    App.HPP

    #ifndef APP_H
    #define APP_H
    
    #include 
    #include 
    
    using namespace bb::cascades;
    
    namespace bb
    {
        namespace cascades
        {
            class ListView;
        }
    }
    
    /*!
     * @brief Application GUI object
     */
    class App : public QObject
    {
        Q_OBJECT
    public:
        App();
    
    private:
        void setupCountryListModel(ListView *countryList);
    };
    
    #endif // ifndef APP_H
    

    1. you will need to duplicate what you did for the other tab.  Check out weatherguesser which has a bunch of tabs and datamodels.

    2. order groupdata model page

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__groupdatamodel.html#setsortingkeys

    Try:

    countryModel->setSortingKeys())

    3.

    countryModel-> setsortedascending (false)

  • No list to appear

    I tried to reproduce the app stampCollector to create a list that I can put in my App. whenever I run well, I get a blank screen. I can't understand why but... Any help would be appreciated...

    Here is my code:

    hand. QML

    import bb.cascades 1.0
    
    TabbedPane {
        id: mainTabPage
        showTabsOnActionBar: true
    
        // Country Tab
        Tab {
            title: "Countries"
            NavigationPane {
                id: countryTabNav
                property variant _countryView;
                Page {
                    Container {
                        ListView {
                            id: countryList
                            objectName: "countryList"
                            listItemComponents: [
                                ListItemComponent {
                                    type: "listItem"
                                    StandardListItem {
                                        title: ListItemData.country
                                        status: ListItemData.population
                                        description: ListItemData.capital
                                    }
                                }
                            ]
    
                            onTriggered: {
                                var chosenItem = dataModel.data(indexPath);
                                _countryView = chosenItem;
                                countryTabNav.deprecatedPushQmlByString("countryDetail.qml");
                            }
                        }
    
                        //-- define tab content here
                        layout: StackLayout {
                        }
    
                    }
                }
            }
        }
    }
    

    App.cpp

    #include "app.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace bb::data;
    
    App::App() {
        QmlDocument *qml = QmlDocument::create("main.qml");
        //-- setContextProperty expose C++ object in QML as an variable
        //-- uncomment next line to introduce 'this' object to QML name space as an 'app' variable
        //qml->setContextProperty("app", this);
    
        AbstractPane *root = qml->createRootNode();
    
        // ListView Model
        ListView *countryList = root->findChild("countryList");
        setupCountryListModel(countryList);
    
        Application::setScene(root);
    }
    
    void App::setupCountryListModel(ListView *countryList) {
        JsonDataAccess jda;
        QVariantList mainList = jda.load("app/native/assets/countries.json").value();
    
        if (jda.hasError()) {
            bb::data::DataAccessError error = jda.error();
            qDebug() << "JSON loading error: " << error.errorType() << ": "
                    << error.errorMessage();
            return;
        }
    
        GroupDataModel *countryModel = new GroupDataModel(QStringList() << "country");
        countryModel->setParent(this);
        countryModel->insertList(mainList);
        countryModel->setGrouping(ItemGrouping::ByFullValue);
    
        countryList->setDataModel(countryModel);
    
    }
    

    App.HPP

    #ifndef APP_H
    #define APP_H
    
    #include 
    #include 
    
    using namespace bb::cascades;
    
    namespace bb
    {
        namespace cascades
        {
            class ListView;
        }
    }
    
    /*!
     * @brief Application GUI object
     */
    class App : public QObject
    {
        Q_OBJECT
    public:
        App();
    
    private:
        void setupCountryListModel(ListView *countryList);
    };
    
    #endif // ifndef APP_H
    

    countries. JSON

    [
        {
            "country": "Canada"
            "capital": "Ottawa"
            "population": "23"
        },
    
        {
            "country": "India"
            "capital": "New Delhi"
            "population": "300"
        },
    
        {
            "country": "USA"
            "capital": "Washington D.C."
            "population": "100"
        }
    ]
    

    Thank you

    NVM, my JSON file has not been correctly implemented form.

    Problems with work late into the night.

  • AIR iOS URL scheme

    I'm developing an AIR for iOS app for my client to run on an iPad, and my application should be able to launch other applications using a URL scheme and also to be launched by another application, by receiving a URL scheme by it. What I read, it seems that AIR for iOS apps can receive and respond to URL patterns, but they are unable to send URL patterns to launch other applications, due to security restrictions.

    Anyone know if it is possible for send and receive URL patterns?

    Yes, you can.

    Open installed "Wikitude" app can be done via this script

    import flash.events.MouseEvent;

    btn.addEventListener(MouseEvent.CLICK, callURL);

    function callURL(e:MouseEvent):void{
        navigateToURL(new URLRequest("wikitude://"));
    }

    Likewise, you can open your app from any other. In the example above Wikitude app is URI id. The same below the iPadARIconAppB

    Here is the part of the descriptor of the Application - my old project xml.xml:

    UIDeviceFamily

    1

    2

    CFBundleURLTypes

    CFBundleURLName

    com.camel.geo.iPadARIconAppB.iPadARIconAppB - schema

    CFBundleURLSchemes

    iPadARIconAppB

    UIApplicationExitsOnSuspend

    ]]>

    standard

    You must replace CFBundleURLName by your app in my sample ID and CFBundleURLSchemes put your own application name.

    If you want to open your application to any other - you must open "iPadARIconAppB://" and if you pass params - just "iPadARIconAppB:/ / myparams" and read via Invoke in Adobe Air. "

    The air is great and allow a lot of things

  • Couldn't able to reduce the size of the image while storing in the report

    Hi friends,

    Im trying to save the image in my table, so that these are the steps that I follow...

    First, I created a table:
    CREATE TABLE "A_IMAGES"
    (
    "IMAGE_ID" NUMBER(10,0) NOT NULL ENABLE,
    "FILE_NAME" VARCHAR2(4000) NOT NULL ENABLE,
    "BLOB_CONTENT" BLOB,
    "MIME_TYPE" VARCHAR2(4000),
    CONSTRAINT "A_IMAGES_PK" PRIMARY KEY ("IMAGE_ID") ENABLE
    )
    After this sequence, relaxation and the procedure,.

    Let me show you the procedure
    create or replace PROCEDURE "DISPLAY_IMAGE"
    (
    inID NUMBER
    )
    AS
    vMIME VARCHAR2(48);
    vLENGTH NUMBER;
    vFILENAME VARCHAR2(2000);
    vBLOB BLOB;
    BEGIN
    SELECT MIME_TYPE, BLOB_CONTENT, FILE_NAME, DBMS_LOB.GETLENGTH(BLOB_CONTENT)
    INTO vMIME, vBLOB, vFILENAME, vLENGTH
    FROM A_IMAGES
    WHERE IMAGE_ID = inID;
    owa_util.mime_header(nvl(vMIME, 'application/octet'), FALSE);
    htp.p('Content-length: ' || vLENGTH);
    owa_util.http_header_close;
    wpg_docload.download_file(vBLOB);
    END;
    Everything worked fine, but the following error occurs when im trying to insert an image into a table with a browse button.
    ORA-06502: PL/SQL: digital or value error: character of number conversion error
    The error above if I include the following line in the source code of my region report...
    ' < img src = "#OWNER #." DISPLAY_IMAGE? inID =' | NVL (IMAGE_ID, 0) | "" height = "50" width = "50" / > "IMAGE
    mainly, I added the above line in my source region only query for the image (size setting)...

    If I give the report source region coding as the means below, it works like a charm
    :)
    SELECT FILE_NAME,IMAGE_ID,
    dbms_lob.getlength("BLOB_CONTENT") "IMAGE" 
    FROM A_IMAGES
    ORDER BY FILE_NAME
    But what is the problem with the above code means, as he worked successfully and I can also see the images in the report, but each image is looking too big...

    In order to reduce the size of the image that I gave this line,
    ' < img src = "#OWNER #." DISPLAY_IMAGE? inID =' | NVL (IMAGE_ID, 0) | "'" height = "50" width = "50" / > ' IMAGE
    but if I gave ways online, error is occurring as the image does not store in a size appropriate for the table...

    But there, I noticed one thing,

    dbms_lob.getlength ("BLOB_CONTENT") 'IMAGE' is normally in a type of NUMBER , and it works very well...

    But instead of dbms_lob.getlength("BLOB_CONTENT") 'IMAGE', if I replaced it with *' < img src = "#OWNER #." DISPLAY_IMAGE? inID =' | NVL (IMAGE_ID, 0) | ' ' ' height = '50' * width = "50" / > ' IMAGE means, it is converted to a string...

    I think mainly for that alone, it's show error...

    How to rectify this problem friends...

    I also downloaded this app in my sample workspace,

    Please check with this application

    application name: region 50787-new report and here is the link http://apex.oracle.com/pls/apex

    WS: Mini_WS
    United Nations: [email protected]
    PWD: mini4i

    Thanks in advance

    Kind regards
    Mini

    I created a new page 3 which shows how to use the CSS (in the header HTML page) to control the scaling of the images displayed in the reports using BLOB support declarative.

    However, you really need to use generated thumbnails to the right size instead of scaling of the images in the browser. If the images used in your demo are for guidance, so they are waaayyyy too big to use in this scenario. This just kill performance on your web server and database and unnecessarily consume massive amounts of band network bandwidth. Your DBA, system administrators, ISPS and users will be very unhappy.

  • Text frame creation-urgent

    Hello

    I use indesign CS4 javascript methodology.

    I want to create a block of text that will be composed of

    1. an image

    2. different text on each line

    Please find the textframe sample below.

    Text in thetftex train must be updated in the future. If one way or another I need to find the youxt.

    Sample.JPG

    Please, help me create the textframe.

    Thank you

    Knockaert



    Well, then you can do a search and replace with the following command.

    For example

         app.findTextPreferences = NothingEnum.nothing;
         app.changeTextPreferences = NothingEnum.nothing;
         app.findTextPreferences.findWhat = "Sample text 17";
         app.changeTextPreferences.changeTo = "Hello";
         app.activeDocument.changeText();
    

    In the same way you can do to your exact needs.

  • Photoshop-inDesign-BridgeTalk

    I am trying to send a message of Photoshop, InDesign BridgeTalk and it is not working and I do not understand why. The main script works fine in ESTK with InDesign set as a target. But when I add the BridgeTalk it doesn't.

    Someone at - it suggestions?

    Also case with enumerators? I saw examples of scripts at a time.

    var myImages = new Array();
    myImages.push(new File('~/Desktop/Layer Comp 1.psd'));
    myImages.push(new File('~/Desktop/Layer Comp 2.psd'));
    myImages.push(new File('~/Desktop/Layer Comp 3.psd'));
    myImages.push(new File('~/Desktop/Layer Comp 4.psd'));
    myImages.push(new File('~/Desktop/Layer Comp 5.psd'));
    myImages.push(new File('~/Desktop/Layer Comp 6.psd'));
    myImages.push(new File('~/Desktop/Layer Comp 7.psd'));
    myImages.push(new File('~/Desktop/Layer Comp 8.psd'));
    var pdfFile = new File('~/Desktop/myFirstTest.pdf')
    //psRemote(myImages,300,250,pdfFile);
    
    // adapted from Paul Riggott
    // Code for send message and handling response
    // in the sending application (any message-enabled application)
    var res = undefined;
    var bt = new BridgeTalk;
    bt.target = "indesign";
    // the script passed to the target application
    var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+myImages.toSource()+","+300+","+250+","+pdfFile.toSource()+");");//define the work function and call it with arguments
    bt.body = myScript; 
    bt.onResult = function( inBT ) {myReturnValue(inBT.body); }// call the result processing function 
    // send the message and wait up to 10 sec for responce
    bt.send(20);
         
    // function to process the return string
    function myReturnValue(str){
         //process the results. here just assign strings
         res = str;
         caption = str;
    }
    // wrap your script in a function
    // this function is in whatever DOM the bridgeTalk target is. 
    // don't have comments in the psRemote function
    function psRemote( images, w, h, pdfFile ){
         function addDocument ( w, h ){
              var myDocument = app.documents.add(false);
              myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
              myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
              myDocument.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
              myDocument.documentPreferences.pageWidth = w;
              myDocument.documentPreferences.pageHeight = h;
              myDocument.documentPreferences.facingPages = false;
              var myMasterSpread = myDocument.masterSpreads.item(0);
              var myMarginPreferences = myMasterSpread.pages.item(0).marginPreferences;
              myMarginPreferences.left = 0;
              myMarginPreferences.top = 0;
              myMarginPreferences.right = 0;
              myMarginPreferences.bottom = 0;
              myMarginPreferences.columnCount = 1;
              myMarginPreferences.columnGutter = 0;
              myDocument.pages[0].appliedMaster = myMasterSpread;
              return myDocument;
         };
         function addPage( doc ){
              var page = doc.pages.add();
              page.appliedMaster = NothingEnum.NOTHING;
              return page;
         };
         function placeImage( doc, page, bounds, imageFile ){
              r = page.rectangles.add();
              r.geometricBounds = bounds;
              r.strokeWeight = 0;
              r.strokeColor = doc.swatches.item("None")
              r.place ( imageFile, false );
         };
         function mySnippet( doc, pdfFile ){
              var myDocument = doc;
    
                   app.pdfExportPreferences.pageRange = PageRange.allPages;
                   app.pdfExportPreferences.acrobatCompatibility = AcrobatCompatibility.acrobat6;
                   app.pdfExportPreferences.exportGuidesAndGrids = false;
                   app.pdfExportPreferences.exportLayers = false;
                   app.pdfExportPreferences.exportNonPrintingObjects = false;
                   app.pdfExportPreferences.exportReaderSpreads = false;
                   app.pdfExportPreferences.generateThumbnails = false;
                   try{
                        app.pdfExportPreferences.ignoreSpreadOverrides = false;
                   }
                   catch(e){};
                   app.pdfExportPreferences.includeBookmarks = false;
                   app.pdfExportPreferences.includeHyperlinks = false;
                   app.pdfExportPreferences.includeICCProfiles = true;
                   app.pdfExportPreferences.includeSlugWithPDF = false;
                   app.pdfExportPreferences.includeStructure = false;
                   app.pdfExportPreferences.interactiveElements = false;
                   app.pdfExportPreferences.subsetFontsBelow = 0;
                   app.pdfExportPreferences.colorBitmapCompression = BitmapCompression.zip;
                   app.pdfExportPreferences.colorBitmapQuality = CompressionQuality.eightBit;
                   app.pdfExportPreferences.colorBitmapSampling = Sampling.none;
                   app.pdfExportPreferences.grayscaleBitmapCompression = BitmapCompression.zip;
                   app.pdfExportPreferences.grayscaleBitmapQuality = CompressionQuality.eightBit;
                   app.pdfExportPreferences.grayscaleBitmapSampling = Sampling.none;
                   app.pdfExportPreferences.monochromeBitmapCompression = BitmapCompression.zip;
                   app.pdfExportPreferences.monochromeBitmapSampling = Sampling.none;
                   app.pdfExportPreferences.compressionType = PDFCompressionType.compressNone;
                   app.pdfExportPreferences.compressTextAndLineArt = true;
                   app.pdfExportPreferences.contentToEmbed = PDFContentToEmbed.embedAll;
                   app.pdfExportPreferences.cropImagesToFrames = true;
                   app.pdfExportPreferences.optimizePDF = true;
                   app.pdfExportPreferences.bleedMarks = false;
                   app.pdfExportPreferences.colorBars = false;
                   app.pdfExportPreferences.cropMarks = false;
                   app.pdfExportPreferences.omitBitmaps = false;
                   app.pdfExportPreferences.omitEPS = false;
                   app.pdfExportPreferences.omitPDF = false;
                   app.pdfExportPreferences.pageInformationMarks = false;
                   app.pdfExportPreferences.pdfColorSpace = PDFColorSpace.unchangedColorSpace;
                   app.pdfExportPreferences.registrationMarks = false;
                   try{
                        app.pdfExportPreferences.simulateOverprint = false;
                   }
                   catch(e){};
                   app.pdfExportPreferences.useDocumentBleedWithPDF = false;
                   app.pdfExportPreferences.viewPDF = false;
    
              myDocument.exportFile( ExportFormat.pdfType, pdfFile, false );
         };
    
         w = w+'pt';
         h = h+'pt';
         var bounds = ['0pt', '0pt', h, w ];
         var doc = addDocument( w, h );
         placeImage( doc, doc.pages.item(0), bounds, images[0] );
         if( images.length > 1 ){
              for( var i = 1; i < images.length; i++ ){
                   var page = addPage( doc );
                   placeImage( doc, page, bounds, images[i] );
              };
         };
         mySnippet( doc, pdfFile );
         doc.close(SaveOptions.NO);
         return 'done';
    };
    
    

    Hi Michel,.

    The problem here is between quotation marks or in the comments.

    Set a breakpoint at the 'bt.body = myScript;"line. Run the script, type 'Myscript' in the console and press ENTER. Copy the result into a new JS document, delete ' myScript result: ' at the top.

    What do you see?

    A total mess.

    But this is the script you want to run in InDesign.

    At a quick glance, I see several errors:

    • app.pdfExportPreferences.exportNonPrintingObjects should be pp.pdfExportPreferences.exportNonprintingObjects
    • If you send an object or an array via BridgeTalk using toSource(), you should recreate then using eval().
    • Message in conversation of bridge is built correctly.

    I Redid the script and it works for me (CS3 for Windows).

    However, I don't see why you want to call the script ID of the PS here.

    And finally, I suggested to all: outside of a script, please also provide sample files to test the script against them.

    Kasyan

Maybe you are looking for

  • Extreme implementation without an internet connection

    Hello I was hoping to use a previous generation Airport Extreme in a small temporary office that has no internet connection, so from my iPad, I can use a USB printer and external hard drive connected to the extreme. How to set up the extreme so it wi

  • Question of repairing ASP.

    End of December 2009, we bought a new Toshiba notebook / laptop. We let him down (provided someone else caused it). Screen broken LCD, and the USB - rf wireless mouse which was still in its USB port. We contacted Toshiba and they sent us to the repai

  • Microphone wireless stereo Headset & USB Bluetooth adapter is not working

    Hello I just bought a Toshiba Satellite A110-225 with a stereo Headset & Bluetooth wireless USB adapter. I installed the bluetooth stack update from the Toshiba site, but even after the build-in microphone still does not work. The audioplayback works

  • FFT and differ from the values overall btwn VI and tiara

    Hi all I have an application that displays live readings of vibrations which the spectrum and the overall vibration level.  Everything my generation of report is made in the DIAdem scripts, so it is essential that all values calculated and displayed

  • Cannot install Service Pack 2 E_no interface 80072EFD

    I tried 4 times to download and install service pack 2, I disabled my antivirus, etc.  I get error 80072EFD OR E_NO INTERFACE (ox800004002), I want to install internet explorer 9, but cannot until I have install service pack 2.  It's not automatic up