PDA

View Full Version : Web Object Browser jump and go back



josecastello
01-22-2003, 03:27 PM
I am using a webbrowserobject to jump to other pages of my AM4 project using this (On Navigation Complete):

<IR_ACTIONS_LIST>
<Action name="Get Property">
<Type>99</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%myURL%</Variable>
<ObjectName>WebBrowser1</ObjectName>
<Property>URL</Property>
</Action>
<Action name="Right">
<Type>23</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%myURL%</Variable>
<SourceString>%myURL%</SourceString>
<NumberOfCharacters>5</NumberOfCharacters>
</Action>
<Action name="IF">
<Type>200</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%myURL% = "Video"</Condition>
</Action>
<Action name="Jump">
<Type>1</Type>
<Function>0</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<PageName>Videos</PageName>
</Action>
<Action name="END IF">
<Type>201</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="IF">
<Type>200</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%myURL% = "Artic"</Condition>
</Action>
<Action name="Jump">
<Type>1</Type>
<Function>0</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<PageName>Articulos</PageName>
</Action>
<Action name="END IF">
<Type>201</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="IF">
<Type>200</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%myURL% = "Close"</Condition>
</Action>
<Action name="Exit">
<Type>2</Type>
<Function>0</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="END IF">
<Type>201</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
</IR_ACTIONS_LIST>

In the linked AM4 pages (letīs call it "Video") I have a textbox to go back to this first page containing the webobjectbrowser. But I immediately return to the linked paged ("Video").
Is there anyway to go around this?
You can download the project to see what I am saying:

http://secpre.org/webjump.zip

Thanks in advance for your comments.

Corey
01-22-2003, 05:16 PM
Hi Jose, it's very simple. Just add a WEB BROWSER OBJECT > NAVIGATE TO > %SrcDir%/index.html action to your first page's "Onshow" state so that the URL is refreshed then it works fine.

What happened is that you were sending back to the page but not refreshing the URL so your IF statements were still reading %myURL% as "video", know what I mean?

Whenever you are using the URL to create navigation links between a web browser and your main application pages please be sure to add the above action to all pages which contain a web browser object. (OnShow)

BTW the action should look like this:

WebBrowserObject[WebBrowser1].NavigateTo ("%SrcDir%\index.html")

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

josecastello
01-24-2003, 09:25 AM
Corey,
I have tried that and doesnīt work. I know what to do (refresh that page) but donīt know how. Any other suggestion?
Thanks.

Corey
01-24-2003, 03:36 PM
No it works just fine. Take a deep breath and start from step 1, being careful to follow along and think about what you're doing as you go, it's simple you'll see. /ubbthreads/images/icons/smile.gif

Think about the logic here, you are using your button to append the URL and then doign a page jump but your are trying to send people back without restoring the appended URL to it's original unappended form therefore the front page stays in the "jump loop". So to combat that all you have to do is reset your URL everytime you visit the master menu page. Makes snese. /ubbthreads/images/icons/smile.gif

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)