i have field inside repeat control. right using viewscope
in onchange
event capture field values inside repeat control. each time field has partial refreshes in order value set in scope variable.
the problem here when users set focus outside repeat control, focus not set until partial refresh of field completed. partial refresh slow when user accessing remote domino server. there effective way capture values inside repeat control when form submitted?
the idea create fields dynamically when user click on add button. problem happen when move focus field inside repeat control field outside repeat control. focus not set, until partial refresh of field inside repeat control completed. may not occur scenario, if server running locally on machine. below code shows usage of repeat control create fields dynamically
<xp:button value="add objects" id="addnavobj"> <xp:eventhandler event="onclick" submit="true" refreshid="objline" refreshmode="partial" id="eventhandler24"> <xp:this.action><![cdata[#{javascript:viewscope.rowitems=viewscope.rowitems+1;getcomponent("navobjrep").setvalue(parseint(viewscope.rowitems));}]]></xp:this.action> </xp:eventhandler> </xp:button> <xp:repeat rows="30" var="rowdata" indexvar="rowindex" repeatcontrols="false" first="0" value="#{javascript:viewscope.rowitems}" id="navobjrep" style="width:800.0px"> <xp:panel style="width:800.0px" id="objline"> <xp:table style="width:800.0px"> <xp:tr> <xp:td style="width:245.0px"> <xp:inputtext id="objtype" style="width:130.0px"> <xp:typeahead mode="full" minchars="1" ignorecase="true" id="typeahead4" rendered="false"> </xp:typeahead> </xp:inputtext> </xp:td> <xp:td style="width:46.0px"> <xp:inputtext id="objcode"> <xp:eventhandler event="onchange" submit="true" refreshmode="partial" refreshid="objcode" id="eventhandler3"> <xp:this.action><![cdata[#{javascript:viewscope['objcode'+rowindex] = getcomponent("objcode").getvalue()}]]></xp:this.action> </xp:eventhandler> </xp:inputtext> </xp:td> <xp:td style="width:300.0px"> <xp:inputtextarea id="objdesc" style="height:40.0px;width:200.0px"> <xp:eventhandler event="onclick" submit="false" id="eventhandler40"></xp:eventhandler> <xp:eventhandler event="onchange" submit="true" refreshmode="partial" refreshid="objdesc" id="eventhandler4"> <xp:this.action><![cdata[#{javascript:viewscope['objdesc'+rowindex] = getcomponent("objdesc").getvalue()}]]></xp:this.action> </xp:eventhandler> </xp:inputtextarea> </xp:td> </xp:tr> </xp:table> </xp:panel> </xp:repeat>
don't use onchange event of edit box partial refresh - create experience night mare. excercise 23 has need.
Comments
Post a Comment