Sharing of two Documents QML

Hello! I'm currently experimenting with a new application and I was wondering if it is possible to use a card sharing to share text that it is in a text box in another document QML?

Here's the code, two pages:

EditSheetqml

import bb.cascades 1.2

Sheet {
    id: editSheet

    // Custom properties
    property alias title: addBar.title
    property alias hintText: itemText.hintText
    property alias text: itemText.text

    // A custom signal is triggered when the acceptAction is triggered.
    signal saveBucketItem(string text)
    Page {
        id: addPage
        titleBar: TitleBar {
            id: addBar
            title: qsTr("Add") + Retranslate.onLanguageChanged
            visibility: ChromeVisibility.Visible

            dismissAction: ActionItem {
                title: qsTr("Cancel") + Retranslate.onLanguageChanged
                onTriggered: {
                    // Hide the Sheet.
                    editSheet.close()
                }
            }

            acceptAction: ActionItem {
                title: qsTr("Save") + Retranslate.onLanguageChanged
                onTriggered: {
                    // Hide the Sheet and emit signal that the item should be saved.
                    editSheet.close();
                    editSheet.saveBucketItem(itemText.text);
                }
            }
        }
        Container {
            id: editPane
            property real margins: 40
            background: Color.create("#f8f8f8")
            topPadding: editPane.margins
            leftPadding: editPane.margins
            rightPadding: editPane.margins

            layout: DockLayout {
            }

            attachedObjects: [
                TextStyleDefinition {
                    id: editTextStyle
                    base: SystemDefaults.TextStyles.TitleText
                }
            ]
            Container {
                TextArea {
                    id: itemText
                    hintText: qsTr("Add a new item to your to-do list") + Retranslate.onLanguageChanged
                    topMargin: editPane.margins
                    bottomMargin: topMargin
                    preferredHeight: 575
                    maxHeight: 575
                    horizontalAlignment: HorizontalAlignment.Fill

                    textStyle {
                        base: editTextStyle.style
                    }
                }
            }// Text Area Container
        }// Edit pane Container
    }// Page

    onOpened: {
        itemText.requestFocus()
    }

}// Sheet

BucketPage.qml

import bb.cascades 1.2

// This details Page for a bucket item that shows the entire task contained in a bucket
// item and adds functionality for editing the item.

Page {
    id: bucketPage
    property variant item
    property variant bucketModel
    property alias title: titleBar.title

    titleBar: TitleBar {
        id: titleBar
        visibility: ChromeVisibility.Visible
    }

    Container {
        layout: DockLayout {
        }

        Container {
            leftPadding: 22
            rightPadding: leftPadding
            horizontalAlignment: HorizontalAlignment.Left

            Label {
                id: bucketText
                multiline: true
                text: bucketPage.item.title
                textStyle.base: SystemDefaults.TextStyles.TitleText
            }
        }
    }

    shortcuts: [
        SystemShortcut {
            // The edit short cut shows the edit sheet.
            type: SystemShortcuts.Edit
            onTriggered: {
                editSheet.open();
                editSheet.text = bucketText.text;
            }
        }
    ]

    actions: [
        ActionItem {
            title: qsTr("Edit") + Retranslate.onLanguageChanged
            imageSource: "asset:///IMG/ic_edit.png"
            ActionBar.placement: ActionBarPlacement.OnBar

            onTriggered: {
                editSheet.open();
                editSheet.text = bucketText.text;
            }
        },
        ActionItem {
            ActionBar.placement: ActionBarPlacement.OnBar
            title: qsTr("Share")
            imageSource: "asset:///IMG/ic_share.png"

            onTriggered: {
                shareAction.trigger("bb.action.SHARE")
            }
        }
    ]
    // itemText is the id of the TextArea in the EditSheet qml document - I would like to be able to share that text but from within this document.
    attachedObjects: [
        Invocation {
            id: shareAction
            query.mimeType: "text/plain"
            query.invokeActionId: "bb.action.SHARE"
            query.data: qsTr("Check out my recent item: ") + itemText + qsTr("\n\nGet your free copy  at: http://appworld.blackberry.com/")
            query.onQueryChanged: {
                query.updateQuery()
            }
        },
        EditSheet {
            id: editSheet
            title: qsTr("Edit") + Retranslate.onLanguageChanged
            hintText: "Update your description"

            onSaveBucketItem: {
                // Call the function to update the item data.
                bucketModel.editBucketItem(bucketPage.item, text);

                // Update the current item property data used in this Page to do this
                // one has to copy all values to 'tempItem'.
                var tempItem = bucketPage.item
                // Update the item property
                tempItem.title = text
                // Then copy all values back to 'bucketPage.item'
                bucketPage.item = tempItem
            }
        }
    ]
}

What I'm asking is, so it is possible to use the button share (on the action in BucketPage.qml bar) to share the text of text box id: Texteelement (from the EditSheet.qml) is possible to share the text in the document sharing in BucketPage.qml EditSheet.qml?

