--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To post to this group, send email to nitro...@googlegroups.com.
To unsubscribe from this group, send email to nitrogenweb...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nitrogenweb?hl=en.
--
I think that's probably a good idea.Perhaps we could change it so that the id of the element gets emitted as the actual html ID, while also adding an htmlid attribute that, if specified, would overwrite the emitted id.
Emitting the wfid as the HTML id might lead to problems as nitrogen
elements can have more than one wfid, usually the named wfid, and the
wfid_temp, which is why I'm probably leaning toward adding just an
html_id field to the base element to simplify it.
Perhaps for a long-term goal it might be worthwhile to emit the htmlid
as the id, but the complications may arise with compound elements such
as #bind.
In any case, if anyone wants to save me the work and add html_id to
the base element and modify all elements to emit it, I wouldn't save
no :)
-Jesse
> --
> You received this message because you are subscribed to the Google Groups
> "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
> To post to this group, send email to nitro...@googlegroups.com.
> To unsubscribe from this group, send email to
> nitrogenweb...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nitrogenweb?hl=en.
--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm
In any case, if anyone wants to save me the work and add html_id to
the base element and modify all elements to emit it, I wouldn't save
no :)
On Tue, Mar 20, 2012 at 5:05 PM, Jesse Gumm <gu...@sigma-star.com> wrote:In any case, if anyone wants to save me the work and add html_id to
the base element and modify all elements to emit it, I wouldn't save
no :)
I have done this for textbox, textarea and dropdown in nitrogen_core, but with the html_id in the record for each element. Might be useful as a starting point for someone.
-Jesse
Just to add some confusion to that subject. I did it the other way (for the same need of Jquery
mobile integration).
I created JQM elements that matches base elements for those that needs Jquery mobile attributes such
as :
- element_jqm_panel
- element_jqm_link,
etc....
And I duplicated some rendering code (to avoid touching current nitrogen structure) as :
-module(element_jqm_panel).
-compile(export_all).
-include_lib("nitrogen_core/include/wf.hrl").
-include("records.hrl").
reflect() -> record_info(fields, jqm_panel).
render_element(Record) ->
wf_tags:emit_tag('div', Record#jqm_panel.body, [
{class, ["panel", Record#jqm_panel.class]},
{style, Record#jqm_panel.style},
{id, Record#jqm_panel.id -- ".wfid_"},
{'data-role', Record#jqm_panel.data_role},
{'data-theme', Record#jqm_panel.data_theme},
{'data-collapsed', Record#jqm_panel.data_collapsed}
]).
Have a look at the ID line where I removed the ".wfid_" prefix. At least the record ID field
generates an ID html attribute ! (otherwise ID generates a class attribute, and html_id an ID attribute)
I think I would prefer that the nitrogen framework keep closer to the generated HTML instead of
creating new attributes.
My 2 cents,
Cheers,
S�bastien
Le 20/03/2012 23:36, Jesse Gumm a �crit :
Sébastien
For more options, visit this group at
http://groups.google.com/group/nitrogenweb?hl=en.
--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To post to this group, send email to nitro...@googlegroups.com.
To unsubscribe from this group, send email to nitrogenweb+unsubscribe@googlegroups.com.
Yep, there could be multiple wfids, but I think they are added to the class field, not to the ID
field, so what I did seems to work (at least I'm running it on a full web site and I didn't hit the
wall right now :-)).
The appending is done in wf_render_elements.erl
Cheers,
S�bastien.
Le 22/03/2012 21:27, Jeno I. Hajdu a �crit :
> Hi,
>
> I think most of us would prefer this, but the problem is what Jesse wrote previously, there can be
> cases when a single
> element has multiple wfids and then you can have problems.
> Anyway I have modified the elements to use a new html_id field, I plan to push it to github tonight.
> Alternatively we could figure out how to handle properly the case of multiple wfids in general from
> the id attribute's
> point of view.
>
> BR,
> Jeno
>
> 2012/3/22 S�bastien Saint-Sevin <seb-g...@matchix.com <mailto:seb-g...@matchix.com>>
>
> Hi list,
>
> Just to add some confusion to that subject. I did it the other way (for the same need of Jquery
> mobile integration).
>
> I created JQM elements that matches base elements for those that needs Jquery mobile attributes
> such as :
>
> - element_jqm_panel
> - element_jqm_link,
> etc....
>
> And I duplicated some rendering code (to avoid touching current nitrogen structure) as :
>
> -module(element_jqm_panel).
> -compile(export_all).
> -include_lib("nitrogen_core/__include/wf.hrl").
> -include("records.hrl").
>
> reflect() -> record_info(fields, jqm_panel).
>
> render_element(Record) ->
> wf_tags:emit_tag('div', Record#jqm_panel.body, [
> {class, ["panel", Record#jqm_panel.class]},
> {style, Record#jqm_panel.style},
> {id, Record#jqm_panel.id <http://jqm_panel.id> -- ".wfid_"},
> {'data-role', Record#jqm_panel.data_role},
> {'data-theme', Record#jqm_panel.data_theme},
> {'data-collapsed', Record#jqm_panel.data___collapsed}
> ]).
>
>
> Have a look at the ID line where I removed the ".wfid_" prefix. At least the record ID field
> generates an ID html attribute ! (otherwise ID generates a class attribute, and html_id an ID
> attribute)
>
> I think I would prefer that the nitrogen framework keep closer to the generated HTML instead of
> creating new attributes.
>
> My 2 cents,
> Cheers,
>
> S�bastien
>
> Le 20/03/2012 23:36, Jesse Gumm a �crit :
> <mailto:nitro...@googlegroups.com>.
> To unsubscribe from this group, send email to
> nitrogenweb+unsubscribe@__googlegroups.com
> <mailto:nitrogenweb%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/__group/nitrogenweb?hl=en
> <http://groups.google.com/group/nitrogenweb?hl=en>.
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Nitrogen Project /
> The Nitrogen Web Framework for Erlang" group.
> To post to this group, send email to nitro...@googlegroups.com
> <mailto:nitro...@googlegroups.com>.
> To unsubscribe from this group, send email to nitrogenweb+unsubscribe@__googlegroups.com
> <mailto:nitrogenweb%2Bunsu...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/__group/nitrogenweb?hl=en
> <http://groups.google.com/group/nitrogenweb?hl=en>.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Nitrogen Project / The
> Nitrogen Web Framework for Erlang" group.
> To post to this group, send email to nitro...@googlegroups.com.
> To unsubscribe from this group, send email to nitrogenweb...@googlegroups.com.