How to navigate to another page?

Hello

I want to navigate through my page to another when I click the button, here is my code:

SerializableAttribute public class Page1 extends Sprite
{
public var page2age2.
public void Page1() {}
  
var btn:Button = new Button();
var lab: Label = new Sun;
   
Lab.Text = "Click";
btn.addChild (lab);
btn.setPosition (10.50);
btn.addEventListener (MouseEvent.CLICK, dothis);
addChild (btn);
addChild (log);
stage.nativeWindow.visible = true;
   
}
public void dothis(event:Event):void {}
Page2 = new Page2();
addChild (log);

}
}

But it has not worked out. Help, please?

OK there was some compile errors in your class page 2. but no worries, I got em. Here's the code corrected for class Page1:

package
{
    //Remember to import all of the classes that you
    //are using
    import flash.display.Sprite;
    import flash.events.MouseEvent;

    import qnx.ui.buttons.LabelButton;

    // The following metadata specifies the size and properties of the canvas that
    // this application should occupy on the BlackBerry PlayBook screen.
    [SWF(width="1024", height="600", backgroundColor="#FFF000", frameRate="30")]
    public class Page1 extends Sprite
    {
        private var page2:Page2;

        public function Page1()
        {
            //initiate new object here to use later
            page2 = new Page2();

            var labButton:LabelButton = new LabelButton();

            labButton.label = "Click";
            labButton.setPosition(10,50);
            labButton.addEventListener(MouseEvent.CLICK,dothis);

            addChild(labButton);

            //addChild(log); //dont know where you declared this so commented out
            stage.nativeWindow.visible = true;
        }
        //change the event to MouseEvent since that is what you
        //are listening for
        public function dothis(event:MouseEvent):void {

            addChild(page2);
            //addChild(log); //dont know where you declared this so commented out

        }
    }
}

and here's the code fixed to your class page 2:

package
{
    import flash.display.Sprite;

    import qnx.ui.buttons.LabelButton;

    public class Page2 extends Sprite
    {
        public function Page2()
        {
            var label:LabelButton = new LabelButton();
            label.label = "Welcome to Second Page";
            addChild(label);
        }
    }
}

in your first class Page1 I combined the label and the button in the class LabelButton() of QNX. This code should now work correctly (tested and it went well).

Tags: BlackBerry Developers

