voyent
Messages posted by: indiramsk@gmail.com  XML
Profile for indiramsk@gmail.com -> Messages posted by indiramsk@gmail.com [2]
Author Message
no.If i do tab manually issue is not there. It happens only with auto tab.
function autoTabToNextInputField(ctrl,len, e){
if(ctrl.value.length >= len )
{
ctrl.value = ctrl.value.slice(0, len);
var focusIndex=getIndex(ctrl)+1;
var finalIndex=focusIndex % ctrl.form.length;
ctrl.form[finalIndex].focus();

}
function getIndex(ctrl)
{

var index = -1, i = 0, found = false;

while (i < ctrl.form.length && index == -1)

if (ctrl.form[i] == ctrl) index = i;
else i++;

return index;
}
}

Above is the code for auto tab. This worked in another form where we have only 2 fields. BUt it is not working in the form i mentioned. IN this form all these fields in table.
I have an Isssue with partial Submit attribute.
Below is some part of the form where im facing the issue.
we have 4 input fields with max size allowed 2 and on key up it should auto focus to next input field.
Issue :
when user enters 1st field with size 2, it auto focus to 2nd field and immediately it looses the focus. not sure where the focus is on after this but it works fine for the other fields. It auto focuses and focus stays there for next fields until user enter data. This is happening for first time when partial submit happens for 1st field.

My trials :
- removed partial submit. Focus is working but my custom validation is not happening.
- tried valueChange Listener instead of validator. Validation does not happen.
- i have removed 1 st field and tried. Still the issue is there with first partial submit of 1st field now.
- tried ice Core single Submit - still same issue.

Please Help

Following is part of code i'm having trouble. i just pasted the 2 of the input fields. similar to the below we have 2 more input fields.

onKeyUp="autoTabToNextInputField(this, 2, event);" this is a custom script to focus to next field.

<ice:inputText
id="dfct1"
styleClass="dfctInp"
disabled= "#{null!=trnsc and trnsc.dfctsDisabled}"
style="#{trnsc.dfctStyle1}"
size="2"
maxlength="2"
value="#{trnsc.myTrnsc.dfct1.code}"
autocomplete="off"
onkeyup="autoTabToNextInputField(this, 2, event);"
partialSubmit="true"
validator="#{trnsc.myTrnsc.validateTypedDfctCode1}" />
<ice:inputText
id="dfct2"
styleClass="dfctInp"
disabled= "#{null!=trnsc and trnsc.dfctsDisabled}"
style="#{trnsc.dfctStyle2}"
size="2"
maxlength="2"
value="#{trnsc.myTrnsc.dfct2.code}"
autocomplete="off"
onkeyup="autoTabToNextInputField(this, 2, event);"
partialSubmit="true"
validator="#{trnsc.myTrnsc.validateTypedDfctCode2}" />

 
Profile for indiramsk@gmail.com -> Messages posted by indiramsk@gmail.com [2]
Go to:   
Powered by JForum 2.1.7ice © JForum Team