Welcome Guest Search | Active Topics | Sign In | Register

CallbackPanel Options
kennaxx
Posted: Monday, June 15, 2009 9:58:39 AM
Rank: Advanced Member
Groups: Member

Joined: 4/30/2009
Posts: 36



Please Help. I have a EOGrid that is embedded in an EOTreeview. I want to click a cell/row on clientside/javascript in the grid and then update a callbackpanel.
How can I set the Trigger of the CallbackPanel to the javascript? Also, within the serverside how can stop the whole page from postingback. Using __doPostback appears to postback the whole page.


function OnItemSelected(grid)
{
var item = grid.getSelectedItem();
var membId = item.getCell(0).getValue();
var svrUrl = item.getCell(1).getValue();
var lname = item.getCell(2).getValue();
var fname = item.getCell(3).getValue();
var title = item.getCell(4).getValue();
var city = item.getCell(5).getValue();
var state = item.getCell(6).getValue();
var country = item.getCell(7).getValue();
var mstatus = item.getCell(8).getValue();
var nickname = item.getCell(9).getValue();

var val = 'MemberId=' + membId + '&SvrUrl=' + svrUrl + '&lname=' + lname + '&fname=' + fname + '&title=' + title + '&city=' + city
+ '&state=' + state + '&country=' + country + '&mstatus=' + mstatus + '&nickname=' + nickname;

document.body.style.cursor='wait';
__doPostBack("<%= button.ClientID %>",val);

document.body.style.cursor='auto';
}



<eo:CallbackPanel ID="CallbackPanel2" runat="server" Height="150px"
Width="200px" Triggers="{ControlID:GridItem;Parameter:}">
<iframe ID="embeddedFrame" runat="server" name="embeddedFrame" src="EditPage.aspx"
visible="false" frameborder="0" enableviewstate="true" scrolling="no"
style=" width: 883px; height:516px; left:4px; position: absolute; top: 4px;" >
</iframe>
</eo:CallbackPanel>



Thanks

Kennaxx
eo_support
Posted: Monday, June 15, 2009 10:04:59 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

When you call doPostBack with the button, it is similar to clicking the button directly. In that case you should set the button as the trigger.

Thanks!
kennaxx
Posted: Monday, June 15, 2009 10:47:05 AM
Rank: Advanced Member
Groups: Member

Joined: 4/30/2009
Posts: 36
I put the button there as a test. However, it postsback the whole page. Is there anyway or better way of doing this?
eo_support
Posted: Monday, June 15, 2009 10:56:31 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Setting trigger to the button should definitely work. So I am not sure why it is not working for you. There are a number of other options as well:

1. You can set the Grid as a trigger, then call the Grid's raisesItemCommandEvent instead of __doPostBack. Here is a working example:

http://demo.essentialobjects.com/Default.aspx?path=Grid\_i1\_i13

raisesItemCommandEvent does pretty much the same thing as what you do in your code: calling __doPostBack. However it is directly associated with the Grid instead of a separate button. It also takes and carries an item index to the server side so it might be easier for you;

2. It appears that you want to update the src property of an iframe element through a CallbackPanel. If that's the case, you don't need a CallbackPanel at all. Just call getElementById to get the iframe object and set its src property directly with JavaScript and you should be all set;

Hope this helps.

Thanks!
kennaxx
Posted: Monday, June 15, 2009 12:04:39 PM
Rank: Advanced Member
Groups: Member

Joined: 4/30/2009
Posts: 36

EO,

THANKS. It is working GRRREAT now. You are the best!

Applause
eo_support
Posted: Monday, June 15, 2009 12:09:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad to hear it's working for you. Please do not forget to recommend us to others when you have a chance.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.