0

add a textbox to a menubar

asked 2009-05-05 12:10:33 +0800

christian gravatar image christian
136 2 4

hi,

is there any way to add other items then menus or menuitems to a menubar?

in my case it would be nice to have a "search" field (text input field) directly attached in the menubar.

Thanks,
chris

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2009-05-06 20:03:18 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

I don't think that this is possible with the current version... I've never seen a textbox in a menu in any existing GUI-toolkit. Seems a little counter-intuitive from a usability perspective. If you need such a feature, please post to ZK Features:

http://sourceforge.net/tracker/?group_id=152762&atid=785194

Cheers, Maik

link publish delete flag offensive edit

answered 2009-05-08 06:59:02 +0800

christian gravatar image christian
136 2 4

Hi,

where do you think that a search box should be located then?

my dialog is a borderlayout, with the menubar in north, a listbox showing the list where the search should apply in center and the pager in south...

Thanks
chris

link publish delete flag offensive edit

answered 2009-05-08 15:59:54 +0800

christian gravatar image christian
136 2 4

Hi,

I've a new requirement: temporarly disabling menu items if they are not applicable for the current context...

like disabling a button. And maybe with two different images for enabled/disabled state ;)

bye,
chris

link publish delete flag offensive edit

answered 2009-05-08 17:12:18 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

> where do you think that a search box should be located then?

It's no problem to place the SearchBox besides the Menubar (e.g. appending both to a Hbox), but why do you want to place the SearchBox into the Menubar?

<zk>
 <hbox>
	<menubar id="menubar">
		<menu label="Project">
			<menupopup>
				<menuitem label="New" />
			</menupopup>
		</menu>
	</menubar>
        Search: <textbox />
 </hbox>
</zk>

Cheers, Maik

link publish delete flag offensive edit

answered 2009-05-09 12:40:48 +0800

christian gravatar image christian
136 2 4

hi Maik,

it just seems to be more convenient if its inside of the menubar. if it's outside, i have to do lots of css styling to make it fit. especially for the actual 'search' button (mneuitem after the textbox)

have you seen the message about enabled/disabled state?

cheers,
chris

link publish delete flag offensive edit

answered 2009-05-09 16:09:44 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

updated 2009-05-09 16:10:02 +0800

Here's an example how to disable a menuitem by code:

<zk>
 <menubar>
  <menu label="Project">
   <menupopup>
    <menuitem label="Menuitem" />
    <menuitem id="test" label="Test" />
   </menupopup>
  </menu>
 </menubar>
 <button onClick="test.setDisabled(true);" label="Disable Test" />
</zk>

HTH, Maik

link publish delete flag offensive edit

answered 2009-05-10 18:23:12 +0800

christian gravatar image christian
136 2 4

Hy Maik,

sorry... i was always looking for a setEnabled so i missed setDisabled...

Cheers,
chris

link publish delete flag offensive edit
Your reply
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: 2009-05-05 12:10:33 +0800

Seen: 593 times

Last updated: May 10 '09

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