You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by 許議中 <jo...@erp.tw> on 2007/03/06 01:55:33 UTC

How to get this widget

Hi!

I've a form, the def is like.

<fd:form
  xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">

<fd:widgets>
.....	
	<fd:repeater id="repeaterList" orderable="true">
		<fd:widgets>
			<fd:output id="itemno">
  			<fd:label><i18n:text>itemno</i18n:text></fd:label>
  			<fd:hint><i18n:text>itemno</i18n:text></fd:hint>
	  		<fd:datatype base="integer"/>
		  </fd:output>

      <fd:field id="itemtype">
        <fd:datatype base="string"/>
        <fd:selection-list>
          <fd:item value=""/>
					<fd:item value =
"01"><fd:label><i18n:text>item01</i18n:text></fd:label></fd:item>					
					<fd:item value =
"02"><fd:label><i18n:text>item02</i18n:text></fd:label></fd:item>					
					<fd:item value =
"03"><fd:label><i18n:text>item03</i18n:text></fd:label></fd:item>					
					<fd:item value =
"04"><fd:label><i18n:text>item04</i18n:text></fd:label></fd:item>					
        </fd:selection-list>
      </fd:field>

      <fd:union id="item" case="itemtype">
        <fd:widgets>

          <fd:group id="01">
            <fd:widgets>
              <fd:field id="url">
                <fd:label><i18n:text>url</i18n:text></fd:label>
                <fd:hint><i18n:text>url</i18n:text></fd:hint>
                <fd:datatype base="string"/>
              </fd:field>
....
            </fd:widgets>
          </fd:group>

        </fd:widgets>
      </fd:union>
.....

How to get the url widget in repeater group id = "01"

Best Regards

johnson

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to get this widget

Posted by 許議中 <jo...@erp.tw>.
I'm write a wap page, like CMS, manager can define the content of pages, because
of using in wap, so the cocoon portal is not suitable.

I can manage the indivisual table seperatly now, by programing, but if there is
a binding schema, will reduce the work when define a new type page.

Best Regards

johnson

bart remmerie 提到:
> Could you please give the use case for this ?
> I think there could be a more simple solution (if the use case is what
> I think it is).
> 
> Bart
> 
> 2007/3/6, Jason Johnston <co...@lojjic.net>:
> 
>> 許議中 wrote:
>> > using repeaterList.getRow(i).lookupWidget("item/01/url"); --- it's ok.
>> >
>> > But repeaterList.getRow(i).getChild("item/01/url");  --it'not. why?
>>
>> The getChild() method only gets direct children; lookupWidget() allows
>> you to use an xpath-like path for easier traversal.  So:
>>
>>   widget.lookupWidget("item/01/url")
>>
>> is the same as:
>>
>>   widget.getChild("item").getChild("01").getChild("url")
>>
>>
>> > and additional Question, How to binding this kind of form in to 
>> javabeans.
>> >
>> > one type table(type01/type02...) refer to a independent table.
>>
>> Can you elaborate on this question?  I don't understand what you're 
>> asking.
>>
>> Are you already using the CForms binding framework?
>>
>>
>> >
>> >
>> >
>> > Jason Johnston 提到:
>> >> 許議中 wrote:
>> >>
>> >>> In Javascript (FlowScript)
>> >>>
>> >>> There're several rows in the repeater, I can get the itemno wigdet 
>> with
>> >>> repeaterList.getRow(i).getChild("itemno")
>> >>>
>> >>> But I can't get the url widget in the 01 group.
>> >>
>> >> What have you tried?  If I understand your example it should be
>> >> something like:  repeaterList.getRow(i).lookupWidget("item/01/url");
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to get this widget

Posted by bart remmerie <re...@gmail.com>.
Could you please give the use case for this ?
I think there could be a more simple solution (if the use case is what
I think it is).

Bart

