Opened 14 years ago
Closed 11 years ago
#429 closed enhancement (wontfix)
Form condition registry
Reported by: | anonymous | Owned by: | Nathan Toone |
---|---|---|---|
Priority: | high | Milestone: | 1.3 |
Component: | Dojox | Version: | 0.2 |
Keywords: | Form management | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
I would like to have a framework which can manage a forms state, useful in complex forms management. You provide a name a function or object that provides the condition and then based on the condition add handlers to success and failure. An example which would suite me would be the selection of a radio button hides some form elements and shows others, the more complex situ would be different elements of a drop down box would have a different effect on different parts of the form.
An example of how I was trying to tackle the hide/show was this:
function SetControls?(that){
var ControlArray? = byClass(that.target.id, byId('the_form'));
for(x = 0; x < ControlArray?.length; x++){
var ConrolToChange? = ControlArray?[x];
var ControlClassesArray? = KMI.common.getClassNameArray(ConrolToChange?);
if(!KMI.BasicInformation?.CheckControlInfluences?(ControlClassesArray?, that.target)){
if(ConrolToChange?.style.display == 'inline'){
ConrolToChange?.style.display = 'none';
}else if(ConrolToChange?.style.display == 'none'){
ConrolToChange?.style.display = 'inline';
}
if(ConrolToChange?.style.visible == 'hidden'){
ConrolToChange?.style.display = 'visible';
}else if(ConrolToChange?.style.display == 'visible'){
ConrolToChange?.style.display = 'hidden';
}
}
}
}
KMI.BasicInformation?.CheckControlInfluences? = function(ClassArray?, that){
var isInfluenced = false; KMI.common.Info('Method: KMI.BasicInformation?.CheckControlInfluences?'); try {
for(n = 0; n < ClassArray?.length; n++){
var OtherCBControl = byId(ClassArray?[n]); KMI.common.Info(OtherCBControl.id); if(OtherCBControl.checked && OtherCBControl.id != that.id){
return true;
}
} return false;
} catch(exc) {
KMI.common.Info(exc.message);
}
}
Using this, each of the elements that are hide/shown from the selection of a checkbox have the id of the checkbox in their class name. This only handles one dimensional form structure though and has no way of handling extra logic.
I will check into the IRC regularly if you want to pick my hed, I am on the list too :) I would like to provide input if possible as I have put a lot of thought into the ins and outs of this :)
Cheers
w.
Change History (12)
comment:1 Changed 14 years ago by
Milestone: | 0.3release → 0.4 |
---|
comment:2 Changed 14 years ago by
Owner: | changed from Dylan to dylan |
---|
comment:3 Changed 13 years ago by
Status: | new → assigned |
---|
comment:4 Changed 13 years ago by
Milestone: | 0.4 → 0.5 |
---|
comment:5 Changed 12 years ago by
comment:6 Changed 12 years ago by
Component: | General → Dojox |
---|---|
Milestone: | 0.9 → 1.0 |
pushing out as no one has had time to work on this.
comment:9 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Owner: | changed from dylan to nathan |
Status: | assigned → new |
Nathan, is there anything in here that is worth adding to your work on forms?
comment:10 Changed 11 years ago by
I think that this functionality might be covered by dojox.form.DropDownStack? or dojox.form.RadioStack?.
comment:11 Changed 11 years ago by
Owner: | changed from nathan to Nathan Toone |
---|
comment:12 Changed 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I'm going to close this - as it's an old bug, without much interest. Also, the dojox.form widgets I mentioned above perform this same sort of functionality (toggling parts of a form on and of, based on a dropdown/radio button)
Sounds like a good idea... any updates on this? (I'm guessing the reporter has long since forgotten this ticket as well...)
-Karl