In connected webpart (using sharepoint 2007) ,option button should be selected by default - sharepoint-2007

I have a web part connected to another (provide a row to). It shows the radio button that when clicked correctly provides the data to the second web part.
Can I have this radio button selected by default so that it automatically provides the filter data as soon as the page is loaded?
if you find any jquery/javascript relevent to this please share it and will be more helpful to me.

When you click the radio button from jQuery, the event should be raised as well:
$(document).ready(function() {
$("input:radio[value='your-value-goes-here']").click();
});
Be cautious if you use the value more than once on the page! If possible address the radio button with an id:
$("#Your-Radio-Button-Id").click();

Related

open popup through Link in Vaadin

I am Using Vaadin Framework in my application. I want to open a popup screen using Vaadin Link. I know to open popup thrugh button but I need to open popup through Link. Can anybody help, this is my code:
Link link1 = new Link(String.valueOf(rs.getInt(1)), new ExternalResource("#"));
_reportTable.getItem(dashboardDataRowId)
.getItemProperty("todo").setValue(link1);
As explained in in Book of Vaadin - Components - Link, Link should be used only for hyperlinks to external resources, as it is nothing more than a wrapper for a anchor html tag and as such it does not fire any server side events. As a result you cannot react on server side to open a popup window or do some other logic.
The Link is a regular HTML hyperlink, that is, an anchor
element that is handled natively by the browser. Unlike when clicking
a Button, clicking a Link does not cause an event on the server-side.
What you really want is vaadin button styled as a hyperlink. You can do it by creating a regular button (which supoorts server side events and can open your popup) and then adding an appropriate style.
Button linkButton = new Button();
linkButton .setStyleName(BaseTheme.BUTTON_LINK);
Always be sure to call addStyleName() instead of setStyleName() as it only adds your new style to the list of other styles already present and it does not override that list with your only new style.

Using Jquery Mobile dynamically generated dialog box opens multiple times

In a multi page template,I have three category pages (comedy, action, drama) that you can swipe between each containing rows of images (Seinfeld, Modern Family, Family Guy, Big Bang). Clicking on an individual image should open a dialog box (Seinfeld summary), close when you click the close button, and stay close. Initially it works, then what happens is based on the number images click after two, it opens and closes n -1 (clicking the 3rd image, opens the dialog box twice).
what could be the reason behind this?
Without your code I can be sure but I think I understand what is happening to you.
You have a problem with multiple event binding. Because of jQuery Mobile architecture it is possible to bind an event numerous time to some object.
I have an blog ARTICLE on jQuery Mobile page events handling and there's a chapter dedicated to this problem, just search for the chapter Prevent multiple event triggering. Or it can be found HERE.
In few words always unbind event before you bind it to some object to prevent this from happening:
$('#test-button').die('click').live('click', function(e) {
alert('Button click');
});

Radio buttons only enhanced in first visit, but not in all following visits

I dynamically create a dialog page, and inject two radio buttons into it. The codes works well only for the first visit. In the following visits, strangely the radio buttons are not enhanced.
The codes are at http://jsfiddle.net/BScLu/. You can open, close, and re-open the dialog, to try out.
JQuery Mobile can get finicky when things are dynamically generated because you're inserting those radio buttons after the page has already been created in the DOM. Would you be able to insert them on the $('#myDialog').on(pagebeforecreate) event?

JQM back button binds itself to every click event when it isn't targeted

Using jQuery Mobile (jquery.mobile-1.0b3.min.js). If i apply a click event to a form, the back button seems to get the click event binding as well. It does this no matter how specifically targeted to an element the selector is. For example:
Using this to set the back button:
Copy code
<div id="pagename-page" data-role="page" data-add-back-btn="true" data-back-btn-theme="b">
And this in a script file:
Copy code
$('#awards-details-page').live('pagecreate', function(event){
$('#awards-details-page input[name=submit]').bind('vclick', function() {
console.log('I'm going to be hijacked by the back button.');
});
});
Clicking on the back button will produce the message in the console when tested in a browser.
Every time you visit the page with the script, it will add another duplicate binding. Attempts to unbind the click event on the pagehide event worked with the targeted element, but back button's bindings persisted.
Can anyone shed some light on this?
Thank you in advance.
dont use vclick you will ge ghost, they have improved CLICK so just use that
also live is not bind... bind is to an element that exist, live is for all elements that have that shared property, before after and during. you past pages exist so you have a set of binded items now not just one for the page you are on. i would scrap the whole back button element and have your own clickable item, for this you can do your own back code and add attributes like data-backto = "#page1", you can then control better what happens when a back button is clicked, especially as android phones have there own back button too.

Popup Dialog Not Re-drawing after initial launch

I have a dropdown listbox on my main page with a button on the same page that launches a pop-up dialog box, also having a dropdown list box. I need the selected index of the 1st listbox control to be synched with the pop-up dialog dropdown listbox.
I have added code to my Controller that sets the index in the ViewData object to be retrieved by the popup and it works on the initial launch of the App. My problem is any subsequent launches of the pop-up dialog won't hit its corresponding code to set the index using the ViewData. The code that needs to be executed is:
<%= Html.Telerik().DropDownList()
.Name("DataStoreTypeId")
.BindTo(new SelectList(Model.DataStoreTypes, "DataTypeId", "Name",Model.DataTypeSelectedId))
.HtmlAttributes(new { style="width:205px })
.SelectedIndex((int)ViewData["SelectedIndex"])
%>
Coming from an ASP.NET background, I am accustomed to having postbacks as mechanisms to handle these types of actions, but MVC has trimmed the postback events which is great for performance but what are my options to force code execution now?
Should I be using other alternatives?
First time it works because its value is set on server side. once its rendered in the browser there is no server side left. you have to manually change the selected value of your telerik dropdown list on button click event next to your first drop down list (is first DD also telerik dropdown or html one). For client events of telerik dropdown have a look at Telerik Demos for asp.net mvc

Resources