2007/3/6, Jason Johnston <co...@lojjic.net>:
> 許議中 wrote:
> > using repeaterList.getRow(i).lookupWidget("item/01/url"); --- it's ok.
> >
> > But repeaterList.getRow(i).getChild("item/01/url");  --it'not. why?
>
> The getChild() method only gets direct children; lookupWidget() allows
> you to use an xpath-like path for easier traversal.  So:
>
>   widget.lookupWidget("item/01/url")
>
> is the same as:
>
>   widget.getChild("item").getChild("01").getChild("url")
>
>
> > and additional Question, How to binding this kind of form in to javabeans.
> >
> > one type table(type01/type02...) refer to a independent table.
>
> Can you elaborate on this question?  I don't understand what you're asking.
>
> Are you already using the CForms binding framework?
>
>
> >
> >
> >
> > Jason Johnston 提到:
> >> 許議中 wrote:
> >>
> >>> In Javascript (FlowScript)
> >>>
> >>> There're several rows in the repeater, I can get the itemno wigdet with
> >>> repeaterList.getRow(i).getChild("itemno")
> >>>
> >>> But I can't get the url widget in the 01 group.
> >>
> >> What have you tried?  If I understand your example it should be
> >> something like:  repeaterList.getRow(i).lookupWidget("item/01/url");
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


-- 
Bart Remmerie

Re: How to get this widget

Posted by Jason Johnston <co...@lojjic.net>.
許議中 wrote:
> using repeaterList.getRow(i).lookupWidget("item/01/url"); --- it's ok.
> 
> But repeaterList.getRow(i).getChild("item/01/url");  --it'not. why?

The getChild() method only gets direct children; lookupWidget() allows
you to use an xpath-like path for easier traversal.  So:

  widget.lookupWidget("item/01/url")

is the same as:

  widget.getChild("item").getChild("01").getChild("url")


> and additional Question, How to binding this kind of form in to javabeans.
> 
> one type table(type01/type02...) refer to a independent table.

Can you elaborate on this question?  I don't understand what you're asking.

Are you already using the CForms binding framework?


> 
> 
> 
> Jason Johnston 提到:
>> 許議中 wrote:
>>
>>> In Javascript (FlowScript)
>>>
>>> There're several rows in the repeater, I can get the itemno wigdet with
>>> repeaterList.getRow(i).getChild("itemno")
>>>
>>> But I can't get the url widget in the 01 group.
>>
>> What have you tried?  If I understand your example it should be
>> something like:  repeaterList.getRow(i).lookupWidget("item/01/url");
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to get this widget

Posted by 許議中 <jo...@erp.tw>.
using repeaterList.getRow(i).lookupWidget("item/01/url"); --- it's ok.

But repeaterList.getRow(i).getChild("item/01/url");  --it'not. why?

and additional Question, How to binding this kind of form in to javabeans.

one type table(type01/type02...) refer to a independent table.

Best Regards

johnson



Jason Johnston 提到:
> 許議中 wrote:
> 
>>In Javascript (FlowScript)
>>
>>There're several rows in the repeater, I can get the itemno wigdet with
>>repeaterList.getRow(i).getChild("itemno")
>>
>>But I can't get the url widget in the 01 group.
> 
> 
> What have you tried?  If I understand your example it should be
> something like:  repeaterList.getRow(i).lookupWidget("item/01/url");
> 
> 
> 
>>Jason Johnston 提到:
>>
>>>許議中 wrote:
>>>
>>>
>>>>Hi!
>>>>
>>>>I've a form, the def is like.
>>>>
>>>><fd:form
>>>> xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
>>>> xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
>>>>
>>>><fd:widgets>
>>>>.....	
>>>>	<fd:repeater id="repeaterList" orderable="true">
>>>>		<fd:widgets>
>>>>			<fd:output id="itemno">
>>>> 			<fd:label><i18n:text>itemno</i18n:text></fd:label>
>>>> 			<fd:hint><i18n:text>itemno</i18n:text></fd:hint>
>>>>	  		<fd:datatype base="integer"/>
>>>>		  </fd:output>
>>>>
>>>>     <fd:field id="itemtype">
>>>>       <fd:datatype base="string"/>
>>>>       <fd:selection-list>
>>>>         <fd:item value=""/>
>>>>					<fd:item value =
>>>>"01"><fd:label><i18n:text>item01</i18n:text></fd:label></fd:item>					
>>>>					<fd:item value =
>>>>"02"><fd:label><i18n:text>item02</i18n:text></fd:label></fd:item>					
>>>>					<fd:item value =
>>>>"03"><fd:label><i18n:text>item03</i18n:text></fd:label></fd:item>					
>>>>					<fd:item value =
>>>>"04"><fd:label><i18n:text>item04</i18n:text></fd:label></fd:item>					
>>>>       </fd:selection-list>
>>>>     </fd:field>
>>>>
>>>>     <fd:union id="item" case="itemtype">
>>>>       <fd:widgets>
>>>>
>>>>         <fd:group id="01">
>>>>           <fd:widgets>
>>>>             <fd:field id="url">
>>>>               <fd:label><i18n:text>url</i18n:text></fd:label>
>>>>               <fd:hint><i18n:text>url</i18n:text></fd:hint>
>>>>               <fd:datatype base="string"/>
>>>>             </fd:field>
>>>>....
>>>>           </fd:widgets>
>>>>         </fd:group>
>>>>
>>>>       </fd:widgets>
>>>>     </fd:union>
>>>>.....
>>>>
>>>>How to get the url widget in repeater group id = "01"
>>>
>>>
>>>Get it using what?  JavaScript?  From what context?
>>>
>>>Also, since it's in a repeater there will be multiple instances of the
>>>widget depending on the size of the repeater, correct?  So are you
>>>trying to target a single instance, or something else?
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to get this widget

