[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Set Text Property in ComboBox  XML
Forum Index -> Development
Author Message
heyl

Power User

Joined: 10/01/2008 09:41:55
Messages: 266
Location: Ettlingen
Offline

Hi everybody,

I am still not able to set the text property in a dynamically created ComboBox.

This is my code:

COMBOBOXComponentTag ct = new COMBOBOXComponentTag();
ct.setValuetextmode("TEXT");
ct.setText("#{d.test.text}");

The object binding is correct, I double checked that,
and I am using the new Valid Values Binding.

I am using version
setup_1_1_20080114.exe
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

Hi,

sorry, I just checked with our examples, no problem: you input the text, and the id is automatically selected (if available) or if not available then the text is passed.

Could you give a bit more info...?

Björn

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

Hi,

some additional comments.

Pls pay attention: setText() is not available for COMBOBOX, you MUST use setValue(). This is a bit un-nice: in the tag all attributes are available that exist for all components. You need to restrict yourself to these attribute which are offered for the component. You eihter get this info from the layout editor (by clicking onto one component and seeing its attribtues) or you also may get this info from the tag library description (eclnt.tld) which is in the META-INF of the eclntjsfserver.jar file.

Then: if you switch the COMBOBOX to EDITABLE="true" then the following happens when the user inputs a text:
(a) the text matches EXACTLY the text of one item ==> the id of this item is transferred
(b) the text does not match the text of an item ==> the text that the user did input is transferred.

At server side, with an editable COMBOBOX, you need to react and check if the value is a known Id or if it is new text.

Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team