Page 1 of 1

Change State in Prototype from Advanced HTML

Posted: Fri Apr 30, 2010 12:45 pm
by david
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

Re: Change State in Prototype from Advanced HTML

Posted: Tue May 04, 2010 1:31 pm
by david
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

Re: Change State in Prototype from Advanced HTML

Posted: Wed May 05, 2010 9:11 am
by Josh Kristof
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>

Re: Change State in Prototype from Advanced HTML

Posted: Sun Dec 29, 2013 11:01 am
by artonic
Please update this thread.

Re: Change State in Prototype from Advanced HTML

Posted: Thu Jan 02, 2014 3:01 pm
by Nick Jennings
Hi,

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