I just noticed some naming container problem with dynaForm and composite components.
Obviously a composite component's cc.clientId contains a "r...c...reg" (depending on the row and column number). But it cannot be referenced by this id. Nor can its children. If I just ignore this part of the id I can reference the component (or its children).
Can anybody confirm this? Is there anything I can do about it?
DynaForm and composite components
Do you mean CC inside pe:dynaFormControl tag? But this is normal. Every component inside DynaForm gets prepended ID because DynaForm is a NamingContainer. If you place your CC inside p:dataTable e.g., you will get the same prepending. Prepended ID is generated by UIData at runtime. For DynaForm it looks like e.g. as "dynaForm:r1c2reg". Where "dynaForm" is the ID of the pe:dynaForm and "r1c2reg" says "the component is placed in the 1. row, 2. column in regular view area". Sure, you can reference your CC and any other component inside DynaForm by ID. DynaForm takes care about proper resolving. There is no difference in comparison to other UIData components as I said. You don't need to know about "r1c2reg"!
Show you code please if you have trouble.
Show you code please if you have trouble.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
I am talking about a composite component used as a component for a dynaFormControl:
If I display the cc.clientId inside td:address I get an id containing r1c1reg (or similar). Is this by design?
If so, how would I reference for example another component inside td:address? I was only successful with a fully qualified id.
But the only way I can think of to build a fully qualified id is to use cc.clientId. But it doesn't work because it contains r1c1reg or something. If I remove r1c1reg it works like a charm.
Code: Select all
<pe:dynaForm id="dynaForm" value="#{dynaFormHandler.model}">
<pe:dynaFormControl type="consignor" for="consignor">
<td:address id="consignor" value="#{dynaFormHandler.workingObject.consignor}" />
</pe:dynaFormControl>
</pe:dynaForm>
If so, how would I reference for example another component inside td:address? I was only successful with a fully qualified id.
But the only way I can think of to build a fully qualified id is to use cc.clientId. But it doesn't work because it contains r1c1reg or something. If I remove r1c1reg it works like a charm.
Using
Primefaces 11.0.1
Extensions 11.0.4
Mojarra 2.3.14.SP01
Wildfly 21.0.2.Final
Primefaces 11.0.1
Extensions 11.0.4
Mojarra 2.3.14.SP01
Wildfly 21.0.2.Final
Sure. It is JSF. If you would place your <td:address .../> inside h:dataTable, p:dataTable, p:dataList, ... even inside h:form without prependId="false", you will get the same result! JSF standrad prepends in table e.g. something with tableId:j_idt19:j_idt20. What is the problem? You haven't still described your problem. Where do you need clientId?If I display the cc.clientId inside td:address I get an id containing r1c1reg (or similar). Is this by design?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
As I said the problem is to reference another child component inside the composite.
Imagine the following:
This way it doesn't update "info" (component not found). If I use a fully qualified name (which doesn't seem to conatin r1c1reg) it works.
But how to get the fully qualified name/id of "info"? I can't prepend cc.clientId as it contains the r1c1reg stuff.
Maybe it's absoluetly not related to dynaForm. But so far I didn't have any problems prepending the clientId anywhere else in my app.
Imagine the following:
Code: Select all
<composite:implementation>
<p:autoComplete id="value" value="#{cc.attrs.value}" var="record" converter=...>
<p:ajax event="itemSelect" update="#{cc.attrs.update} info" />
<p:column>
<h:outputText value="#{record.name}" />
</p:column>
...
</p:autoComplete>
<h:outputText id="info" value="#{cc.attr.value.info}" />
...
But how to get the fully qualified name/id of "info"? I can't prepend cc.clientId as it contains the r1c1reg stuff.
Maybe it's absoluetly not related to dynaForm. But so far I didn't have any problems prepending the clientId anywhere else in my app.
Using
Primefaces 11.0.1
Extensions 11.0.4
Mojarra 2.3.14.SP01
Wildfly 21.0.2.Final
Primefaces 11.0.1
Extensions 11.0.4
Mojarra 2.3.14.SP01
Wildfly 21.0.2.Final
This is really not related to DynaForm. Try this
or any other jQuery selector or put the entire CC in a div http://www.ibm.com/developerworks/java/ ... .html#wrap I don't know.
Code: Select all
<p:ajax event="itemSelect" update="#{cc.attrs.update} @(##{cc.client}:info)" />
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
I tried a surrounding div without success. And using jQuery selector wasn't successful either. Though I am not sure I used it correctly.
Some variants let me run into javascript errors complaining about "mainForm" which is the first part of the fully qualified id.
And sometimes I don't get any errors but it just doesn't update the selected id.
BTW, I assume you wanted to write "cc.clientId" instead of "cc.client"!? And what about the double "#" at the beginning?
Anyway - thanks a lot so far. I hope I can solve this problem and use dynaForm - it's cool!!!
Some variants let me run into javascript errors complaining about "mainForm" which is the first part of the fully qualified id.
And sometimes I don't get any errors but it just doesn't update the selected id.
BTW, I assume you wanted to write "cc.clientId" instead of "cc.client"!? And what about the double "#" at the beginning?
Anyway - thanks a lot so far. I hope I can solve this problem and use dynaForm - it's cool!!!
Using
Primefaces 11.0.1
Extensions 11.0.4
Mojarra 2.3.14.SP01
Wildfly 21.0.2.Final
Primefaces 11.0.1
Extensions 11.0.4
Mojarra 2.3.14.SP01
Wildfly 21.0.2.Final
My idea was to use PFS (PrimeFaces Selectors) feature. That means @(#someClientId) in render / update attr. Simple look in Firebug and figure out the clientId. This code
should be resolved as
This is clientId of info component. But look Firebug first.
Code: Select all
@(##{cc.clientId}:info)
Code: Select all
@(#clientIdOfCompositeComponent:info)
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
Ahh, I see.
I tried it and it seems to work for @(#mainForm) as I can see the partial.render parameter including a "mainForm" in the post.
But I run into a javascript error when I try to use a different id like @(#mainForm:whatever). Though I checked for this to be an existing id with Firebug.
Error: Syntax error, unrecognized expression: whatever
Maybe a problem of the preceding colon?
I tried it and it seems to work for @(#mainForm) as I can see the partial.render parameter including a "mainForm" in the post.
But I run into a javascript error when I try to use a different id like @(#mainForm:whatever). Though I checked for this to be an existing id with Firebug.
Error: Syntax error, unrecognized expression: whatever
Maybe a problem of the preceding colon?
Using
Primefaces 11.0.1
Extensions 11.0.4
Mojarra 2.3.14.SP01
Wildfly 21.0.2.Final
Primefaces 11.0.1
Extensions 11.0.4
Mojarra 2.3.14.SP01
Wildfly 21.0.2.Final
-
- Information
-
Who is online
Users browsing this forum: No registered users and 22 guests