URL Changing with SpiffyUI's MainNavBar

26 views
Skip to first unread message

hgeor...@gmail.com

unread,
Jun 24, 2013, 11:49:09 AM6/24/13
to spif...@googlegroups.com
Hi Zack,


I'm using the SpiffyUI MainNavBar and it works great!

However, the MainNavBar changes the URL every time it is clicked to either the NavItem's id or to just "?-". I would like to have the project using GWT's localization feature eventually and I know that the URL is important for GWT Localization.

I have set the MainNavBar.setBookmarkable(false); but it still changes the URL. Is there any way to get around this issue?


Thanks again for the feedback!

Zack Grossbart

unread,
Jun 24, 2013, 12:11:25 PM6/24/13
to spif...@googlegroups.com
Hello,

The URL change for the main nav bar works fine for GWT localization.
However, if you want to make sure the URL doesn't change just disable the
history support from Spiffy UI.

Thanks,
Zack
--
You received this message because you are subscribed to the Google Groups
"Spiffy UI" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to spiffy-ui+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

hgeor...@gmail.com

unread,
Jun 24, 2013, 12:15:54 PM6/24/13
to spif...@googlegroups.com, hgeor...@gmail.com
I assumed that setBookmarkable(false) was disabling the history, but that's not working.

Zack Grossbart

unread,
Jun 24, 2013, 12:21:11 PM6/24/13
to spif...@googlegroups.com
Bookmarkable is different from history support. Making it bookmarkable give
every page a distinct URL so you can bookmark it. History support just
means you can use the back and forward buttons.

-Zack

hgeor...@gmail.com

unread,
Jun 24, 2013, 12:27:23 PM6/24/13
to spif...@googlegroups.com, za...@grossbart.com
How do I disable history support then?

Zack Grossbart

unread,
Jun 24, 2013, 12:52:16 PM6/24/13
to spif...@googlegroups.com
You’ll need to update to the latest snapshot version and then you can add
this to the JavaScript of your page:

spiffyui.historyEnabled = false;
Message has been deleted

Lord Silverhammer

unread,
Jul 3, 2013, 10:28:00 AM7/3/13
to spif...@googlegroups.com, za...@grossbart.com
I too am having this issue.  How do I add this javascript to my GWT project?  I do not use javascript directly at all.  A code sample would be ideal.
-Silver

Lord Silverhammer

unread,
Jul 3, 2013, 10:38:58 AM7/3/13
to spif...@googlegroups.com, za...@grossbart.com
I tried this, something I found:
private static native void disableHistory() /*-{
 spiffyui.historyEnabled = false;
}-*/;

then I called the disableHistory() in the onModualLoad() and it threw an exception saying that spiffyUI was not defined.

Zack Grossbart

unread,
Jul 3, 2013, 10:46:15 AM7/3/13
to spif...@googlegroups.com
Hello,

The easiest way to do this is to include the following in your HTML file
after the spiffyui.min.js file gets imported:

<script type="text/javascript">
spiffyui.historyEnabled = false;
</script>


By the way... Your code sample didn't work because JavaScript code in your
GWT files runs in a different context. If you want to access the window
variable (which is implicitly called in the previous example) then you need
this code:

private static native void disableHistory() /*-{
spiffyui.historyEnabled = false;
}-*/;

Good luck,

Lord Silverhammer

unread,
Jul 10, 2013, 2:14:40 PM7/10/13
to spif...@googlegroups.com, za...@grossbart.com
I have tried this and it has no effect.  It seems like the latests jars are the 1.1 versions, which I have.
-- Silver

Zack Grossbart

unread,
Jul 10, 2013, 2:27:05 PM7/10/13
to spif...@googlegroups.com
You’ll need to grab the 1.2-SNAPSHOT version for this flag to work.

Lord Silverhammer

unread,
Jul 12, 2013, 2:29:32 PM7/12/13
to spif...@googlegroups.com, za...@grossbart.com
In my html file I have:

  <!-- Files for the SpiffyUI framework -->
    <script type="text/javascript" src="managementconsole/jquery.min.js"></script>
    <script type="text/javascript" src="managementconsole/spiffyui.min.js"></script>
     <script type="text/javascript"> 
      spiffyui.historyEnabled = false; 
  </script> 

I am using the following spiffy jars:
spiffyui-1.2-20130711.201851-76.jar
spiffyuitasks-1.2-20130711.201836-77.jar

These seem to be the latest.
My url still changes.

For example it will go from:

to:

Any ideas?

Zack Grossbart

unread,
Jul 12, 2013, 4:25:51 PM7/12/13
to spif...@googlegroups.com
Hi,

That looks generally good. Any chance I can look at the project and see
what's going on? Does the URL change when you go to new navigation items or
just the first time when the page loads?

Thanks,

Lord Silverhammer

unread,
Jul 15, 2013, 3:06:43 PM7/15/13
to spif...@googlegroups.com, za...@grossbart.com
Our project is kind of big so I do not think I can send it to you.  However, I have been talking to some other team members and this is a clarification of the behavior.
When you first go to the web page, you are asked to log in.  This is done via our own mechanism.  The URL at this point remains unchanged.  After you log in, it takes you to the rest of the system.  The main system uses the SpiffyUI menuing system.  He has set it up to auto-navigate to one of the menu choices.  As soon as this happens the URL changes.  I do not know if it continues to change.  If it does, it is the same url each time that looks like the example I gave.  I rolled back the URL changes I made in the above post so I can't tell you if with the latest 1.2s if it is a constant change or just a one time URL change.
-- Silver
Reply all
Reply to author
Forward
0 new messages