Next button and view name - InfoPath Dev
in

InfoPath Dev

Next button and view name

Last post 06-20-2008 10:33 PM by swathip. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-12-2006 12:54 AM

    • Raoul
    • Top 500 Contributor
    • Joined on 05-05-2006
    • Posts 32

    Next button and view name

    Hi all,
    I have an Infopath module with 20 views. On any view, I need to create a button for open of next sequential view (not by view name, but by view order). Also I need a text field, one for single view, that automatically contain view name.
    Can I do that?
    Thanks in advance.
    Raoul
  • 10-13-2006 02:48 AM In reply to

    Re: Next button and view name

    Hi Raoul,
    Have 2 views namely "View A" and "View B".

    In the "View A" keep a button called "Change View".

    In "View B" keep a textbox whose underlying field is "field2".

    Now in the onclick event of "Change View" button in View A, write the following code.

    string nextview=thisXDocument.ViewInfos[1].Name;
    thisXDocument.View.SwitchView(nextview);
    thisXDocument.DOM.selectSingleNode("/my:myFields/my:field2").text=thisXDocument.View.Name;

    So in ur case replace ViewInfos[1] by ViewInfos and increment/decrement "i" based on ur needs.
    Maintain "i" globally.

    Regards,
    Abhishek
  • 10-18-2006 12:42 PM In reply to

    • Raoul
    • Top 500 Contributor
    • Joined on 05-05-2006
    • Posts 32

    Re: Next button and view name

    Hi Abhishek,
    all right with your infos.
    Thank you.
    Raoul
  • 06-20-2008 03:13 PM In reply to

    • bryanfox
    • Not Ranked
    • Joined on 06-20-2008
    • Mission Hills, CA
    • Posts 1

    Re: Next button and view name

    Hello Abhishek,

    I think this message of yours may speak to our issue/plan.   We have a form that is destined to have 2 views (we'll call them "View A" and "View B")

    "View A" is a full view of a form that has several items (Drop-Downs, Fill-in boxes, and so on).
    "View B"
    is a detail blow-up of one of the items, which is an extensive Multiple Select

    When the user clicks on a control located at this item, the view should change from A to B.  After the user makes his selections in "View B," they will "save" their selections by hitting another control which switches back to View A.

    1.  Am I correct that the first control is what you have termed the button called "Change View"?
    2.  Am I correct that this initial control would have an onclick event of "Change View" button in View A, with the following code.


    string nextview=thisXDocument.ViewInfos[1].Name;
    thisXDocument.View.SwitchView(nextview);
    thisXDocument.DOM.selectSingleNode("/my:myFields/my:field2").text=thisXDocument.View.Name;


    3.  What do I do for the Control to switch back to A? (from the user perspective, they would be saving their selections for the this item before moving to the next)

     

    _____________________________________________________________
    Bryan Fox | Facey Medical Foundation | Web Communications Administrator, Information Systems
    Office: (818) 837-5843 | Email: [email protected]
  • 06-20-2008 10:33 PM In reply to

    Re: Next button and view name

    Hi,

     1. You are correct.

    2. You are correct.

    3. Use the same code with minor changes for the control in the second view.

    string nextview=thisXDocument.ViewInfos[0].Name;
    thisXDocument.View.SwitchView(nextview);
    thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1").text=thisXDocument.View.Name;

    Swathip
    www.ggktech.com
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.