Author |
Message |
22/07/2009 15:06:49
|
nbethke
Power User
Joined: 21/07/2009 12:22:41
Messages: 27
Offline
|
A new question ;-)
I want to build a FixGrild with a Combobox within.
Unfortunately looks it like the attached file.
In my understanding it´s logical, because I have the objectbinding in the fixgrid, so I get one combobox per row. But I want to have one combobox with all rows.
Shouldn´t I enter the objectbinding directly in the combobox? So I would get one comboboxitem per row.
Where is my error?
Thx and greets
Nadine
|
Filename |
fixgrid.jpg |
Download
|
Description |
|
Filesize |
7 Kbytes
|
Downloaded: |
429 time(s) |
|
|
|
22/07/2009 16:10:40
|
gjones
Power User
Joined: 30/06/2009 16:52:33
Messages: 38
Offline
|
I'm not sure I completely understand you, but in my case I have a combo within a grid and it works just fine.
In the combobox's validvaluesbinding I have #{d.SomeClass.myvalues} and in the value property .{myvalue} (where "d" is my dispatcher and SomeClass is the class backing my "page"). Have you somehow put your value bindings object in the class providing the backing for the grid contents (i.e. for each row) or something?
|
|
|
22/07/2009 17:02:43
|
nbethke
Power User
Joined: 21/07/2009 12:22:41
Messages: 27
Offline
|
Hmm...
this is my jsp:
[...]
<t:row id="g_7" >
<t:fixgrid id="g_8" objectbinding="#{masterdata.productgroups}" sbvisibleamount="10" width="100%" >
<t:gridcol id="g_9" text="Column" width="100" >
<t:combobox id="g_10" validvaluesbinding="#{masterdata.productgroups}" value=".{name}" width="100" >
<t:comboboxitem id="g_11" text=".{name}" value=".{name}" />
</t:combobox>
</t:gridcol>
</t:fixgrid>
</t:row>
[...]
I tried different entries with ".{name}", but nothing made it better. The fixgrid needs a objectbinding, what did you fill in there?
"productgroups" is a list of rows with the attribute "name" among others.
Did I understand wrong?
|
|
|
22/07/2009 17:51:19
|
gjones
Power User
Joined: 30/06/2009 16:52:33
Messages: 38
Offline
|
nbethke wrote:
Hmm...
[...]
<t:row id="g_7" >
<t:fixgrid id="g_8" objectbinding="#{masterdata.productgroups}" sbvisibleamount="10" width="100%" >
<t:gridcol id="g_9" text="Column" width="100" >
<t:combobox id="g_10" validvaluesbinding="#{masterdata.productgroups}" value=".{name}" width="100" >
<t:comboboxitem id="g_11" text=".{name}" value=".{name}" />
</t:combobox>
</t:gridcol>
</t:fixgrid>
</t:row>
[...]
I tried different entries with ".{name}", but nothing made it better. The fixgrid needs a objectbinding, what did you fill in there?
"productgroups" is a list of rows with the attribute "name" among others.
Did I understand wrong?
Wait. You want your grid contents and combo contents to be... the same thing?
I have
...
<t:fixgrid id="g_9" height="100%" objectbinding="#{d.SomeClass.gridEntries}" sbvisibleamount="20" width="100%" >
...
<t:gridcol id="g_18" text="#{rr.literals.labelproject}" width="100" >
<t:combobox id="g_19" validvaluesbinding="#{d.SomeClass.myvalues}" value=".{value}" width="100" />
</t:gridcol>
Where my class looks something like
class MyClass implements Serializable {
private ValidValuesBinding myvalues;
private FIXGRIDListBinding<SomeItem> gridEntries = new FIXGRIDListBinding<SomeItem>();
...
}
|
|
|
22/07/2009 17:54:51
|
nbethke
Power User
Joined: 21/07/2009 12:22:41
Messages: 27
Offline
|
Thanks, I will check it tomorrow directly.
Greets
Nadine
|
|
|
23/07/2009 09:14:05
|
nbethke
Power User
Joined: 21/07/2009 12:22:41
Messages: 27
Offline
|
It´s a bit embarrassing for me, but...I can´t find any infos about ValidValuesBinding
Now I have this:
<t:row id="g_7" >
<t:fixgrid id="g_8" objectbinding="#{masterdata.productgroups}" sbvisibleamount="10" width="100%" >
<t:gridcol id="g_9" text="Column" width="100" >
<t:combobox id="g_10" validvaluesbinding="#{masterdata.myvalues}" value=".{name}" width="100" />
</t:gridcol>
</t:fixgrid>
</t:row>
At adding values to "myvalues" I wrote
myvalues.addValidValue("name", <textINname>);
But now I have various comboboxes again. But in every box there is the same entry...
|
|
|
23/07/2009 11:18:13
|
rheinrichs
Power User
Joined: 08/05/2009 10:05:36
Messages: 209
Offline
|
Hi!
Looks like my first experiences with comboboxes.
I attache a example with sourcecode, that works fine for me.
Did this solve your problem?
regards
PS: maybe you want to take a look at "ComboFields", too.
Now I use them for special database and reload elements. ;-)
Filename |
combogrip.zip |
Download
|
Description |
|
Filesize |
2 Kbytes
|
Downloaded: |
441 time(s) |
|
|
|
23/07/2009 11:22:23
|
rheinrichs
Power User
Joined: 08/05/2009 10:05:36
Messages: 209
Offline
|
additional screenshot for this example
|
Filename |
screenshot.jpg |
Download
|
Description |
|
Filesize |
46 Kbytes
|
Downloaded: |
356 time(s) |
|
|
|
|