Posted by Jason Johnston <co...@lojjic.net>.
許議中 wrote:
> In Javascript (FlowScript)
> 
> There're several rows in the repeater, I can get the itemno wigdet with
> repeaterList.getRow(i).getChild("itemno")
> 
> But I can't get the url widget in the 01 group.

What have you tried?  If I understand your example it should be
something like:  repeaterList.getRow(i).lookupWidget("item/01/url");


> 
> Jason Johnston 提到:
>> 許議中 wrote:
>>
>>> Hi!
>>>
>>> I've a form, the def is like.
>>>
>>> <fd:form
>>>  xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
>>>  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
>>>
>>> <fd:widgets>
>>> .....	
>>> 	<fd:repeater id="repeaterList" orderable="true">
>>> 		<fd:widgets>
>>> 			<fd:output id="itemno">
>>>  			<fd:label><i18n:text>itemno</i18n:text></fd:label>
>>>  			<fd:hint><i18n:text>itemno</i18n:text></fd:hint>
>>> 	  		<fd:datatype base="integer"/>
>>> 		  </fd:output>
>>>
>>>      <fd:field id="itemtype">
>>>        <fd:datatype base="string"/>
>>>        <fd:selection-list>
>>>          <fd:item value=""/>
>>> 					<fd:item value =
>>> "01"><fd:label><i18n:text>item01</i18n:text></fd:label></fd:item>					
>>> 					<fd:item value =
>>> "02"><fd:label><i18n:text>item02</i18n:text></fd:label></fd:item>					
>>> 					<fd:item value =
>>> "03"><fd:label><i18n:text>item03</i18n:text></fd:label></fd:item>					
>>> 					<fd:item value =
>>> "04"><fd:label><i18n:text>item04</i18n:text></fd:label></fd:item>					
>>>        </fd:selection-list>
>>>      </fd:field>
>>>
>>>      <fd:union id="item" case="itemtype">
>>>        <fd:widgets>
>>>
>>>          <fd:group id="01">
>>>            <fd:widgets>
>>>              <fd:field id="url">
>>>                <fd:label><i18n:text>url</i18n:text></fd:label>
>>>                <fd:hint><i18n:text>url</i18n:text></fd:hint>
>>>                <fd:datatype base="string"/>
>>>              </fd:field>
>>> ....
>>>            </fd:widgets>
>>>          </fd:group>
>>>
>>>        </fd:widgets>
>>>      </fd:union>
>>> .....
>>>
>>> How to get the url widget in repeater group id = "01"
>>
>>
>> Get it using what?  JavaScript?  From what context?
>>
>> Also, since it's in a repeater there will be multiple instances of the
>> widget depending on the size of the repeater, correct?  So are you
>> trying to target a single instance, or something else?
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to get this widget

Posted by 許議中 <jo...@erp.tw>.
In Javascript (FlowScript)

There're several rows in the repeater, I can get the itemno wigdet with
repeaterList.getRow(i).getChild("itemno")

But I can't get the url widget in the 01 group.

johnson

