Ask a Question related to Macromedia ColdFusion, Design and Development.
-
JIM #1
Checkbox problem
Hello,
I would like to solve the following problem :
I've a web site with ex. 5 checkboxes
Each checkbox contains the name of a certain task
ex.
asp:Checkbox 1: Task 1
asp:Checkbox 2: Task 2
...
asp:Checkbox 5: Task 5
Each time a task is finished on the server I would like to
inform the user that the task is finished by checking the checkbox to true
(Checked = True)
But I only see those checkboxes checked when the last tast is finished
(Then I see all 5 checkboxes checked)
How can I force my website to show each checkbox checked when a task
is finished ?
I'am using asp.net with Visual Studio 2003
Many thanks !
JIM Guest
-
Flash ASP Checkbox Problem
hi all, i need to know how to send the value of a checkbox located into flash mx movie to an asp page that insert the input fields and the... -
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the... -
Checkbox in DataGrid Problem
may i please to share a source code to this problem i have a problem to realize this -
datagrid - dropdownlist - checkbox problem
Dear ASP.NET Programmers, I have the following problem. I have a datagrid (ID: grdAllActions). This datagrid has two template columns: one column... -
problem retrieving value from DB into a checkbox
I am very new to ASP/DB, so please bear with me. In my "add data" form, through checkboxes I am entering "Yes" values. (no "No" values, those are... -
R. Thomas, aka Xtreme.Net #2
RE: Checkbox problem
It depends on how you are using the code..
usually if I am trying to do something like this, I dont think there will a
problem..
what I will do in the most simplest way, is to chek the box and make a
postback, and its done!
Maybe you can tell us a bit more about how YOU are trying to achieve this by
posting some code or putting ur concept down here...
Hth...
R. Thomas
R. Thomas, aka Xtreme.Net Guest
-
craig_uk #3
Checkbox Problem
I have a system that lets admin users select from a list of reports what
certain users can see. They do this by ticking checkboxes, this then enters
permissions into a database table. My problem now is that I need to let admin
edit the permissions. I'm a little stuck how to go about doing this so any
help would be great. Here is my code DB etc. <!--- Reports Table, this
produces a list and the admin can tick if they want a user to see the report
---> <CFquery name='Get_dirs' datasource='tns'> Select * from directories_tbl
Where Parent_id = 2 </CFquery> <!--- We then output this so the admin can pick
what user has access to what report ---> <cfoutput> <input type='hidden'
name='user_id' value='#url.user_id#'></cfoutput> <cfoutput query='get_dirs'>
<tr> <td width='20'><input type='checkbox' name='dir_id' value='#dir_id#'></td>
<td> <div align='left'>&nbsp;#ucase(DIR_NAME)#</div></td> </tr></cfoutput>
This then gets inserted into the permissions table, this all works fine, the
problem is when I want to edit. <cfloop index='i' from='1'
to='#ListLen(form.dir_id)#'> <!--- Now insert each permission into the database
for the user. ---> <cfquery datasource='TNS'> INSERT INTO
static_perm_tbl(user_id, parent_id) VALUES (#form.user_id#,
#ListGetAt(form.dir_id, i)# ) </cfquery> </cfloop> So now I want to output
the first query and populate it with the results from the static_perm_tbl . . .
.. any ideas? Regards Craig
craig_uk Guest
-
May 2008 #4
Checkbox problem
Hi everyone,
How to loop through the checkbox which is inside a datagrid?
Thanks,
May
May 2008 Guest
-
Izzy1138 #5
Re: Checkbox problem
What are you looking to do? Just a though. I use a class for the lineItem (
that I write with an member variable for each column ) and a list of those for
the dataprovider. That way I can dig through the data without dealing with the
datagrid at all. It also make moving the data around easier. Instead of reading
out each line into something else, you just send the list of lineItems.
Izzy1138 Guest
-
May 2008 #6
Re: Checkbox problem
Hi,
Thanks for your reply. What I want to do is shown below. And the datagrid is
shown below:
|---------|----------------|----------------|
| id | Checkbox | TextInput |
|---------|----------------|----------------|
| 1 | false | |
| 2 | true | Create |
| 3 | true | Update |
|---------|---------------|----------------|
What I want to do is loop through the checkbox which is inside a datagrid. If
it is true, then get the id value and TextInput value out from the datagrid.
And then update the database.
Thanks,
May
May 2008 Guest
-
David M.. #7
Re: Checkbox problem
Hi,
One solution to your problem could be:
- Create a class "myItem" representing one line of information with 3
attributes: id (int), checked(boolean) and textValue(String)
- Create an arrayCollection which will be the dataprovider of your datagrid.
This arrayCollection will contains object of type "myItem".
- In the item renderer of the column with the checkbox, on the CheckBox
object add a change listener like this id="chkbox" change="(this.data as
myItem).checked = chkbox.selected"
When you want to check if there is something checked, you don't use the
datagrid anymore but simply go through the arrayCollection you gave as a
dataprovider.
Hope it's clear.
David
David M.. Guest
-
MayLam18 #8
Re: Checkbox problem
[q]Originally posted by: David M..
Hi,
One solution to your problem could be:
- Create a class "myItem" representing one line of information with 3
attributes: id (int), checked(boolean) and textValue(String)
- Create an arrayCollection which will be the dataprovider of your datagrid.
This arrayCollection will contains object of type "myItem".
- In the item renderer of the column with the checkbox, on the CheckBox
object add a change listener like this id="chkbox" change="(this.data as
myItem).checked = chkbox.selected"
When you want to check if there is something checked, you don't use the
datagrid anymore but simply go through the arrayCollection you gave as a
dataprovider.
Hope it's clear.
David[/q]
Hi David,
Thanks for your help! I am new to Flex. If possible, please give me sample
code. Thanks again!
May
MayLam18 Guest
-
David M.. #9
Re: Checkbox problem
Hi,
I did the following quick and didn't test it but I guess it should work.
Good luck,
David
// FIle MyItem.as
package
{
public class MyItem
{
public var itemId:int;
public var checked:Boolean;
public var textValue:String;
public function MyItem()
{
}
}
}
//Your main application .mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:local="*">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function displayChecked():void {
var res:String = "";
for each ( var item:MyItem in myDataProvider) {
if ( item.checked ) {
res += item.itemId + " " +item.textValue + "\n";
}
}
Alert.show(res);
}
]]>
</mx:Script>
<mx:ArrayCollection id="myDataProvider">
<local:MyItem itemId="1" checked="false" textValue="text value 1" />
<local:MyItem itemId="2" checked="false" textValue="text value 2" />
<local:MyItem itemId="3" checked="false" textValue="text value 3" />
<local:MyItem itemId="4" checked="false" textValue="text value 4" />
<local:MyItem itemId="5" checked="false" textValue="text value 5" />
</mx:ArrayCollection>
<mx:VBox width="100%" height="100%" horizontalAlign="center"
verticalAlign="middle">
<mx:DataGrid dataProvider="{myDataProvider}">
<mx:columns>
<mx:DataGridColumn dataField="itemId" headerText="itemId"/>
<mx:DataGridColumn dataField="checked" headerText="checked">
<mx:itemRenderer>
<mx:Component>
<mx:Canvas>
<mx:CheckBox id="checkBox"
selected="{(data as MyItem).checked}"
change="{(data as MyItem).checked = checkBox.selected}" />
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn dataField="textValue" headerText="textValue"/>
</mx:columns>
</mx:DataGrid>
<mx:Button click="displayChecked()"/>
</mx:VBox>
</mx:Application>
David M.. Guest
-
May 2008 #10
Re: Checkbox problem
That's great. Thanks a lot David. I will try your code later.
May
May 2008 Guest



Reply With Quote

