All,
I have a question regarding Tabbed Panel in Struts2.
If I have a few panels and I want the content on a tab to be updated every five seconds would how would I do this?
Also, I only want the tab which is currently being viewed to update at the given interval. The other tabs should update when selected and then continue t be updated every five seconds until the user selects another.
Can anyone suggest an approach which allow me to do these things?
Thanks,
Alex
There is a long running tradition in Stack Overflow where all Javascript problems can be solved with jQuery.
Here is a similar question with a div instead of a tab
Auto-refreshing div with jQuery - setTimeout or another method?
Related
How can I implement ui-router when I make a swipeable view inside another view with Ionic Framework?
I need to make a calendar view, which will contain 3 parts:
Navigation bar (unchangeable)
Day details bar under the navigation bar it should not move while I swipe list (3) and it should display current day/date
Scrollable/Swipeable list of time slots available for selected day, this list should be swipeable back and forth to next/previous day and scrollable.
This is how I imagine myself how it should be:
Ok, I've done it much more simpler by using ion-slide-box to which I dynamically adding slides as explained here: How to insert data dynamically to ion-slide-box Angularjs Ionic.
Anyway, if somebody has another idea how can it be implemented please comment or post your answer, it's good to have few another solutions in a toolbox.
I have two questions regarding CKEditor Widgets:
First of all - I want to make it so when I highlight text and then click the widget's toolbar button, the highlighted contents are inserted into one of the widget's editable areas. How do I do that?
Secondly, I need to be able to nest my widgets - so in one of the widget's editable areas, I need to be able to add more instances of the widget. Currently, when inside my widget, the button for my widget is disabled. I tried adding allowedContent: true in the definition, but that doesn't seem to work.
Thanks in advance.
Regarding the second question – support for nesting widget is introduced in CKEditor 4.5.0 which will be released next week. See 4.5.0 Beta blog post. Before CKEditor 4.5.0 there's no support for nesting widgets, hence the button is disabled.
Regarding the first question – it is not a correctly formulated for StackOverflow. You should provide more details and some code that you already have. Read more in https://stackoverflow.com/help/how-to-ask. What's more, you should ask one question at a time, so please split them.
I've been trying to figure this out over several questions here on SO, finding out the different parts and then assembling them, but now I'm giving up.
What I'm trying do do:
The user is on a page, clicks a button and a list of content loads into a div using jQuerys .ajax. When he or she scrolls to the bottom of the div, load more content. As seen on Twitter, but this is inside a div.
I've seen examples on how to have infinite loading in scroll, but the problem is that those examples reload the entire page (it seems)
Has anyone got any idea how I can accomplish this?
As said, I cannot accomplish this using normal means.
The page is build as:
Page 1, has a div, empty until the user clicks a button.
Page 2 loads a lot of content. When the user clicks on the button on page 1, this is loaded into the div.
When the user scrolls through the div (It has overflow set to auto) and ends at the bottom of the div it should load the next page or so to speak.
Thanks in advance! :)
There are some plugins which do this for you quite well.
http://www.webdeveloperjuice.com/2010/02/24/create-infinte-scroll-effect-using-jquery-with-demo/
http://www.beyondcoding.com/2009/01/15/release-jquery-plugin-endless-scroll/
EDIT: Some more up to date plugins:
https://github.com/fredwu/jquery-endless-scroll
http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/
Use the JQuery.load() method to grab some html content and then insert it into an html element.
If you're using Paul Irish's Infinite Scroll, you can just specify a binder as one of the arguments where you have implemented infinite scroll, just like this:
$('.mydiv').infinitescroll({
binder: $(".name-of-div")
The binder is set to the document window by default, but if you specify it, you can have infinite scroll running simply inside one div on your page
ASP.NET MVC noob here
I was writing a quiz application where a user can select her preferences (e.g. difficulty, number of question etc.), and once she hit a submit button - she got a new page with questions.
The preferences are represented as a "Preferences" object, and the questions are IEnumerable of Question.
This all worked well.
Now I decide both parts should be in the same page - and I don't know how to accomplish that:
Should I have a new model class that is a composition of these two parts?
And also - How will I make the "questions" part appear only after the user completed filling up her preferences and clicked a button?
Should I use AJAX?
I also read a little about partial views and RenderSection.. But I really couldn't understand which approach is the most appropriate for my scenario.
So how should I draw two parts of a page, where the second is only displayed after the first is submitted?
Thanks.
How familiar are you with AJAX? If I had to guess I would think a good way to do what you want to do is to have an AJAX call which is linked to an action when the user submits their preferences. The action can then return a partial view which you can have appear on the page without a reload via AJAX.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
We are looking for approach to implement shopping-cart that keep shopping items at the bottom of the page, just like CrateAndBarrels
http://www.crateandbarrel.com/family.aspx?c=837&f=28291
The visitor should be able to add shopping item to the cart by clicking the item's "+ Add to Cart" button. From my understanding, for CrateAndBarrel the bottom shopping-cart is indeed a flash object. However, I wish we could find a way to implement this in ajax-fashion if possible.
We are not expert in anyway in web 2.0 stuff and looking for some guide to implement this feature. Our consultant suggest we use frame to implement this though.
If you were me how would you implement this feature ?
A. Plain WebForms page
B. Use Frame or IFrame.
C. HTML and Flash, just like CrateAndBarrel
D. AJAX
Some simple explanation on how those components should collaborate will be appreciated.
I would definately go with AJAX. Look at jquery or one of the other frameworks to help you do most of the work.
I would create a method to draw the bottom panel. This would then be called when the page loads, with an asynchronous call to get the cart contents. When the user adds an item to the cart, you could either refresh the page (which would re-draw the panel) or call an update method to redraw the cart contents.
1) Personally I would use Ajax (and I am pretty sure CrateandBarrel must be doing that, and using Flash just to render the basket) - weirdly although my Firefox is up to date it won't let me use their site in that)
You can then render the basket with an absolutely-positioned DIV at the bottom of the viewport.
You could use a frame, but I think an absolutely positioned DIV would be a better solution.
(2) As Adam Pope says, when an item is added (via Ajax) the basket can be redrawn (maybe a JSON call to get the basket contents?).
And definitely use a javascript framework.
Edit: And remember to let it degrade gracefully for anyone who does not have javascript!