Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2006

Tip: Looking for answers? Try searching our database.

Previous Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Debs - 23 Apr 2006 11:04 GMT
I'm new to InfoPath...I have a button labelled"Previous". When the button is
pressed, I would like for it to go to the previous view.
S.Y.M. Wong-A-Ton - 23 Apr 2006 12:09 GMT
Have you already tried adding a rule to the button to switch between views?

- Double-click on the button to open its "Properties" dialog box.
- Click on "Rules..." button to open "Rules" dialog box.
- Click on "Add..." button on "Rules" dialog box to add a rule.
- Click on "Add Action..." button on "Rule" dialog box to add an action.
- Select "Switch views" and select view to switch to from drop-down list
boxes on "Action" dialog box.
- Click on "OK" button when closing all dialog boxes.
---
S.Y.M. Wong-A-Ton

> I'm new to InfoPath...I have a button labelled"Previous". When the button is
> pressed, I would like for it to go to the previous view.
Debs - 23 Apr 2006 20:27 GMT
Thanks for answering so quickly. Sorry, I did not mention that I have 6
views. So the "Previous" button should be able to go to any of the views the
user came from.

Debs

> Have you already tried adding a rule to the button to switch between views?
>
[quoted text clipped - 10 lines]
> > I'm new to InfoPath...I have a button labelled"Previous". When the button is
> > pressed, I would like for it to go to the previous view.
S.Y.M. Wong-A-Ton - 23 Apr 2006 21:03 GMT
I'm assuming you have buttons on those 6 views that direct the user to the
view where the "Previous" button is located? If you do, you could add a field
to your Main DOM to be able to record the name of the last view visited. Add
a rule on each one of those 6 buttons that sets the value of the field to the
name of the view where each button is located. Once the user clicks on a
button, the field will be populated with the name the last view visited. You
can then retrieve this name (= the value of the field) in the OnClick event
handler of the "Previous" button and use it to programmatically switch views
using the SwitchView method (see
http://msdn.microsoft.com/library/en-us/ipsdk/html/xdmthSwitchView_HV01021422.as
p?frame=true
).
---
S.Y.M. Wong-A-Ton


> Thanks for answering so quickly. Sorry, I did not mention that I have 6
> views. So the "Previous" button should be able to go to any of the views the
[quoted text clipped - 16 lines]
> > > I'm new to InfoPath...I have a button labelled"Previous". When the button is
> > > pressed, I would like for it to go to the previous view.
Debs - 26 Apr 2006 05:35 GMT
I'm not too experienced coding. I went to the link you  provided, but did
not quite understand it. Can you give me an example? By the way where do you
put the code?

Thanks!

Debs
> I'm assuming you have buttons on those 6 views that direct the user to the
> view where the "Previous" button is located? If you do, you could add a field
[quoted text clipped - 30 lines]
> > > > I'm new to InfoPath...I have a button labelled"Previous". When the button is
> > > > pressed, I would like for it to go to the previous view.
S.Y.M. Wong-A-Ton - 26 Apr 2006 08:34 GMT
Let's say you have two views with the names: "View 1" and "Final". On "View
1" you have a button with a rule set on it to go to view "Final" whenever the
button is clicked. On view "Final" you have your "Previous" button.

Add a field to your Main DOM via the "Data Source" pane. Let's call it
"lastViewName". Go to view "View 1" and add another rule to the button that
says:

Set a field's value: lastViewName = "View 1"

Now go to view "Final" and double-click on the "Previous" button to open its
"Properties" dialog box. Click on the "Edit Form Code..." button to add an
OnClick event handler for the button. Microsoft Script Editor will open and
the cursor will be located in the OnClick event handler for the button. Add
the following code where the cursor is located:

var lastViewName = XDocument.DOM.selectSingleNode("//my:lastViewName").text;
XDocument.View.SwitchView(lastViewName);

Note: I'm assuming that you're using JScript to program. Before you click on
the "Edit Form Code..." button on the "Properties" dialog box of the button
on the view you must make sure that your language is set correctly by
checking this via Tools > Options... > Design tab > Default programming
language.

Save your work and test it.
---
S.Y.M. Wong-A-Ton

> I'm not too experienced coding. I went to the link you  provided, but did
> not quite understand it. Can you give me an example? By the way where do you
[quoted text clipped - 37 lines]
> > > > > I'm new to InfoPath...I have a button labelled"Previous". When the button is
> > > > > pressed, I would like for it to go to the previous view.
Debs - 28 Apr 2006 01:04 GMT
I'm elated! It works! Thanks so much!

Debs

> Let's say you have two views with the names: "View 1" and "Final". On "View
> 1" you have a button with a rule set on it to go to view "Final" whenever the
[quoted text clipped - 66 lines]
> > > > > > I'm new to InfoPath...I have a button labelled"Previous". When the button is
> > > > > > pressed, I would like for it to go to the previous view.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.