Similar Questions

  • How to navigate to another page when I press the button

    Hello

    I want to know how to navigate from one page to another when I press the button.

    I want to condition function so I want to sail from bean managed for this action of button.

    can someone tell me please how to do?

    also how to throw error manually if assume that any condition in the get method of failure.

    Thanks in advance,
    SAN

    Hi user,

    as we have, you have requested a post on the connection,

    so I guess that since your post make a connection

    http://kohlivikram.blogspot.com/2008/10/how-to-create-simple-login-page-in-ADF.html

  • How to navigate from one page to another page.

    I'm trying my hands on Flex by building a sample application.

    After the user connects I want it to be on the home page. So in Flex how to navigate from one page to another on certain conditions?

    A way I thought is to make invisible visible n components, but which does not seem a good idea.

    What approach allows us to reach this goal?

    Please suggest.

    For your scenario, you really have to use the ViewStack (do not use States for this).

    Here is a link:

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=navigators_3.html

    And here is a very simple code:


    http://www.Adobe.com/2006/mxml">
     
     
       
         
       

       
         
       

       
         
       

       
         
       

     

    If this post answers your question or assistance, please mark it as such.

  • How do to navigate to another page when press the 'OK' button to confirm the dialogue?

    Hello
    In a detail of the page, I have a "Delete" button, and when you press this button, it will appear a confirmation dialog box, if the user click on 'Cancel', the dialog box is missing stay and still on the current page, if the user presses the "OK" button, it calls a method in the class ViewImple (do remove and other business process logic) and show a different page. The extract of the JSF page as follows:

    < text af:commandButton = 'Delete' action = 'delete' id = "cb3" >
    < af:showPopupBehavior popupId = "p1" triggerType = 'action' / >
    < / af:commandButton >
    < af:popup childCreation = autoCancel "delayed" = "disabled" id = "p1" contentDelivery = "immediate" >
    < af:dialog id = "d2" type = "okCancel" title = "Confirm deletion?" resize = 'off '.
    dialogListener = "#{scheduleBean.deleteScheduleDialog} ' contentWidth ="200""
    contentHeight = "50" >
    < af:outputText value = "Are you sure you want to delete this report?" id = "ot1" / >
    < af:clientListener type = "dialogue" method = "dialogAction" / >
    < / af:dialog >
    < / af:popup >
    < af:resource type = "javascript" >
    function dialogAction (evt) {}
    result of the var = evt.getOutcome ();
    if(Outcome == AdfDialogEvent.Outcome.Cancel) {}
    evt. Cancel();
    }
    }
    < / af:resource >

    Now the question is when I click on "OK" button confirm dialogue, dialogue is missing, but he can't get into the business logic in ViewImpl class method (the "delete" action value you access method adfc-config.xml file, and then navigate to another page), also click on the button 'Cancel' to stay on the current page.

    All tips will be of great help!

    You can use it as

    Navigate ("deletePage"); the adfc-config. XML

    public static navigate (String taskFlowName) Sub {}

    > FaceContext.getCurrentInstance () .getApplication () .getNavigationHandler () .handleNavigation (FaceContext.getCurrentInstance (), null, taskFlowName);

    }

    or for isnde action to propagate a method you have to use
    > MethodExpression exp =
    > (MethodExpression) ADFUtils.getMethodExpression ("deletePage");
    > getRegAgentNextBtn () .setActionExpression (exp);
    I hope that you ADFUtils with you

  • creation of delay before you navigate to another page

    All,

    I am trying to create a popup with image on a page load such as if you load this page the "loading... image into small div is displayed as for 2-3 seconds then the page automatically navigates to another page and pass a parameter value.»

    Here's what I did:

    1 added a popup div in my header page and within iam referencig < img src = #WORKSPACE_IMAGES #loading.gif / > it works correct loading pages

    2 created DA to present the button "NEXT"

    the problem is that #2 off so quickly before the iamge is paid or given,

    How to make changes for #1 works for 2-3 seconds then #2 then runs to go to the target page?

    Apex 4.2.

    Thank you.

    I made this another way.

  • How to redirect to another page in a dialogListener?

    Hi all

    I use JDeveloper 11 g with ADF BC.

    How to redirect to another page of a < af:dialog > dialogListener?
    I have a page with a button [delete] on this subject. When the user clicks on the button Delete, a confirmation dialog box appears asking "are you sure? [Yes/No] ». If the user answers [Yes], I will delete the current record and go to another page. Can I call a linking operation in the dialogListener, but I don't know how to go to another page.

    {} public void handleDeleteDialog (DialogEvent dialogEvent)
    OperationBinding operationBinding = bindings.getOperationBinding ("Delete");
    Object result = operationBinding.execute ();
    If (! operationBinding.getErrors () .isEmpty ()) {}
    }

    Redirect to another page?

    }

    Kind regards
    Samson Fu

    Hi Samson,.

    Check the following link corresponding to your query: -.

    Re: account page navigate to the next page when you click the button on the shortcut menu

    You can also make use of Navigation handler invoke the action of navigation in your workflow as

    FacesContext facesCtx = FacesContext.getCurrentInstance ();
    NH NavigationHandler = facesCtx.getApplication () .getNavigationHandler ();
    nh.handleNavigation (facesCtx, "", "ActionNameInTaskFlow");

    Vikram

  • How to navigate to another screen when I click on BitmapField what listener I have to use?

    Hello

    My requirement is I need to add icons to image in horizontally and when I click on the icon of the image it must navigate to specific screen, so I use BitmapField to display image icons and I added to HorizontalFieldManager but how to navigate to another screen when I click on BitmapField (the image icon) who listens to I have to use?

    Please suggest useful links.  Advanced thanks.

    Concerning

    Sunil.G

    Personally, I prefer to do the treatment that you need directly on the ground rather than using a listener.

    The following code is an example:

    BitmapField bmf = new BitmapField(Bitmap.getPredefinedBitmap(Bitmap.HOURGLASS), Field.FOCUSABLE) {
        protected boolean navigationClick(int status, int time) {
            Screen myScreen = new ();
            UiApplication.getUiApplication().pushScreen(myScreen);
            return true;
        }
    };
    
  • Add a FacesMessage and then navigate to another page

    Hello

    I have a grain of support which adds a message of faces and then returns a result as:
      FacesContext.getCurrentInstance().addMessage(null, infoMessage);     
      return "back";
    I found the message is displayed, even if the target of jspx fact include the tag of af: messages. It seems that the new page operates in a completely different context and the messages are lost. If I return null from the bean of the support in place so that no navigation will occur, the message is displayed correctly.

    Is there a way to add a message and navigate to another page? (i.e. If the message on the target page).

    I use ADF Faces 11.1.1.2.0.

    See you soon!

    Hello

    I've never tried in 11g, but it should work, especially with JSF 1.2. Is the case of the navigation using redirection?

    Kind regards

    ~ Simon

  • How to run to another page in a select list

    Hello

    I am newbie to APEX. Our version of the APEX is 5.0.2. Currently, I have a 7 page, which displays a selection list, of which user selects an element of value and then supposed to be directed to another page 8.  But nothing happens once I've selected only one item, say, he's not going anywhere.  Please let me know how I can fix the problem.  Thank you very much!

    Page 7, I turned "Go To Page 8" as:

    page7.PNG

    And then to page 8, I have:

    page8.PNG

    Best regards

    Hello

    Since you've already done this job, you probably realized that you need to add p7_study_name to Page elements field to submit and create a dynamic action related to this item (change), which updates the State of the list of sites.

    If you want to go to another page, when you select the item in the list, follow these steps:

    (1) create a dynamic action on p7_study_name, the Change event.

    (2) create a real action, Action: submit the page, button of request/name MY_REQUEST (or whatever you want).

    3) go to the processing Section and create logic to your page target Condition: Type Request = value, value MY_REQUEST

    Hope that helps.

    Pavel

  • How to link to another page in the same application?

    I think I have right now a brain fog. Cause I can't understand this.

    I would like to make a link to another page in the same application through just an arbitrary word in a paragraph.

    I'm not trying to spend all the values. I do not use a button or a text element.

    How can I make a link to a Word?

    Thank you very much
    Maggie

    Hi Maggie!

    I imagine me, that you have a html text and you want to have a hyperlink to another page in your application.

    For example, you have a text like: "I want to create a hyperlink to a page.

    Now, if your mouse passes the word 'hyperlink', you want to see this magic 'hand '.

    First copy the URL of the target page: something like this-> "http://127.0.0.1:8080/apex/f? ' p = 100:2:3122716493255005:NO:

    Changing your text to html in this way:

    I want to create a hyperlink to a page

    I hope it helps

    Gerhard

  • How to link to another page anchored using the tool?

    Hello

    I use the point (arrow tool) to post a link to anchors in my current page.  Is there a way of linking to anchors with the tool in another page (in other words I do not work on) or must it be done manually?

    Thank you

    Jake

    In the field of link in the properties panel, you must type the name of div ID or anchor in manually, preceded by a sign #.

    Link: some_page.html #ID

    Nancy O.

  • How to redirect to another page Using JavaScript in ADF Faces?

    Hi guys,.

    I have a case of user UI that has an af:menu which contains mutiple af:goMenuItem. When the user clicks on the menu, the menu slides down and the af: goMenuItem presents itself. As we know, you can set page destinations in af:goMenuItem to go to another page when the user has clicked, but af:menu itself cannot be redirected to another page. Well, the case of the user wants the menu itself could be redirected if the user clicks on it.

    So I think that the use of JavaScript to do this: when you click on the af: menu, redirect to another page. BUT, I've looked over the ADF Faces Javascript API and wasn't able to find this piece of code to do this. Any help?

    Another work around to the user scenario is to use the brands of HTML + CSS/JavaScript instead of af: menu and af:goMenuItem, but this changes the scope of the technology although it is not hard to do

    Any other idea to make the case of the user other than what I could think?


    Thank you guys!

    Jay

    Hello

    1. you can have a control hidden element to the navigation based on a case of control flow. In this case, you access the JavaScript command component create a new ActionEvent and he queued
    2 - JavaScript can use an af:serverListener to call a server side managed bean method to perform the navigation

    There is no JavaScript API for navigation in ADF Faces because navigation in JavaServer Faces is an event-driven framework and we do not support the developers of fight against the framework.

    Frank

  • Button to navigate to another page does not not work properly all the time.

    Hello

    I'm just starting to explore the ADF, I use Jdeveloper 12.1.3.0.0 and integrated weblogic server that comes with the IDE.

    I just created a simple application with a welcome page called Main.jsf and then 2 task bounded, streams called SearchStudentsFlow and Studenloansflow, each workflow has a jsf page. The home page has a single button that sends me to the first task flow, SearchStudentsFlow and I can see is the page in that workflow, AwardsSearch.jsf. Also in the AwardsSearch.jsf page I have a button that takes back me to the home page.

    The first problem I have is that when I run the application starting at the home page button in the works of the great homepage the first time, the button send me to the AwardsSearch.jsf , but once I decide to go back to the homepage and then click on the button to go to the first task flow the button does nothing. This happens whenever I decide to return to the home page of any page in my project.

    Also, I copied the entire previous project into a new project and I decided to use the ADF security infrastructure in this new project to create a log in page create users and give them different roles and levels of access.

    I created some users who have access to all pages and all the streams, but when I run the application starts the login page and I login successfully and go to the home page, the button on the home page does not work.


    I don't know why the button sometimes works, but not of others and also I do not know why when I use the login page, the button doesn't work. I don't know if these 2 problems are related or not.


    This is my code in the homepage:

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html>
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <af:document title="Main.jsf" id="d1" binding="#{backingBeanScope.backing_Main.d1}">
            <af:form id="f1" binding="#{backingBeanScope.backing_Main.f1}">
                <af:panelGridLayout id="pgl1" binding="#{backingBeanScope.backing_Main.pgl1}">
                    <af:gridRow marginTop="5px" height="20%" id="gr1" binding="#{backingBeanScope.backing_Main.gr1}">
                        <af:gridCell marginStart="5px" width="34%" marginEnd="5px" id="gc1"
                                     binding="#{backingBeanScope.backing_Main.gc1}">
                            <af:image source="/images/NU_Logo_purple.jpg" shortDesc="Northwester University" id="i1"
                                      binding="#{backingBeanScope.backing_Main.i1}"
                                      inlineStyle="width:293px; height:197px;"/>
                        </af:gridCell>
                        <af:gridCell id="gc3" binding="#{backingBeanScope.backing_Main.gc3}" width="33%"/>
                        <af:gridCell id="gc4" binding="#{backingBeanScope.backing_Main.gc4}" width="33%"/>
                    </af:gridRow>
                    <af:gridRow id="gr3" binding="#{backingBeanScope.backing_Main.gr3}" height="10%">
                        <af:gridCell id="gc5" binding="#{backingBeanScope.backing_Main.gc5}"/>
                        <af:gridCell id="gc6" binding="#{backingBeanScope.backing_Main.gc6}">
                            <af:button text="Search Awards" id="b1" binding="#{backingBeanScope.backing_Main.b1}"
                                       action="goSearchAwards"/>
                        </af:gridCell>
                        <af:gridCell id="gc7" binding="#{backingBeanScope.backing_Main.gc7}"/>
                    </af:gridRow>
                    <af:gridRow marginTop="5px" height="70%" marginBottom="5px" id="gr2"
                                binding="#{backingBeanScope.backing_Main.gr2}">
                        <af:gridCell marginStart="5px" width="100%" marginEnd="5px" id="gc2"
                                     binding="#{backingBeanScope.backing_Main.gc2}"/>
                    </af:gridRow>
                </af:panelGridLayout>
            </af:form>
        </af:document>
        <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Main-->
    </f:view>
    

    And this is my code in the adfc-config. XML

    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <view id="Main">
        <page>/Main.jsf</page>
      </view>
      <task-flow-call id="SearchStudentsFlow">
        <task-flow-reference>
          <document>/WEB-INF/SearchStudentsFlow.xml</document>
          <id>SearchStudentsFlow</id>
        </task-flow-reference>
      </task-flow-call>
      <control-flow-rule id="__3">
        <from-activity-id>Main</from-activity-id>
        <control-flow-case id="__5">
          <from-outcome>goSearchAwards</from-outcome>
          <to-activity-id>SearchStudentsFlow</to-activity-id>
        </control-flow-case>
      </control-flow-rule>
      <managed-bean id="__4">
        <managed-bean-name>backing_AwardsSearch</managed-bean-name>
        <managed-bean-class>view.backing.AwardsSearch</managed-bean-class>
        <managed-bean-scope>backingBean</managed-bean-scope>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1AwardsSearch.jsf-->
      </managed-bean>
      <managed-bean id="__2">
        <managed-bean-name>backing_Main</managed-bean-name>
        <managed-bean-class>view.backing.Main</managed-bean-class>
        <managed-bean-scope>backingBean</managed-bean-scope>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1Main.jsf-->
      </managed-bean>
    </adfc-config>
    

    No idea why the button does not work correctly all the time?

    Thanks in advance

    Play well!

    Now, we understand the problem and can help you solve it.

    The problem is that you dropped the home page in the flow of student loan and place you thinking that you must return to the point of departure, the unlimited workflow. Actually, you don't the sheet flow loan student but simply see the homepage as part of the loan flow. The navigation rules remain those defined in the flow of student loan. Now, when you click on a button to jump to the stream of research, the target is undefined zed you simply stay on the same page, the home page.

    To make your work use case, you set a return action in the flow of student loan that return to the caller, the flow of research which, in turn, will return to his name the workflow without terminals that hold the homepage. Remove the homepage of flow of charge to students. The case of navigation allows to navigate between the button and the new return action.

    In the adf of flow research a wild-card rule that accesses the return operation sends the return flow to the home page. You must remove the sailing time pointing to research prices for the return operation because it can use the same rule of navigation of wild-card then. Then, you add a Bach student load flow navigation rule to the scholarship search page. This navigation is used for the return actionto_searchStudents.

    Timo

  • How Textfield text on another page qml property access

    Hello

    I started 10 BB development recently and need help. I searched this forum but could not find some information exactly related to my problem (unlike only), or I missed something from basically. My main.qml, I want to access the text property of the textfield of the InputControl.qml to be used as a parameter in my SQLQuery (attached object). I tried to use the fieldname method alias property, but it does not work. I can't feature outside. Here is my code:

    hand. QML

    import bb.cascades 1.4
    import bb.cascades.datamanager 1.2
    import bb.system 1.0
    import bb.data 1.0
    
    Page {
    
        id: root 
    
        titleBar: UIControls {
        }
    
        //! [0]
       content: Container {
    
            leftPadding: ui.du(2)
            rightPadding: ui.du(2)
            topPadding: ui.du(2)
            bottomPadding: ui.du(2)
    
            InputControl {
            }
    
            // The ListView that's used to display the artist data
            //! [1]
            ListView {
                id: myListView
    
                //property variant dq: defaultDataQuery
                // Associate the list view with the data model that's defined in the
                // attachedObjects list
                layout: StackListLayout {
                    headerMode: ListHeaderMode.Sticky
                }
                layoutProperties: StackLayoutProperties {
                    spaceQuota: 1.0
                }
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
    
                listItemComponents: [
    
                    ListItemComponent {
                        type:  "item"
    
                        Container {
                            Label {
                                text: ListItemData.Japanisch
                                layoutProperties: StackLayoutProperties {
    
                                }
                                topMargin: 5.0
                                textStyle {
                                    base: SystemDefaults.TextStyles.TitleText
                                    fontWeight: FontWeight.Bold
                                    color: Color.create("#7a184a")
                                }
    
                            }
                            Label {
                                text: ListItemData.Lesung
                                textFit.maxFontSizeValue: 9.0
                                textStyle {
                                    base: SystemDefaults.TextStyles.TitleText
                                    fontWeight: FontWeight.Normal
                                    color: Color.create("#ff1818e9")
                                }
    
                            }
                            Label {
                                text: ListItemData.Deutsch
                                textStyle {
                                    base: SystemDefaults.TextStyles.TitleText
                                    fontWeight: FontWeight.Normal
                                }
    
                                multiline: true
                                textFit.maxFontSizeValue: 8.0
                            }
                            Divider {}
                        }// Container
                    }
                    // Use a standard list item to display the data in the model
                ]    
    
            } // end of ListView
    
        }//![1]
    
        attachedObjects: [
            //! [2]
            // One of the default provided DataModel's
    
            GroupDataModel {
                id: dataModel
                grouping: ItemGrouping.None
            },
            DataSource {
                id: dataSource
    
                // Load the data from an SQL database, based on a specific query
                source: "WadokuJT.db"
                //query: "select Japanisch, Deutsch, Lesung from WadokuJT where Deutsch like '%Wasser%'"
                query: "select Japanisch, Deutsch, Lesung from WadokuJT where Deutsch like '%" + stext + "%'";
    
                onDataLoaded: {
                    // After the data is loaded, insert it into the data model
                    dataModel.insertList(data);
    
                }
                type: DataSourceType.Sql
            } // end of DataSource      
    
        ]//! [2]  
    
        actions: [
            //! [8]
            ActionItem {
                title: qsTr("Search")
                imageSource: "asset:///images/ic_search.png"
                ActionBar.placement: ActionBarPlacement.Signature
                onTriggered: {
                    myListView.dataModel = null
                    dataSource.load()
                    //myListView.dq = defaultDataQuery
                    myListView.dataModel = dataModel 
    
                }
            },
    
            ActionItem {
                title: qsTr("Settings")
                imageSource: "asset:///images/ic_settings.png"
                onTriggered: {
    
                }
            },
    
            ActionItem {
                title: qsTr("Help")
                imageSource: "asset:///images/ic_help.png"
                onTriggered: {
    
                }
            }                           
    
        ]//![8]
    
    } // end of Page
    

    And here is my InputControl.qml

    import bb.cascades 1.4
    
     Container {
         property alias stext: txtSearchText.text
    
        Label {
            id: lblSearchText
            text: "Searchtext\r\n"
    
        }
    
        TextField {
            id: txtSearchText
            layoutProperties: FlowListLayoutProperties {
    
            }
            hintText: "Enter Searchtext"
        }
    }
    

    Any help is greatly appreciated. Thank you.

    Give InputControl an id (in main.qml), for example someId.

    Access the variable an alias like someId.stext

  • How to navigate to another item

    Hello

    I have this type of requirement,

    I have 5 columns attribute are here (to attribut1,-Attribute5). After Attribute5 column, I have another column deptno.

    My requirement is Attribute1 is active and all the other columns of 4 attribute are disabled when you open a form.

    If Attribute1 is not Null then select same as wise column attribut2

    If attribut2 is not Null then select attribut3 column

    -----------

    ----------

    I had written logic. But I'm not sail if Attribute1 is not null, then the cursor on the Deptno column. But I used NEXT_ITEM GO_ITEM built - ins also. But the cursor go to Deptno column, I need the cursor go to attribut2 (if Attribute1 is not NULL)

    --

    Thank you and best regards,

    Badr Hari

    Hello

    I had the requirement.

    This is the Code

    Please see this code once

    DECLARE

    Nom_element VARCHAR2 (100);

    BEGIN

    -Check if the value of attribut2 is not null, then turn off the attribut3 property

    IF: XXISC_Emp_Details_V.Attribute2 IS NOT NULL THEN

    SET_ITEM_PROPERTY ('XXISC_EMP_DETAILS_V.ATTRIBUTE3', ACTIVE, PROPERTY_TRUE);

    END IF;

    Nom_element: = GET_ITEM_PROPERTY ('XXISC_EMP_DETAILS_V.ATTRIBUTE3', ENABLED);

    IF nom_element = "TRUE" THEN

    SET_ITEM_PROPERTY ('XXISC_EMP_DETAILS_V.ATTRIBUTE3', NAVIGABLE, PROPERTY_TRUE);

    END IF;

    EXCEPTION

    WHILE OTHERS THEN

    MESSAGE ("internally is a problem. Please try again...');

    END;

Maybe you are looking for