voyent
Auto Focus issue with partailSubmit  XML
Forum Index -> General Help
Author Message
indiramsk@gmail.com

Joined: 15/Feb/2017 09:22:52
Messages: 2
Offline


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}" />

ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1312
Offline


Hi,

Does the same thing happen if you focus on the first field, enter 1 character, then tab to the second field?

Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
indiramsk@gmail.com

Joined: 15/Feb/2017 09:22:52
Messages: 2
Offline


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.
ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1312
Offline


Hmm, not sure why this is happening.

What ICEfaces version are you using? The ace:textEntry component (since ICEfaces 3.1) has a built-in auto-tab feature that should prove more reliable for you.

Live demo here: http://icefaces-showcase.icesoft.org/showcase.jsf?grp=ace:textEntry&exp=Auto%20Tab

Regards,
Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team