• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dynamic Labels for form UI
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic Labels for form UI


  • Subject: Re: Dynamic Labels for form UI
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 27 Aug 2008 12:39:08 -0700

Parable of David's Multi-coloured Checkboxes


On Aug 27, 2008, at 12:23 PM, David Holt wrote:

Hi Chuck,

Thanks for the reply. The only table is a list of variables to hold checkbox values.

T_Group
------------
pk id integer
member integer
isHappy integer
isFull integer
etc.

The labels are in html. 

I guess what I am asking is where I can apply logic to the checkbox bindings to make them correlate to a string binding? The label needs to point to a variable value, not a value, if that makes sense.

Not at all, really.


i.e. for variable "member" display string related to member "The group allows membership"
for variable "isHappy" display string related to isHappy "The group is a happy group"

Please don't give me grief for my "parable" variables ;-)

Me?  I would never do that!

I was thinking of something like a LabelledCheckbox component:

<wo:LabelledCheckbox name = "member" eo = "$aGroup" />

which would generate:

<wo:checkbox name = "member" value = "1" selection = "$selection" /> <wo:string value="$label" />

value comes from eo.valueForKey(valueForBinding("name")))

selection/setSelection wrap  eo.valueForKey(valueForBinding("name"))) /  eo.setValueForKey(newValue, valueForBinding("name")))

label finds the entity for T_Group, gets entity.attributeNamed(valueForBinding("name")) and then pulls the label text out of attribute.userInfo().valueForKey("label") if you want it from the EOModel or uses labelEO.valueForKey(valueForBinding("name"))) if you want it in the database.


Is that making any sense?


Chuck



On 27-Aug-08, at 11:51 AM, Chuck Hill wrote:


On Aug 27, 2008, at 11:36 AM, David Holt wrote:

Hi all,

I have a form with many wo:checkboxes. I would like to store the labels for the checkboxes in the database instead of hardcoding them in the html. Is there a way I can tie a specific checkbox to a unique value in a table of labels? For example: 

<wo:checkbox name = "member" value = "1" selection = "$aGroup.member" /> <wo:string value= ??? />

I think you would want a custom component that contained this or maybe the entire radio group? The component would have the logic to find the label.  I can't be more specific without knowing your database setup.


Chuck


-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/products/practical_webobjects








-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/products/practical_webobjects






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Dynamic Labels for form UI (From: David Holt <email@hidden>)
 >Re: Dynamic Labels for form UI (From: Chuck Hill <email@hidden>)
 >Re: Dynamic Labels for form UI (From: David Holt <email@hidden>)

  • Prev by Date: Re: Getting Eclipse to build a project imported from CVS
  • Next by Date: Re: Getting Eclipse to build a project imported from CVS
  • Previous by thread: Re: Dynamic Labels for form UI
  • Next by thread: How I Got WebAssitant Working on Leopard
  • Index(es):
    • Date
    • Thread