0

The value in auxilary head of grid is getting selected after search

asked 2012-06-19 07:51:26 +0800

javaenthu gravatar image javaenthu
141 2

Hi,
We are using grid, and using the auxheads of the grid. When something is typed in the grid, it searches and returns the result.
But when the result comes, the typed text in the aux head is getting selected, so the user has to type the entire input again.

For example : in the aux head I type "ru" all the records matching to "rumania and russia" are coming. But in the auxHead text box where i entered "ru" is getting selected so if I type "mania" ru is lost and it just contains "mania" which is a wrong user scenario.

Any help on this?

Thanks in advance.
-JE.

The partial code of my zk file is like this :

<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./myWin" ?>

<window id="myWin" apply="com.myxyz.MyComposer">
 
	<div height="600px">
		<grid id="internalRecGrid" height="490px" model="@{myWin$composer.allRecords}" mold="paging"  forward="onAfterRender=afterRender">
			<auxhead >
				<auxheader label="All Studentsrecords"/>
			</auxhead>
			<auxhead >
				<auxheader></auxheader>
				<auxheader colspan="1">
					<hbox align="center">
						<button id="Button" label="All records" forward="onClick=onButtonClick"  />
					</hbox>
				</auxheader>
				<auxheader colspan="1">
					<hbox align="center">
						<textbox id="firstName"/>
					</hbox>
				</auxheader>
				<auxheader colspan="1">
					<hbox align="center">
						<intbox id="age"/>
					</hbox>
				</auxheader>
				<auxheader colspan="1">
					<hbox align="center">
						<textbox id="lastName"/>
					</hbox>
				</auxheader>
				<auxheader colspan="1">
					<hbox align="center">
						<textbox id="location"/>
					</hbox>
				</auxheader>
				<auxheader colspan="1">
					<hbox align="center">
						<textbox id="nationality"/>
					</hbox>
				</auxheader>
				<auxheader colspan="1">
					<hbox align="center">
						<textbox id="school" />
					</hbox>
				</auxheader>
				<auxheader colspan="1" />
			</auxhead>
			<columns>
				<column width="3%">
					<checkbox id="selectAll"></checkbox>
				</column>
		 	</columns>
			<rows>
				<row self="@{each=internalRec}"
					value="@{internalRec}">
					<cell>
						<checkbox></checkbox>
					</cell>
					<cell>
						<label value="@{internalRec..name}" />
					</cell>
					<cell>
						<label
							value="@{internalRec.record.surname}" />
					</cell>
					<cell>
						<label value="@{internalRec.record.name}"  />
					</cell>
					<cell>
					</cell>
					<cell>
						<label value="@{internalRec.asdasd}" />
					</cell>
					<cell>
						<label value="@{internalRec.sdfasd}"  />
					</cell>
					<cell>
						<label
							value="@{internalRec.asdf.asdf}"  />
					</cell>
					<cell>
						<label value="@{internalRec.asdfasdf}" />
					</cell>
					<cell>
						<label value="@{internalRec.sdafsadf}" />
					</cell>
				</row>
			</rows>
		</grid>
	</div>
</window>

In MyComposer.java I have added a listener for each textbox id in the composer code for example:

nationality.addEventListener(Events.ON_CHANGING,new EventListener() {
	public void onEvent(final Event event) {
		final String nationalityVal = ((InputEvent) event).getValue();
		((Textbox) event.getTarget()) .setValue(nationalityVal);
		MyComposer.this.nationality.setFocus(true);
          // Model is setting nicely values are coming fine , but the value what ever i enter in the auxilary head is selected.
		MyComposer.this.setModel(true);

	}
});

delete flag offensive retag edit
Be the first one to reply this discussion!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-06-19 07:51:26 +0800

Seen: 85 times

Last updated: Jun 19 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More