Jason Johnston 提到:
> 許議中 wrote:
> 
>>Hi!
>>
>>I've a form, the def is like.
>>
>><fd:form
>>  xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
>>  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
>>
>><fd:widgets>
>>.....	
>>	<fd:repeater id="repeaterList" orderable="true">
>>		<fd:widgets>
>>			<fd:output id="itemno">
>>  			<fd:label><i18n:text>itemno</i18n:text></fd:label>
>>  			<fd:hint><i18n:text>itemno</i18n:text></fd:hint>
>>	  		<fd:datatype base="integer"/>
>>		  </fd:output>
>>
>>      <fd:field id="itemtype">
>>        <fd:datatype base="string"/>
>>        <fd:selection-list>
>>          <fd:item value=""/>
>>					<fd:item value =
>>"01"><fd:label><i18n:text>item01</i18n:text></fd:label></fd:item>					
>>					<fd:item value =
>>"02"><fd:label><i18n:text>item02</i18n:text></fd:label></fd:item>					
>>					<fd:item value =
>>"03"><fd:label><i18n:text>item03</i18n:text></fd:label></fd:item>					
>>					<fd:item value =
>>"04"><fd:label><i18n:text>item04</i18n:text></fd:label></fd:item>					
>>        </fd:selection-list>
>>      </fd:field>
>>
>>      <fd:union id="item" case="itemtype">
>>        <fd:widgets>
>>
>>          <fd:group id="01">
>>            <fd:widgets>
>>              <fd:field id="url">
>>                <fd:label><i18n:text>url</i18n:text></fd:label>
>>                <fd:hint><i18n:text>url</i18n:text></fd:hint>
>>                <fd:datatype base="string"/>
>>              </fd:field>
>>....
>>            </fd:widgets>
>>          </fd:group>
>>
>>        </fd:widgets>
>>      </fd:union>
>>.....
>>
>>How to get the url widget in repeater group id = "01"
> 
> 
> 
> Get it using what?  JavaScript?  From what context?
> 
> Also, since it's in a repeater there will be multiple instances of the
> widget depending on the size of the repeater, correct?  So are you
> trying to target a single instance, or something else?
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to get this widget

Posted by Jason Johnston <co...@lojjic.net>.
許議中 wrote:
> Hi!
> 
> I've a form, the def is like.
> 
> <fd:form
>   xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
>   xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
> 
> <fd:widgets>
> .....	
> 	<fd:repeater id="repeaterList" orderable="true">
> 		<fd:widgets>
> 			<fd:output id="itemno">
>   			<fd:label><i18n:text>itemno</i18n:text></fd:label>
>   			<fd:hint><i18n:text>itemno</i18n:text></fd:hint>
> 	  		<fd:datatype base="integer"/>
> 		  </fd:output>
> 
>       <fd:field id="itemtype">
>         <fd:datatype base="string"/>
>         <fd:selection-list>
>           <fd:item value=""/>
> 					<fd:item value =
> "01"><fd:label><i18n:text>item01</i18n:text></fd:label></fd:item>					
> 					<fd:item value =
> "02"><fd:label><i18n:text>item02</i18n:text></fd:label></fd:item>					
> 					<fd:item value =
> "03"><fd:label><i18n:text>item03</i18n:text></fd:label></fd:item>					
> 					<fd:item value =
> "04"><fd:label><i18n:text>item04</i18n:text></fd:label></fd:item>					
>         </fd:selection-list>
>       </fd:field>
> 
>       <fd:union id="item" case="itemtype">
>         <fd:widgets>
> 
>           <fd:group id="01">
>             <fd:widgets>
>               <fd:field id="url">
>                 <fd:label><i18n:text>url</i18n:text></fd:label>
>                 <fd:hint><i18n:text>url</i18n:text></fd:hint>
>                 <fd:datatype base="string"/>
>               </fd:field>
> ....
>             </fd:widgets>
>           </fd:group>
> 
>         </fd:widgets>
>       </fd:union>
> .....
> 
> How to get the url widget in repeater group id = "01"


Get it using what?  JavaScript?  From what context?

Also, since it's in a repeater there will be multiple instances of the
widget depending on the size of the repeater, correct?  So are you
trying to target a single instance, or something else?




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org