Any help would be greatly appreciated!

Thanks in advance

Thanks for your help, but I always had the same problem when using your code example.

I played around with a few things and by changing this line of code.

query.data: qsTr("Check out my recent item: ") + editSheet + qsTr("\n\nGet your free copy at: http://appworld.blackberry.com/")

in this line of code.

query.data: qsTr("Check out my recent item: ") + ("'") + bucketText.text + ("'") + qsTr("\n\nGet your copy at: http://appworld.blackberry.com/")

Seemed to have solved the problem

Tags: BlackBerry Developers

Similar Questions

  • Two documents qml, a normal application, one to share the preview card generator

    Hey. Read and experiment - what is the proper way to load a qml document when the application is opened normally and the other when the application is invoked as a previewer of card using a share action? I guess you can't mess with main and the createqmldoc and the setscene must be in the constrcutor.

    How could I go about this?

    Appreciate the help,

    See you soon

    Justin D.

    We use startupMode to check how the application was launched

    switch (invokeManager->startupMode()){
    

    in the case of ApplicationStartupMode::LaunchApplication we init the complete user interface, otherwise wait us signal invoked and go from there.

  • Pages cannot be split for two documents?

    I have a MacBook Pro (2015) with macos beta Sierra (although that has happened with the beta no El Capitan.

    I can't ever two pages of documents to work in split view. Never. It's infuriating as a Publisher. Can anyone help? I want to see two documents side by side.

    I hit the green button full page and drag it sideways, when I click on another of open pages it says "split view is not available"

    What.the.Heck.

    This isn't a beta support site, and the terms of use for these communities to support Apple open prevents us from discussions on beta products. Incidentally, you try to use a published version of Pages on a beta version of Mac OS X, and there is no assurance that split currently working properly on this beta product, or that the version of the Pages is fully compatible with it either.

    You can open the same document twice in the Pages, and position-by-side, the documents are not open to the exact location in the file system. In El Capitan, I have no problem placing a first-page document in split and then view by clicking on the second to fill the other half of the screen.

  • Merge two documents in files to PDF, into one?

    Merge two documents in files to PDF, into one?

    Hi antoniof33712361,

    You can subscribe to the Adobe PDF package & use it will be Adobe Acrobat Reader DC to combine PDF files https://cloud.acrobat.com/combinepdf or you can purchase/subscription application Download Adobe Acrobat Acrobat products | Standard, Pro | DC, XI, X this feature.

    Kind regards
    Nicos

  • I can layer two documents in Indesign so I have only to make changes to one and it affects them both?

    I can layer two documents in Indesign so I have only to make changes to one and it affects them both?

    You can't superimpose two documents, but you can use the link and place feature in InDesign (Edit > place and link). This would allow you to have a single document which contained the main text, and then place this text in another document. When you change the text in the master file, any file that is using text related to this master file will indicate that it must be updated and it can bring in the modified text. Another option would be to export the text as a story in InCopy (.icml). Choose Edition > InCopy > export > selection, then the place that history in two InDesign documents. You can use the assignments Panel then check text for editing, but it would achieve a similar result. The first options would be the simpler of the two.

  • How to display two documents side by side PDF?

    I just upgraded to Acrobat reader DC. I want to display two documents side to side in order to compare them and in this latest and greatest, best sliced bread version I do not appear to be able to do. WTF?

    Hi Doug,.

    Can you please mention the version of the dowry of reader you use?

    If you use a pdf view in the view tabbed browsing and you want to open the other pdf in a different window, so that you can compare PDF files, you can drag one of the tabs off window Acrobat pdf and open the pdf file in a new window.

    Kind regards

    Raju.

  • How to display two documents side by side - PDF not stacked?

    How to display two documents side by side - PDF not stacked?

    In the Acrobat preferences turn off the display of the tabs.

  • How can I open two documents separated into two screens?

    I can't hav

    I use to be able to see the two documents open at the same time Add.  He won't let me since I've updated.

    Hi ljesmok,

    The documents could open in different tabs.

    If you want to open in different screens, then please uncheck 'Open documents in the new tab' under ' Edit > Preferences > general.

    Hope that helps.

    Kind regards

    Ana Maria

  • Comparison of two documents

    I compare two documents and I can see the differences, but there is a progress screen that stays on top and doesn't seem to end. Any ideas?

    Use of Adobe Acrobat Pro 8.1 Windows DC

    Compare pdf.JPG

    My solution has been to save the file and open it again.

  • Help with Ora-19046: Out-of-table row cannot be shared by two top-level tab

    Hello!
    My tutor asked me to store and query xml "natively" files in xml db. First, I tried to save the patterns that rely on these xml files. There are about 30 patterns thus between them, and I have to use 'FORCE' them to save, like this:

    BEGIN
    () DBMS_XMLSCHEMA.registerSchema
    "http://www.isotc211.org/gmd/metadataEntity.xsd,"
    BFILENAME ('ISOGMD', 'metadataEntity.xsd'),
    TRUE,
    TRUE,
    FAKE,
    TRUE,
    (TRUE);
    END;

    So no tables are created automatically. And when I wanted to create a XML based on patterns of thses manually, he proped error: ORA-19046: Out-of-table row cannot be shared by two top-level tab. He mistook me for a week. Does anyone know what is the problem with registration? Forward online! Thank you!

    Maybe you're missing type due to the DeffaultTable = ""-xdb:annotation "
    Try to understand it with the trace file that will be created if you set

    ALTER SESSION SET EVENTS = '31098 TRACE NAME CONTEXT FOREVER' 
    
  • can anyone tell how to compare two documents with two controlled with the same mouse pointers

    can anyone tell how to compare two documents with two controlled with the same mouse pointers?

    Windows and OS X can only display a mouse pointer - it is created by the operating system, not the application.

  • How to install the db oracle11gr2 shared on two asm starts

    I have two ASMDGs (ASMDG & ASMDG2 say) with two separate databases (say, orcl & orcl2). Now, I want to install a shared database (say orcl1) on both of these ASMDGs. But I use dbca to create orcl1 when the selection starts, I can't select both two starts.

    Can anyone give help how do to install a database shared on two asm starts?

    Thank you

    Choose only one initially and, a little further in the DBCA, you can set the location of the data files separately.

    Here you can specify which of the two starts to use for each data file manually. You can create the ASM directories manually with asmcmd.

    I hope this information helps,

    Kind regards

    Enric Moya

  • sharing between two apple ID

    How can I share contacts and calendars between two Apple ID?  Also my wife and share our music iTunes between our IDs?

    See the following topics:

    http://www.Apple.com/icloud/family-sharing/

    Family shares - Apple Support

    Implement the family sharing - Apple Support

  • have two documents where do go next? and I can find them to name in a directory?

    scan? where end documents?

    You must specify where YOU want to save in.

    http://www.ehow.com/how_4884422_save-scanned-document.html

    5. Select a folder in which the scanned copy of the document must be saved using Browse. Because all the scanning software does not automatically start the scanned document, select a shared folder that is easy to remember.

    For more information on how to use your Scanner/printer, contact the manufacturer of your printer/Scanner to read their manuals online for your model.
    Or search in the start menu > programs > read their software notice here.

    See you soon. Mick Murphy - Microsoft partner

  • File sharing between two computers with DIFFERENT Versions of Windows (XP & Vista)

    I just bought a WRT54G4 Wireless-G router broadbad & am a n00bie to this any thng in network.  I like the current state of things now, all considering that both my desktop PC (Windows XP Home Edition) & my laptop wireless PC (Windows Vista Home Premium) are online (local & Internet) BUT I can't seem to get things while my desktop PC sharing files which can then be read and otherwise accessible by the laptop.

    Here's what I'm trying to...

    * Have BOTH computers access the Internet via a private network (which I already managed to do)

    * Having the Office to share files that are accessible (wireless or not) from my laptop

    Essentially, I want to be able to use the TWO HDs according to needs.

    My office is an old computer AMD Duron 1 Ghz. with 512 MB RAM & can handle a FEW small spots, but the big gun is my laptop (A 1.86 Ghz. Intel Pentium with 3 GB of RAM). Because of his speed & memory, I would like to have the laptop handle larger & more intensive tasks.

    Although my laptop has a smaller hard drive compared to my office (A 136 GB HD in the office (200 GB) compared to a 141 GB (I guess this HD is around this size, but since it came pre-installed, & I am currently leasing to buy, I don't know), I would like to be able to use if possible of the TWO HDs.)  All I need is for both computers see the two HDs & all the files on it.

    I tried implementing the sharing of files, as shown elsewhere on the Linksys site, but he lost when I rebooted both my computers, since that's what the page told me to do (I followed Windows XP as the Office has all the files that I want to share & Windows XP is the operating system of the desktop).  Should I have not done this?

    In addition, my ultimate goal is to GET RID of the big bulky monitor I connected to the back end of my desktop PC & all simply use the laptop instead, because it does not take a lot of desktop space.  Y at - it an emulator "Virtual monitor" or software of some sort that I can download (for FREE please ) that will allow me to see the jobs of all the computers on my network, just as if I

    had REAL monitors?  If so, where could I find one?

    In short, together, I have accomplished a lot lately since I bought the router & linked computers, as you can see, I still need help & I've got some learning to do.

    Any help I can get would be MOST appreciated.

    See you soon

    Pat Cook

    Denver, CO

    Make sure that the file and printer sharing is enabled...

    Also, make sure the computer are in the same workgroup...

    Default workgroup in Windows Vista has been renamed to WORKING group. In Windows XP, the default workgroup name is MSHOME...

    Also go into the computer on each computer software firewall and set it to "trust", other computers on your network.
    If your firewall or PC security program maintains a list of approved applications (also known as a "zone of confidence"), so make sure that your router is in the zone of confidence on your firewall...

Maybe you are looking for