You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by karthik <ka...@infotech-enterprises.com> on 2012/03/08 07:27:45 UTC

Adding Columns on Button Click in Wicket

Hi,
I am a newbie in Wicket.

I have a table with 4 columns , for which i have a html and java file
respectively.

My requirement is that there is a button on the right corner, which on click
, should add new columns to the right of the existing table.

Should i make any changes to the markup ?

Any suggestions to achieve this will be of help.

Thanks in advance,
Karhthik




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-Columns-on-Button-Click-in-Wicket-tp4455701p4455701.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Adding Columns on Button Click in Wicket

Posted by Martin Grigorov <mg...@apache.org>.
In this case you may need to implement
org.apache.wicket.markup.IMarkupResourceStreamProvider to be able to
provide dynamic markup.

On Thu, Mar 8, 2012 at 1:04 PM, karthik
<ka...@infotech-enterprises.com> wrote:
> Hi Martin ,
>
> "Reload the Table with New Columns" .
>
> How would i add the new column markup in my html page for this newly added
> Column in the table ?
>
> "Will that be added dynamically" ?
>
> In the code below , the first column here is a check box, and the second one
> is a input field.
>
> Thanks in advance
>
> Karthik
>
>
> My html file excerpt:
>
>
>
> <thead>
>     <tr>
>        <th>   <wicket:message  key="abc"/>  </th>
>        <th>   <wicket:message key="xyz"/>  </th>
>                </tr>
> </thead>
>
>
> <tbody wicket:id="TestTable" >
>
>          <tr wicket:id="wmc" >
>                       <td><input wicket:id="abc" value="abcValue" type="checkbox"
> name=cbAbc></td>
>                       <td><input wicket:id="xyz" </td>
>             </tr>
> </tbody>
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-Columns-on-Button-Click-in-Wicket-tp4455701p4456140.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Adding Columns on Button Click in Wicket

Posted by karthik <ka...@infotech-enterprises.com>.
Hi Martin , 

"Reload the Table with New Columns" .

How would i add the new column markup in my html page for this newly added
Column in the table ?

"Will that be added dynamically" ?

In the code below , the first column here is a check box, and the second one
is a input field.

Thanks in advance

Karthik


My html file excerpt: 



<thead>
     <tr>
     	<th>   <wicket:message  key="abc"/>  </th>
      	<th>   <wicket:message key="xyz"/>  </th>
         	</tr>
</thead>			   
			

<tbody wicket:id="TestTable" >

	  <tr wicket:id="wmc" >
		       <td><input wicket:id="abc" value="abcValue" type="checkbox"
name=cbAbc></td>
		       <td><input wicket:id="xyz" </td>      
	     </tr>		 
</tbody>




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-Columns-on-Button-Click-in-Wicket-tp4455701p4456140.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Adding Columns on Button Click in Wicket

Posted by karthik <ka...@infotech-enterprises.com>.
Thanks Martin,
Shall try to explore your suggestions.

regards,
Karthik

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-Columns-on-Button-Click-in-Wicket-tp4455701p4455858.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Adding Columns on Button Click in Wicket

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Put the Button in a Toolbar. See DefaultDataTable's code, it shows how
to add toolbars.
I guess the easiest way for you is to re-create the complete DataTable
with the new columns after pressing the button.
Otherwise also check DataView and GridView components. They are more
flexible than DataTable.

On Thu, Mar 8, 2012 at 8:27 AM, karthik
<ka...@infotech-enterprises.com> wrote:
> Hi,
> I am a newbie in Wicket.
>
> I have a table with 4 columns , for which i have a html and java file
> respectively.
>
> My requirement is that there is a button on the right corner, which on click
> , should add new columns to the right of the existing table.
>
> Should i make any changes to the markup ?
>
> Any suggestions to achieve this will be of help.
>
> Thanks in advance,
> Karhthik
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-Columns-on-Button-Click-in-Wicket-tp4455701p4455701.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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