Change State in Prototype from Advanced HTML

Put your questions here on how to do things in ProtoShare.
david
Posts: 12
Joined: Wed Feb 03, 2010 5:13 am

Change State in Prototype from Advanced HTML

Postby david » Fri Apr 30, 2010 12:45 pm

How do I from within an advanced HTML component get a button or link to change a state within my prototype?

Right now, I have munged this together from stealing the html generated for a rich text component changing a state, but it isn't working:

I put this in the head:

<script>document.domain = "protoshare.com";</script>

and grabbed this from generated code from using the rich text change state component functionality...

<a class="button" onclick="window.top.site9.PageStateMgr.setAllStateValuesFromSource(this.href.substring(this.href.indexOf('#ps=')+4));return false; this.blur();" href="#"><span>Generate Code</span></a>

Obviously, something is with the setAllStateValuesFromSource function...


thanks,

David

david
Posts: 12
Joined: Wed Feb 03, 2010 5:13 am

Re: Change State in Prototype from Advanced HTML

Postby david » Tue May 04, 2010 1:31 pm

BUMP

This one should be a straightforward thing or at least part of a set of tricks in terms of learning how to use the Advanced HTML component...

thanks -

David

Josh Kristof
Posts: 525
Joined: Tue Mar 31, 2009 3:40 pm

Re: Change State in Prototype from Advanced HTML

Postby Josh Kristof » Wed May 05, 2010 9:11 am

David,

You can do this currently. It's similar to how to link from html sand box to page within protoshare.

Use the following code in your HTML component to link to the state you want to change. Just replace 207 and 0 with the state ID and the value ID. The state ID is listed next to the state's name on the state tab and the value ID is just the position the value is in the list starting with 0 as the top.

Code: Select all

<a href="" onclick="window.parent.site9.PageStateMgr.getState('207').setValue('0');">State Example</a>

artonic
Posts: 9
Joined: Tue Dec 27, 2011 9:21 pm

Re: Change State in Prototype from Advanced HTML

Postby artonic » Sun Dec 29, 2013 11:01 am

Please update this thread.

Nick Jennings
Posts: 165
Joined: Mon May 14, 2012 12:06 pm

Re: Change State in Prototype from Advanced HTML

Postby Nick Jennings » Thu Jan 02, 2014 3:01 pm

Hi,

The example code has been updated to provide a working example.


Return to “How Do I...”

Who is online

Users browsing this forum: No registered users and 1 guest

cron