Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, November 10, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Client (Pre-7.2)
Forum to discuss using & developing the legacy SalesLogix Web Client (For versions 7.0 and earlier). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Client (Pre-7.2) | New ThreadView:  Search:  
 Author  Thread: Updating datagrid through radio button selection
Corey
Posts: 42
 
Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Jan 07 5:16 PM
fiogf49gjkf0d
Does anyone know how I can repopulate the datagrid on the page when the user selects a different option via a radio button? Also, I want to be able to click on a record on the datagrid and populate some readonly textboxes on the page.
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 2:21 AM
fiogf49gjkf0d
For the radio button part, two ways you could go firstly you could have a frameset, and have an onchange event on the radio button that would reload the query on the bottom frame (you can copy functionality from the advanced lookup for example), or you could have the radio buttons as part of a from and have the onchange of the radio button submit the form, record which button they clicked in a database field and use this to filter the query by (the submit of your form will refresh the page, and query).

For the onclick add an event to the query ONROWSELECT and any javascript function you want to call i.e. "rowSelected()". Have a function rowSelected

function rowSelected() {
selectedRow = event.rowIndex;
}

You can get the id of the row with similar to the following:

document.all.queryname.rows(selectedRow).getElementsByTagName('SPAN')(0).id

You will have to set the ID property of the query to be the queryname stated above. You can either call another function from rowSelected to populate your textboxes or do it directly in the rowSelected function...
[Reply][Quote]
Corey
Posts: 42
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 11:53 AM
fiogf49gjkf0d
Thank you for your reply, I don't suppose that it's possible to access the posted results through Javascript or use an action to access the html and reassign values to the form?
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 11:56 AM
fiogf49gjkf0d
Im not totally sure what you mean? But to access a posted form value on the next page in javascript:

var posted = '<#AF name=postedvalue>';

[Reply][Quote]
Corey
Posts: 42
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 2:16 PM
fiogf49gjkf0d
What it is I want to do is - click a radio button and have it postback to the page so all the information in the form, I won't loose. So, I wanted to build a javascript to reassign the values on the form to what they were before the postback.

Also, var posted = '<#AF name=postedvalue>'; - what is the value that I should put in place of the postedvalue you have defined in the javascript?
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 3:45 PM
fiogf49gjkf0d
ok you could set a hidden form element to a value then on the init of the page check the #af name=hiddenvar to populate the required element ie select the radio button...
[Reply][Quote]
Corey
Posts: 42
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 4:18 PM
fiogf49gjkf0d
Here's what I have so far. When you pick a radio button, it redirects to itself after setting a hidden field to the currently selected radio button - here's the js for that:

function RefreshGrid(form)
{
var Count = 0;
for (Count = 0; Count < 3; Count++)
{
if (form.rWorkslips[Count].checked)
{
form.txtSelectedWorkslip.value = form.rWorkslips[Count].value;
form.txtIsPostBack.value = "true"
form.submit();
}
}
}

Then onload I check the hidden field to see if anything is in it, if so - I'm going to do something, if not, I do something else - right now I have an alert on each for testing. Everytime I run it, it never has anything inside of my hidden field. What am I doing wrong? Here is that js.

function PopulatesForm()
{
var posted = '<#AF name=txtIsPostBack>';
alert(posted);
if (posted.length > 0)
{
alert("This is a PostBack");
}
else
{
alert("No PostBack");
}
}
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 4:39 PM
fiogf49gjkf0d
I haven't got a web client handy to test a you could try doing a sessionstartand pick up the #sf nameispostback. if not maybe try appending your variable to the end of the form action? perhaps the #af doesn't like retrieving values from a previously posted form
[Reply][Quote]
Corey
Posts: 42
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 5:13 PM
fiogf49gjkf0d
I'm new at this, how and where do I call the sessionstart at?
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Jan 07 2:22 AM
fiogf49gjkf0d
<#SYS name=swcpath>/sessionstart?nextpage=yourtemplatename

then to access your form variables you use #sf instead of #af.

Just as a check is the alert happening and showing nothing? Just checking that function is definately being called.

You can email me and send me all the code if you would like me to take a look?
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Updating datagrid through radio button selectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jan 07 8:41 AM
fiogf49gjkf0d
Corey:

I just got thru the thread and I am not sure what your intentions are on your last post, but based on what you were describing as needing to do on the original post, why would you post the form?

Wouldn't it be rather simpler to handle it all AJAX style using the xmlHTTP object to retreive data based on user selection and change the Grid using DHTML all within the Java Script?

Again, I am not sure what your requirements are, but you would be avoiding having to repost the page every time the user makes a selection.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/10/2024 2:34:56 PM