Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need the SimpleComboBox to accept attribute values. #20

Closed
GoogleCodeExporter opened this issue Jun 16, 2015 · 3 comments
Closed

Need the SimpleComboBox to accept attribute values. #20

GoogleCodeExporter opened this issue Jun 16, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

The SimpleComboBox is currently able to handle this:

<form:SimpleComboBox 
     ui:field="blah" 
     width="80" triggerAction="ALL" 
     editable="false" 
     simpleValue="{constants.before}">
   <form:value>before</form:value>
   <form:value>after</form:value>
</form:SimpleComboBox>

How hard would it be to support this:
<form:SimpleComboBox 
     ui:field="blah" 
     width="80" triggerAction="ALL" 
     editable="false" 
     simpleValue="{constants.before}">
    <form:value add="{constants.before}"/>
    <form:value add="{constants.after}"/>
</form:SimpleComboBox>

?

This would allow me to use I18N constants (and messages).

thanks,
JR

Original issue reported on code.google.com by joel.re...@gmail.com on 25 Mar 2011 at 4:51

@GoogleCodeExporter
Copy link
Author

I didn't think of that when writing the parser.  I'll add something like that.  
Maybe <form:value text="{msg.foo}" /> to be more consistent with Buttons, etc

Original comment by jus...@jhickman.com on 25 Mar 2011 at 7:34

  • Changed state: Accepted
  • Added labels: Milestone-0.10

@GoogleCodeExporter
Copy link
Author

thanks!

Original comment by joel.re...@gmail.com on 25 Mar 2011 at 11:12

@GoogleCodeExporter
Copy link
Author

After some effort, I am able to get 3 forms of this.

<form:SimpleComboBox
        width="80"
        triggerAction="ALL"
        editable="false"
        simpleValue="item 2">
    <form:value>item 1</form:value>
    <form:value>item 2</form:value>
</form:SimpleComboBox>

<form:SimpleComboBox
        width="80"
        triggerAction="ALL"
        editable="false"
        simpleValue="{issue20constants.after}">
    <form:item value="{issue20constants.before}" />
    <form:item value="{issue20constants.after}" />
</form:SimpleComboBox>

<form:SimpleComboBox
        width="80"
        triggerAction="ALL"
        editable="false"
        type="com.jhickman.web.gwt.gxtuibindertest.client.model.Music"
        simpleValue="{issue20constants.music2}">
    <form:item value="{issue20constants.music1}" />
    <form:item value="{issue20constants.music2}" />
    <form:item value="{issue20constants.music3}" />
</form:SimpleComboBox>

The first one is the one I added last week.  Only works with Strings since it's 
using an innerHTML.
The second and third are very similar.  By default, the item values will be 
parsed as Strings, but the SimpleComboBox can be applied with a "type" 
attribute.  The value should resolve to a fully qualified Class.  In this case, 
I make my issue20Constants music1(), etc return Music type. 

Original comment by jus...@jhickman.com on 26 Mar 2011 at 4:47

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant